1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218
|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/PAVranking.R
\name{PAVranking}
\alias{PAVranking}
\title{Parcel-Allocation Variability in Model Ranking}
\usage{
PAVranking(model0, model1, data, parcel.names, item.syntax, nAlloc = 100,
fun = "sem", alpha = 0.05, bic.crit = 10, fit.measures = c("chisq",
"df", "cfi", "tli", "rmsea", "srmr", "logl", "aic", "bic", "bic2"), ...,
show.progress = FALSE, iseed = 12345, warn = FALSE)
}
\arguments{
\item{model0, model1}{\code{\link[lavaan:lavaan]{lavaan::lavaan()}} model syntax specifying
nested models (\code{model0} within \code{model1}) to be fitted
to the same parceled data. Note that there can be a mixture of
items and parcels (even within the same factor), in case certain items
should never be parceled. Can be a character string or parameter table.
Also see \code{\link[lavaan:model.syntax]{lavaan::lavaanify()}} for more details.}
\item{data}{A \code{data.frame} containing all observed variables appearing
in \verb{model0=} and \verb{model1=}, as well as those in the \verb{item.syntax=} used to
create parcels. If the data have missing values, multiple imputation
before parceling is recommended: submit a stacked data set (with a variable
for the imputation number, so they can be separated later) and set
\code{do.fit=FALSE} to return the list of \code{data.frame}s (one per
allocation), each of which is a stacked, multiply imputed data set with
parcels created using the same allocation scheme.}
\item{parcel.names}{\code{character} vector containing names of all parcels
appearing as indicators in \verb{model0=} or \verb{model1=}.}
\item{item.syntax}{\code{\link[lavaan:lavaan]{lavaan::lavaan()}} model syntax specifying the model
that would be fit to all of the unparceled items, including items that
should be randomly allocated to parcels appearing in \verb{model0=} and \verb{model1=}.}
\item{nAlloc}{The number of random items-to-parcels allocations to generate.}
\item{fun}{\code{character} string indicating the name of the
\code{\link[lavaan:lavaan]{lavaan::lavaan()}} function used to fit \verb{model0=} and \verb{model1=} to \verb{data=}.
Can only take the values \code{"lavaan"}, \code{"sem"}, \code{"cfa"}, or \code{"growth"}.}
\item{alpha}{Alpha level used as criterion for significance.}
\item{bic.crit}{Criterion for assessing evidence in favor of one model
over another. See Rafferty (1995) for guidelines (default is "very
strong evidence" in favor of the model with lower BIC).}
\item{fit.measures}{\code{character} vector containing names of fit measures
to request from each fitted \link[lavaan:lavaan-class]{lavaan::lavaan} model. See the
output of \code{\link[lavaan:fitMeasures]{lavaan::fitMeasures()}} for a list of available measures.}
\item{\dots}{Additional arguments to be passed to
\code{\link[lavaan:lavaanList]{lavaan::lavaanList()}}. See also \code{\link[lavaan:lavOptions]{lavaan::lavOptions()}}}
\item{show.progress}{If \code{TRUE}, show a \code{\link[utils:txtProgressBar]{utils::txtProgressBar()}}
indicating how fast each model-fitting iterates over allocations.}
\item{iseed}{(Optional) Random seed used for parceling items. When the same
random seed is specified and the program is re-run, the same allocations
will be generated. The seed argument can be used to assess parcel-allocation
variability in model ranking when considering more than two models. For each
pair of models under comparison, the program should be rerun using the same
random seed. Doing so ensures that multiple model comparisons will employ
the same set of parcel datasets. \emph{Note}: When using \pkg{parallel}
options, you must first type \code{RNGkind("L'Ecuyer-CMRG")} into the R
Console, so that the seed will be controlled across cores.}
\item{warn}{Whether to print warnings when fitting models to each allocation}
}
\value{
A \code{list} with 3 elements. The first two (\code{model0.results} and
\code{model1.results}) are results returned by \code{\link[=parcelAllocation]{parcelAllocation()}}
for \code{model0} and \code{model1}, respectively.
The third element (\code{model0.v.model1}) is a \code{list} of
model-comparison results, including the following:
\item{\verb{LRT_Summary:}}{ The average likelihood ratio test across
allocations, as well as the \emph{SD}, minimum, maximum, range, and the
proportion of allocations for which the test was significant.}
\item{\verb{Fit_Index_Differences:}}{ Differences in fit indices, organized
by what proportion favored each model and among those, what the average
difference was.}
\item{\verb{Favored_by_BIC:}}{ The proportion of allocations in which each
model met the criterion (\code{bic.crit}) for a substantial difference
in fit.}
\item{\verb{Convergence_Summary:}}{ The proportion of allocations in which
each model (and both models) converged on a solution.}
Histograms are also printed to the current plot-output device.
}
\description{
This function quantifies and assesses the consequences of parcel-allocation
variability for model ranking of structural equation models (SEMs) that
differ in their structural specification but share the same parcel-level
measurement specification (see Sterba & Rights, 2016). This function calls
\code{\link[=parcelAllocation]{parcelAllocation()}}---which can be used with only one SEM in
isolation---to fit two (assumed) nested models to each of a specified number
of random item-to-parcel allocations. Output includes summary information
about the distribution of model selection results (including plots) and the
distribution of results for each model individually, across allocations
within-sample. Note that this function can be used when selecting among more
than two competing structural models as well (see instructions below
involving the \verb{seed=} argument).
}
\details{
This is based on a SAS macro \code{ParcelAlloc} (Sterba & MacCallum, 2010).
The \code{PAVranking()} function produces results discussed in Sterba and
Rights (2016) relevant to the assessment of parcel-allocation variability in
model selection and model ranking. Specifically, the \code{PAVranking()}
function first calls \code{\link[=parcelAllocation]{parcelAllocation()}} to generate a given
number (\verb{nAlloc=}) of item-to-parcel allocations, fitting both specified
models to each allocation, and providing summaryies of PAV for each model.
Additionally, \code{PAVranking()} provides the following new summaries:
\itemize{
\item{PAV in model selection index values and model ranking between
Models \verb{model0=} and \verb{model1=}.}
\item{The proportion of allocations that converged and the proportion of
proper solutions (results are summarized for allocations with both
converged and proper allocations only).}
}
For further details on the benefits of the random allocation of items to
parcels, see Sterba (2011) and Sterba and MacCallum (2010).
To test whether nested models have equivalent fit, results can be pooled
across allocations using the same methods available for pooling results
across multiple imputations of missing data (see \strong{Examples}).
\emph{Note}: This function requires the \code{lavaan} package. Missing data
must be coded as \code{NA}. If the function returns \code{"Error in plot.new() : figure margins too large"}, the user may need to increase
size of the plot window (e.g., in RStudio) and rerun the function.
}
\examples{
## Specify the item-level model (if NO parcels were created)
## This must apply to BOTH competing models
item.syntax <- c(paste0("f1 =~ f1item", 1:9),
paste0("f2 =~ f2item", 1:9))
cat(item.syntax, sep = "\n")
## Below, we reduce the size of this same model by
## applying different parceling schemes
## Specify a 2-factor CFA with correlated factors, using 3-indicator parcels
mod1 <- '
f1 =~ par1 + par2 + par3
f2 =~ par4 + par5 + par6
'
## Specify a more restricted model with orthogonal factors
mod0 <- '
f1 =~ par1 + par2 + par3
f2 =~ par4 + par5 + par6
f1 ~~ 0*f2
'
## names of parcels (must apply to BOTH models)
(parcel.names <- paste0("par", 1:6))
\donttest{
## override default random-number generator to use parallel options
RNGkind("L'Ecuyer-CMRG")
PAVranking(model0 = mod0, model1 = mod1, data = simParcel, nAlloc = 100,
parcel.names = parcel.names, item.syntax = item.syntax,
# parallel = "multicore", # parallel available on Mac/Linux
std.lv = TRUE) # any addition lavaan arguments
## POOL RESULTS by treating parcel allocations as multiple imputations.
## Details provided in Sterba & Rights (2016); see ?poolMAlloc.
## save list of data sets instead of fitting model yet
dataList <- parcelAllocation(mod0, # or mod1 (either uses same allocations)
data = simParcel, nAlloc = 100,
parcel.names = parcel.names,
item.syntax = item.syntax,
do.fit = FALSE)
## now fit each model to each data set
if(requireNamespace("lavaan.mi")){
library(lavaan.mi)
fit0 <- cfa.mi(mod0, data = dataList, std.lv = TRUE)
fit1 <- cfa.mi(mod1, data = dataList, std.lv = TRUE)
anova(fit0, fit1) # Pooled test statistic comparing models.
help(package = "lavaan.mi") # Find more methods for pooling results.
}
}
}
\references{
Raftery, A. E. (1995). Bayesian model selection in social
research. \emph{Sociological Methodology, 25}, 111--163. \doi{10.2307/271063}
Sterba, S. K. (2011). Implications of parcel-allocation variability for
comparing fit of item-solutions and parcel-solutions. \emph{Structural
Equation Modeling, 18}(4), 554--577.\doi{10.1080/10705511.2011.607073}
Sterba, S. K., & MacCallum, R. C. (2010). Variability in parameter estimates
and model fit across repeated allocations of items to parcels.
\emph{Multivariate Behavioral Research, 45}(2), 322--358.
\doi{10.1080/00273171003680302}
Sterba, S. K., & Rights, J. D. (2016). Accounting for parcel-allocation
variability in practice: Combining sources of uncertainty and choosing the
number of allocations. \emph{Multivariate Behavioral Research, 51}(2--3),
296--313. \doi{10.1080/00273171.2016.1144502}
Sterba, S. K., & Rights, J. D. (2017). Effects of parceling on model
selection: Parcel-allocation variability in model ranking.
\emph{Psychological Methods, 22}(1), 47--68. \doi{10.1037/met0000067}
}
\seealso{
\code{\link[=parcelAllocation]{parcelAllocation()}} for fitting a single model,
\code{\link[=poolMAlloc]{poolMAlloc()}} for choosing the number of allocations
}
\author{
Terrence D. Jorgensen (University of Amsterdam; \email{TJorgensen314@gmail.com})
}
|