Standardized Solution
standardizedSolution.RdStandardized solution of a latent variable model.
Usage
standardizedSolution(object, type = "std.all", se = TRUE, zstat = TRUE,
pvalue = TRUE, ci = TRUE, level = 0.95,
boot_ci_type = "perc", cov_std = TRUE,
remove_eq = TRUE, remove_ineq = TRUE, remove_def = FALSE,
remove_aux = TRUE,
partable = NULL, glist = NULL, est = NULL,
output = "data.frame", ...)Arguments
- object
An object of class
lavaan.- type
If
"std.lv", the standardized estimates are based on the variances of the (continuous) latent variables only. If"std.all", the standardized estimates are based on the variances of both (continuous) observed and latent variables. If"std.nox", the standardized estimates are based on the variances of both (continuous) observed and latent variables, but not the variances of exogenous covariates. Note that"std.nox"only differs from"std.all"iffixed.x = TRUE; iffixed.x = FALSE, the exogenous covariates are treated as random variables (and standardized) just like any other variable, and a warning is issued. Alternatively,typemay be a vector of (observed) variable names (for exampletype = c("x1", "x2")); in that case only the parameters involving these variables are standardized (the other observed variables are left unstandardized). This is a generalization of"std.nox", where the (observed) exogenousxvariables are the ones left unstandardized.- se
Logical. If TRUE, standard errors for the standardized parameters will be computed, together with a z-statistic and a p-value.
- zstat
Logical. If
TRUE, an extra column is added containing the so-called z-statistic, which is simply the value of the estimate divided by its standard error.- pvalue
Logical. If
TRUE, an extra column is added containing the pvalues corresponding to the z-statistic, evaluated under a standard normal distribution.- ci
If
TRUE, confidence intervals are added to the output.- level
The confidence level required.
- boot_ci_type
Character. Only used if the model was fitted with
se = "bootstrap". In that case, bootstrap standard errors and bootstrap confidence intervals are computed for the standardized parameters (by re-standardizing each bootstrap draw), and this argument selects the type of bootstrap confidence interval, exactly as inparameterEstimates:"norm","basic","perc"(the default),"bca.simple"or"bca".- cov_std
Logical. If TRUE, the (residual) observed covariances are scaled by the square root of the `Theta' diagonal elements, and the (residual) latent covariances are scaled by the square root of the `Psi' diagonal elements. If FALSE, the (residual) observed covariances are scaled by the square root of the diagonal elements of the observed model-implied covariance matrix (Sigma), and the (residual) latent covariances are scaled by the square root of diagonal elements of the model-implied covariance matrix of the latent variables.
- remove_eq
Logical. If TRUE, filter the output by removing all rows containing equality constraints, if any.
- remove_ineq
Logical. If TRUE, filter the output by removing all rows containing inequality constraints, if any.
- remove_def
Logical. If TRUE, filter the output by removing all rows containing parameter definitions, if any.
- remove_aux
Logical. If TRUE (the default), filter the output by removing all rows corresponding to auxiliary (
aux=) variables added to the model as saturated correlates (only relevant whenmissing = "ml"and theaux=argument was used).- glist
List of model matrices. If provided, they will be used instead of the GLIST inside the object@Model slot. Only works if the
estargument is also provided. See Note.- est
Numeric. Parameter values (as in the `est' column of a parameter table). If provided, they will be used instead of the parameters that can be extracted from object. Only works if the
glistargument is also provided. See Note.- partable
A custom
listordata.framein which to store the standardized parameter values. If provided, it will be used instead of the parameter table inside the object@ParTable slot.- output
Character. If
"data.frame", the parameter table is displayed as a standard (albeit lavaan-formatted) data.frame. If"text"(or alias"pretty"), the parameter table is prettified and displayed with subsections (as used by the summary function).- ...
To support old argument names.
Details
The standardized estimates are functions of the (unstandardized) free
parameters and of (a subset of) the model-implied (co)variances used for
scaling. The standard errors reported by standardizedSolution are
therefore standard errors for the standardized parameters, and they
will in general differ from the standard errors of the unstandardized
parameters reported by parameterEstimates (or in the
summary() output). They are also not the same as the standard errors
that would be obtained by simply rescaling the unstandardized standard errors.
How the standard errors are computed depends on how the model was originally
fitted (in particular on the se= argument of lavaan,
cfa, sem, ...):
By default (
se = "standard","robust.sem","robust.huber.white", ...), the standard errors are obtained with the delta method: the Jacobian of the standardization function is computed (numerically) and combined with the variance-covariance matrix of the (unstandardized) parameter estimates. Any robustness present in that variance-covariance matrix (for example robust or sandwich-type standard errors) is automatically propagated to the standardized solution.If the model was fitted with
se = "bootstrap"(and the bootstrap draws are available), bootstrap standard errors and bootstrap confidence intervals are reported instead. These are obtained by re-standardizing each bootstrap draw and computing the standard deviation (for the standard error) and the requested interval type (seeboot_ci_type) of the resulting standardized values. Note that, as inparameterEstimates, the p-value is still computed by referring the z-statistic (standardized estimate divided by its bootstrap standard error) to a standard normal distribution.
There is no separate argument to choose the type of standard error
within standardizedSolution: the type always follows the se=
setting that was used when the model was fitted. To obtain, say, robust or
bootstrap standard errors for the standardized solution, refit the model with
the corresponding se= argument.
Note
The est, glist, and partable arguments are not meant for
everyday users, but for authors of external R packages that depend on
lavaan. Only to be used with great caution.
Value
A data.frame containing standardized model parameters.
If the model was fitted with se = "bootstrap" (and the bootstrap
draws are available), the standardized estimates in the bootstrap samples
are stored as the "boot_std" attribute of the returned data.frame (a
matrix with one row per bootstrap draw and one column per row of the
returned solution). These can be retrieved with
attr(x, "boot_std"), analogous to
lavInspect(object, "coef.boot") for the unstandardized solution.
In addition, if boot_ci_type = "bca", the empirical-influence design
matrix used to compute the acceleration constant is stored as the
"design" attribute (retrieve with attr(x, "design")).
Examples
HS.model <- ' visual =~ x1 + x2 + x3
textual =~ x4 + x5 + x6
speed =~ x7 + x8 + x9 '
fit <- cfa(HS.model, data=HolzingerSwineford1939)
standardizedSolution(fit)
#> lhs op rhs est.std se z pvalue ci.lower ci.upper
#> 1 visual =~ x1 0.772 0.055 14.041 0 0.664 0.880
#> 2 visual =~ x2 0.424 0.060 7.105 0 0.307 0.540
#> 3 visual =~ x3 0.581 0.055 10.539 0 0.473 0.689
#> 4 textual =~ x4 0.852 0.023 37.776 0 0.807 0.896
#> 5 textual =~ x5 0.855 0.022 38.273 0 0.811 0.899
#> 6 textual =~ x6 0.838 0.023 35.881 0 0.792 0.884
#> 7 speed =~ x7 0.570 0.053 10.714 0 0.465 0.674
#> 8 speed =~ x8 0.723 0.051 14.309 0 0.624 0.822
#> 9 speed =~ x9 0.665 0.051 13.015 0 0.565 0.765
#> 10 x1 ~~ x1 0.404 0.085 4.763 0 0.238 0.571
#> 11 x2 ~~ x2 0.821 0.051 16.246 0 0.722 0.920
#> 12 x3 ~~ x3 0.662 0.064 10.334 0 0.537 0.788
#> 13 x4 ~~ x4 0.275 0.038 7.157 0 0.200 0.350
#> 14 x5 ~~ x5 0.269 0.038 7.037 0 0.194 0.344
#> 15 x6 ~~ x6 0.298 0.039 7.606 0 0.221 0.374
#> 16 x7 ~~ x7 0.676 0.061 11.160 0 0.557 0.794
#> 17 x8 ~~ x8 0.477 0.073 6.531 0 0.334 0.620
#> 18 x9 ~~ x9 0.558 0.068 8.208 0 0.425 0.691
#> 19 visual ~~ visual 1.000 0.000 NA NA 1.000 1.000
#> 20 textual ~~ textual 1.000 0.000 NA NA 1.000 1.000
#> 21 speed ~~ speed 1.000 0.000 NA NA 1.000 1.000
#> 22 visual ~~ textual 0.459 0.064 7.189 0 0.334 0.584
#> 23 visual ~~ speed 0.471 0.073 6.461 0 0.328 0.613
#> 24 textual ~~ speed 0.283 0.069 4.117 0 0.148 0.418