This function computes point estimate and Monte Carlo confidence interval for
the multilevel composite reliability defined by Lai (2021) for a within-cluster
construct, shared cluster-level construct, and configural cluster construct by
calling the cfa
function in the R package lavaan.
multilevel.omega(..., data = NULL, cluster, rescov = NULL,
const = c("within", "shared", "config"),
fix.resid = NULL, optim.method = c("nlminb", "em"),
missing = c("listwise", "fiml"), nrep = 100000, seed = NULL,
conf.level = 0.95, print = c("all", "omega", "item"),
digits = 2, as.na = NULL, write = NULL, append = TRUE,
check = TRUE, output = TRUE)
call
function call
type
type of analysis
data
data frame specified in x
including the group variable
specified in cluster
args
specification of function arguments
model
specified model
model.fit
fitted lavaan object (mod.fit
)
check
results of the convergence and model identification check
result
list with result tables, i.e., omega
for the coefficient
omega including Monte Carlo confidence interval and
itemstat
for descriptive statistics
a matrix or data frame. Multilevel confirmatory factor
analysis based on a measurement model with one factor
at the Within level and one factor at the Between level
comprising all variables in the matrix or data frame is
conducted. Note that the cluster variable specified in
cluster
is excluded from x
when specifying
the argument cluster
using the variable name of the
cluster variable. Alternatively, an expression indicating
the variable names in data
e.g.,
multilevel.omega(x1, x2, x3, data = dat, cluster = "cluster")
.
Note that the operators
.
, +
, -
, ~
, :
, ::
,
and !
can also be used to select variables, see 'Details'
in the df.subset
function.
a data frame when specifying one or more variables in the
argument ...
. Note that the argument is NULL
when specifying a matrix or data frame for the argument
...
.
either a character string indicating the variable name of
the cluster variable in ...
or data
, or a
vector representing the nested grouping structure (i.e.,
group or cluster variable).
a character vector or a list of character vectors for specifying
residual covariances at the Within level, e.g. rescov = c("x1", "x2")
for specifying a residual covariance between indicators x1
and x2
at the Within level or rescov = list(c("x1", "x2"), c("x3", "x4"))
for specifying residual covariances between indicators x1
and x2
, and indicators x3
and x4
at
the Within level. Note that residual covariances at the
Between level cannot be specified using this function.
a character string indicating the type of construct(s), i.e.,
"within"
for within-cluster constructs, "shared"
for shared cluster-level constructs, and "config"
(default) for configural cluster constructs.
a character vector for specifying residual variances to be
fixed at 0 at the Between level, e.g., fix.resid = c("x1", "x3")
to fix residual variances of indicators x1
and x2
at the Between level at 0. Note that it is also possible
to specify fix.resid = "all"
which fixes all residual
variances at the Between level at 0 in line with the strong
factorial measurement invariance assumption across cluster.
a character string indicating the optimizer, i.e., "nlminb"
(default) for the unconstrained and bounds-constrained
quasi-Newton method optimizer and "em"
for the
Expectation Maximization (EM) algorithm.
a character string indicating how to deal with missing data,
i.e., "listwise"
for listwise deletion or "fiml"
(default) for full information maximum likelihood (FIML)
method.
an integer value indicating the number of Monte Carlo repetitions for computing confidence intervals.
a numeric value specifying the seed of the random number generator for computing the Monte Carlo confidence interval.
a numeric value between 0 and 1 indicating the confidence level of the interval.
a character vector indicating which results to show, i.e.
"all"
(default), for all results "omega"
for
omega, and "item"
for item statistics.
an integer value indicating the number of decimal places
to be used for displaying results. Note that loglikelihood,
information criteria and chi-square test statistic is
printed with digits
minus 1 decimal places.
a numeric vector indicating user-defined missing values,
i.e. these values are converted to NA
before conducting
the analysis. Note that as.na()
function is only
applied to x
but not to cluster
.
a character string naming a file for writing the output into
either a text file with file extension ".txt"
(e.g.,
"Output.txt"
) or Excel file with file extension
".xlsx"
(e.g., "Output.xlsx"
). If the file
name does not contain any file extension, an Excel file will
be written.
logical: if TRUE
(default), output will be appended
to an existing text file with extension .txt
specified
in write
, if FALSE
existing text file will be
overwritten.
logical: if TRUE
(default), argument specification, convergence
and model identification is checked.
logical: if TRUE
(default), output is shown.
Takuya Yanagida takuya.yanagida@univie.ac.at
Lai, M. H. C. (2021). Composite reliability of multilevel data: It’s about observed scores and construct meanings. Psychological Methods, 26(1), 90–102. https://doi.org/10.1037/met0000287
Rosseel, Y. (2012). lavaan: An R Package for Structural Equation Modeling. Journal of Statistical Software, 48, 1-36. https://doi.org/10.18637/jss.v048.i02
Venables, W. N., Ripley, B. D. (2002).Modern Applied Statistics with S (4th ed.). Springer. https://www.stats.ox.ac.uk/pub/MASS4/.
item.omega
, multilevel.cfa
, multilevel.fit
,
multilevel.invar
, multilevel.cor
,
multilevel.descript