Learn R Programming

psychonetrics (version 0.17.8)

parameters: Print parameter estimates

Description

This function will print a list of parameters of the model

Usage

parameters(x, standardized = FALSE)

Value

Invisibly returns a data frame containing information on all parameters (including the std and se_std columns when standardized = TRUE).

Arguments

x

A psychonetrics model.

standardized

Logical. If TRUE, the completely standardized (std.all) solution is computed and two extra columns are added next to the unstandardized estimate: std (the standardized point estimate) and se_std (its standard error, obtained by the delta method). Standardization rescales every variable to unit variance using the model-implied standard deviations, so that loadings, regression coefficients and (co)variances are expressed on a standardized scale (covariances become correlations; residual/disturbance variances become proportions of variance; residual/disturbance covariances become residual correlations), matching lavaan::standardizedSolution(type = "std.all") (Rosseel, 2012). Currently implemented for the lvm and varcov model families only; for all other families the std/se_std columns are returned as NA (with a warning). Default FALSE (unstandardized estimates only, exactly as before).

Author

Sacha Epskamp

Details

The standardized standard errors are obtained post-fit by differentiating the standardization map with respect to the free parameters (numDeriv::jacobian) and applying the delta method to the parameter covariance matrix; a fixed parameter (e.g. a marker loading) has se_std = NA because it has no sampling variance.

References

Rosseel, Y. (2012). lavaan: An R package for structural equation modeling. Journal of Statistical Software, 48(2), 1--36. tools:::Rd_expr_doi("10.18637/jss.v048.i02")

Examples

Run this code
# Load bfi data from psych package:
library("psychTools")
data(bfi)

# Also load dplyr for the pipe operator:
library("dplyr")

# Let's take the agreeableness items, and gender:
ConsData <- bfi %>% 
  select(A1:A5, gender) %>% 
  na.omit # Let's remove missingness (otherwise use Estimator = "FIML)

# Define variables:
vars <- names(ConsData)[1:5]

# Let's fit a full GGM:
mod <- ggm(ConsData, vars = vars, omega = "zero")

# Run model:
mod <- mod %>% runmodel

# Parameter estimates:
mod %>% parameters

# Standardized (std.all) solution with standard errors:
mod %>% parameters(standardized = TRUE)

Run the code above in your browser using DataLab