R/pre_define_functions.r
RSAVS_Mu_to_Mat.Rd
This function generate the group id matrix according to the subgroup effect vector mu_vec.
RSAVS_Mu_to_Mat(mu_vec)
res: a (n * p) matrix. Each row is for one observation and res[i, j] = 1 if i \(\in\) group_j and res[i, j] = 0 o.w.
n = length(mu_vec) is the number of observations.
p = length(unique(mu_vec)) is the number of subgroups.
In the result, 1st observation of mu_vec will always be in the 1st subgroup.