BW.MeanSD <- MLM.MeanSD(dat,
group1 = cc("Y.Wage, Y.Stress,X,
abuse,female,edu,tenure,
M, W,BA20size,BA20union,BA20regularwkpc,BA20Cycle"),
group2 = cc("Y.Wage.GroC, Y.Stress.GroC,Xw,
abuse.GroC,female.GroC,edu.GroC,tenure.GroC,
M, W,BA20size,BA20union,BA20regularwkpc,BA20Cycle"),
group3 = cc("Y.Wage_mean, Y.Stress_mean,Xb,
abuse_mean,female_mean,edu_mean,tenure_mean,
M, W,BA20size,BA20union,BA20regularwkpc,BA20Cycle"),
OutClean = T)
MLM.FullCor=cbind(BW.MeanSD,MLM.cor$cors)
new_variable <- c("Stress", "Wage", "International migrant status", "Concern of abuse",
"Gender", "Level of education", "Organization tenure",
"Collective voice", "Responsible sourcing",
"The size of the company", "The presence of unionization in the company",
"The percentage of regular workers", "Audit cycle/years with better work audit")
MLM.FullCor[, 1] <- new_variable
new_variable_names <- cc("Variable", "Mean", "Within_SD", "Between_SD",1:13)
setnames(MLM.FullCor, names(MLM.FullCor), new = new_variable_names)
MLM.FullCor$Within_SD <- substr(MLM.FullCor$Within_SD, 1, 5)
MLM.FullCor$Within_SD[8:length(MLM.FullCor$Within_SD)] <- ""
print_table(MLM.FullCor,title = "Table 1. Means, Standard Deviations, and Correlations among Study Variables",note = "Note: Correlations below and above the diagonal represent within-level and between-level correlations, respectively; For within-level, correlations are significant when absolute value above 0.030 (p < .05), 0.040 (p < .01) and 0.047 (p < .001); For between-level, correlations are significant when absolute value above 0.226 (p < .05), 0.317 (p < .01) and 0.371 (p < .001); Between-level N = 77")