Variables {mlmpower} | R Documentation |
These functions are the building blocks used to create the multilevel model and are used to specify the names, properties, and variable types.
outcome(name, mean = 10, sd = 5, icc = NULL)
within_predictor(name, weight = 1, mean = 0, sd = 1, icc = NULL)
within_time_predictor(name, values, weight = 1)
between_predictor(name, weight = 1, mean = 0, sd = 1)
between_binary_predictor(name, proportion = 0.5, weight = 1)
name |
a character string for the specific variable's name |
mean |
a single numeric value that specifies the variable's mean |
sd |
a single numeric value that specifies the variable's standard deviation |
icc |
a single numeric value between 0 and 1 that specifies the variable's intraclass correlation.
If |
weight |
a single numeric value specifying the variable's contribution to the variance explained metric. Weights are normalized across all variables of the same level. |
values |
a numeric vector specifying the time scores that will be repeated within each cluster. |
proportion |
a single numeric value between 0 and 1 that specifies the proportion of 1's at the population. |
Note that specifying an icc = 0
in within_predictor()
will result in a centered within cluster (CWC) predictor.
See vignettes for more details.
vignette(package = 'mlmpower')
Returns a mp_variable
object based on the variable's type.