r2mlm3_manual takes as input raw data and three-level multilevel model
(MLM) parameter estimates and outputs all relevant R-squared measures as well
as an accompanying bar chart.
r2mlm3_manual(
data,
l1_covs,
l2_covs,
l3_covs,
random_covs12,
random_covs13,
random_covs23,
gamma_1,
gamma_2,
gamma_3,
Tau12,
Tau13,
Tau23,
sigma2,
clustermeancentered = TRUE,
Tau2_noncmc = NULL,
Tau3_noncmc = NULL,
l2clusterID_noncmc = NULL,
l3clusterID_noncmc = NULL,
bargraph = TRUE
)If the input is valid, then the output will be a list and associated graphical representation of R-squared decompositions. If the input is not valid, it will return an error.
Dataset with rows denoting observations and columns denoting variables
Vector of numbers (or variable names) corresponding to the columns in the dataset of the level-1 predictors used in the MLM (if none used, set to NULL)
Vector of numbers (or variable names) corresponding to the columns in the dataset of the level-2 predictors used in the MLM (if none used, set to NULL)
Vector of numbers (or variable names) corresponding to the columns in the dataset of the level-3 predictors used in the MLM (if none used, set to NULL)
Vector of numbers (or variable names) corresponding to the columns in the dataset of the level-1 predictors that have random slopes across level-2 units in the MLM (if no such random slopes, set to NULL)
Vector of numbers (or variable names) corresponding to the columns in the dataset of the level-1 predictors that have random slopes across level-3 units in the MLM (if no such random slopes, set to NULL)
Vector of numbers (or variable names) corresponding to the columns in the dataset of the level-2 predictors that have random slopes across level-3 units in the MLM (if no such random slopes, set to NULL)
Vector of fixed slope estimates for all level-1 predictors, to be entered in the order of the predictors listed by l1_covs (if none, set to NULL)
Vector of fixed slope estimates for all level-2 predictors, to be entered in the order of the predictors listed by l2_covs (if none, set to NULL)
Vector of fixed slope estimates for all level-3 predictors, to be entered in the order of the predictors listed by l3_covs (if none, set to NULL)
For cluster-mean-centered model results (set to NULL if entering non-cluster-mean-centered model results), this is the random effect covariance matrix with the first row/column denoting the intercept variance and covariances across level-2 units and each subsequent row/column denotes a given level-1 predictor’s random slope variance and covariances across level-2 units (to be entered in the order listed by random_covs12; if none, set to NULL)
For cluster-mean-centered model results (set to NULL if entering non-cluster-mean-centered model results), this is the random effect covariance matrix with the first row/column denoting the intercept variance and covariances across level-3 units and each subsequent row/column denotes a given level-1 predictor’s random slope variance and covariances across level-3 units (to be entered in the order listed by random_covs13; if none, set to NULL)
For cluster-mean-centered model results (set to NULL if entering non-cluster-mean-centered model results), this is the random effect covariance matrix with each row/column denoting a given level-2 predictor’s random slope variance and covariances across level-3 units (to be entered in the order listed by random_covs23; if none, set to NULL)
Level-1 residual variance
By default, this argument is set to TRUE, indicating that cluster-mean-centered model results are being inputted. When instead entering non-cluster-mean-centered model results, set this argument to FALSE. Additionally, for non-cluster-mean-centered model results, random effect variances/covariances are to be entered in arguments Tau2_noncmc and Tau3_noncmc (defined below), rather than in the Tau12, Tau13, and Tau23 arguments used for cluster-mean-centered model results. Additionally, when entering non-cluster-mean-centered model results, user must specify l2clusterID_noncmc and l3clusterID_noncmc (neither of which are necessary for cluster-mean-centered model results). Function input is otherwise the same for cluster-mean-centered and non-cluster-mean-centered model results.
For non-cluster-mean-centered model results, this is the level-2 random effect covariance matrix; the first row/column denotes the intercept variance and covariances across level-2 units and each subsequent row/column denotes a given predictor’s random slope variance and covariances across level-2 units (to be entered in the order listed by randomcovsl2_noncmc; by default, this argument is set to NULL)
For non-cluster-mean-centered model results, this is the level-3 random effect covariance matrix; the first row/column denotes the intercept variance and covariances across level-3 units and each subsequent row/column denotes a given predictor’s random slope variance and covariances across level-3 units (to be entered in the order listed by randomcovsl2_noncmc; by default, this argument is set to NULL)
For non-cluster-mean-centered model results, this is the number (or variable name) corresponding to the column in the dataset containing the level-2 cluster identification (function assumes that each level-2 cluster ID is unique; by default, this argument is set to NULL)
For non-cluster-mean-centered model results, this is the number (or variable name) corresponding to the column in the dataset containing the level-3 cluster identification (function assumes that each level-3 cluster ID is unique; by default, this argument is set to NULL)
Optional bar graph output, default is TRUE.
This function can also accommodate two-level models. To input results for two-level models, set the following arguments equal to NULL: l3_covs, random_covs13, random_covs23, gamma_3, Tau13, Tau23.
Other r2mlm single model functions:
r2mlm_ci(),
r2mlm_long_manual(),
r2mlm_manual(),
r2mlm()