Skip to contents

standardize_model() post-processes the output of modsem_da() (or of modsem()) when method = "lms" / method = "qml"), replacing the unstandardized coefficient vector ($coefs) and its variance–covariance matrix ($vcov) with fully standardized counterparts (including the measurement model).The procedure is purely algebraic— no re-estimation is carried out —and is therefore fast and deterministic.

Usage

standardize_model(model, monte.carlo = FALSE, mc.reps = 10000, ...)

Arguments

model

A fitted object of class modsem_da. Passing any other object triggers an error.

monte.carlo

Logical. If TRUE, the function will use Monte Carlo simulation to obtain the standard errors of the standardized estimates. If FALSE, the delta method is used. Default is FALSE.

mc.reps

Number of Monte Carlo replications. Default is 10,000. Ignored if monte.carlo = FALSE.

...

Arguments passed on to other functions

Value

The same object (returned invisibly) with three slots overwritten

$parTable

Parameter table whose columns est and std.error now hold standardized estimates and their (delta-method) standard errors, as produced by standardized_estimates().

$coefs

Named numeric vector of standardized coefficients. Intercepts (operator ~1) are removed, because a standardized variable has mean 0 by definition.

$vcov

Variance–covariance matrix corresponding to the updated coefficient vector. Rows/columns for intercepts are dropped, and the sub-matrix associated with rescaled parameters is adjusted so that its diagonal equals the squared standardized standard errors.

The object keeps its class attributes, allowing seamless use by downstream S3 methods such as summary(), coef(), or vcov().

Because the function merely transforms existing estimates, parameter constraints imposed through shared labels remain satisfied.

See also

standardized_estimates()

Obtains the fully standardized parameter table used here.

modsem()

Fit model using LMS or QML approaches.

modsem_da()

Fit model using LMS or QML approaches.

Examples

# \dontrun{
# Latent interaction estimated with LMS and standardized afterwards
syntax <- "
  X =~ x1 + x2 + x3
  Y =~ y1 + y2 + y3
  Z =~ z1 + z2 + z3
  Y ~ X + Z + X:Z
"
fit  <- modsem_da(syntax, data = oneInt, method = "lms")
sfit <- standardize_model(fit, monte.carlo = TRUE)

# Compare unstandardized vs. standardized summaries
summary(fit)  # unstandardized
#> 
#> modsem (1.0.12) ended normally after 43 iterations
#> 
#>   Estimator                                        LMS
#>   Optimization method                       EMA-NLMINB
#>   Number of model parameters                        31
#>                                                       
#>   Number of observations                          2000
#>  
#> Loglikelihood and Information Criteria:
#>   Loglikelihood                              -17493.60
#>   Akaike (AIC)                                35049.20
#>   Bayesian (BIC)                              35222.83
#>  
#> Numerical Integration:
#>   Points of integration (per dim)                   24
#>   Dimensions                                         1
#>   Total points of integration                       24
#>  
#> Fit Measures for Baseline Model (H0):
#>   Loglikelihood                              -17831.87
#>   Akaike (AIC)                                35723.75
#>   Bayesian (BIC)                              35891.78
#>   Chi-square                                     17.52
#>   Degrees of Freedom (Chi-square)                   24
#>   P-value (Chi-square)                           0.826
#>   RMSEA                                          0.000
#>  
#> Comparative Fit to H0 (LRT test):
#>   Loglikelihood change                          338.27
#>   Difference test (D)                           676.55
#>   Degrees of freedom (D)                             1
#>   P-value (D)                                    0.000
#>  
#> R-Squared Interaction Model (H1):
#>   Y                                              0.599
#> R-Squared Baseline Model (H0):
#>   Y                                              0.395
#> R-Squared Change (H1 - H0):
#>   Y                                              0.204
#> 
#> Parameter Estimates:
#>   Coefficients                          unstandardized
#>   Information                                 observed
#>   Standard errors                             standard
#>  
#> Latent Variables:
#>                  Estimate  Std.Error  z.value  P(>|z|)
#>   X =~          
#>     x1              1.000                             
#>     x2              0.804      0.013   63.806    0.000
#>     x3              0.914      0.014   67.599    0.000
#>   Z =~          
#>     z1              1.000                             
#>     z2              0.810      0.012   65.079    0.000
#>     z3              0.881      0.013   67.610    0.000
#>   Y =~          
#>     y1              1.000                             
#>     y2              0.798      0.007  107.547    0.000
#>     y3              0.899      0.008  112.574    0.000
#> 
#> Regressions:
#>                  Estimate  Std.Error  z.value  P(>|z|)
#>   Y ~           
#>     X               0.674      0.031   21.689    0.000
#>     Z               0.570      0.030   18.739    0.000
#>     X:Z             0.718      0.028   25.829    0.000
#> 
#> Intercepts:
#>                  Estimate  Std.Error  z.value  P(>|z|)
#>    .x1              1.023      0.024   42.812    0.000
#>    .x2              1.216      0.020   60.879    0.000
#>    .x3              0.920      0.022   41.405    0.000
#>    .z1              1.012      0.024   41.586    0.000
#>    .z2              1.206      0.020   59.281    0.000
#>    .z3              0.916      0.022   42.072    0.000
#>    .y1              1.037      0.033   31.391    0.000
#>    .y2              1.220      0.027   45.413    0.000
#>    .y3              0.954      0.030   31.800    0.000
#> 
#> Covariances:
#>                  Estimate  Std.Error  z.value  P(>|z|)
#>   X ~~          
#>     Z               0.200      0.024    8.241    0.000
#> 
#> Variances:
#>                  Estimate  Std.Error  z.value  P(>|z|)
#>    .x1              0.158      0.009   18.169    0.000
#>    .x2              0.162      0.007   23.156    0.000
#>    .x3              0.165      0.008   20.755    0.000
#>    .z1              0.167      0.009   18.505    0.000
#>    .z2              0.160      0.007   22.680    0.000
#>    .z3              0.158      0.008   20.777    0.000
#>    .y1              0.160      0.009   18.010    0.000
#>    .y2              0.154      0.007   22.684    0.000
#>    .y3              0.164      0.008   20.681    0.000
#>     X               0.981      0.036   26.966    0.000
#>     Z               1.017      0.038   26.930    0.000
#>    .Y               0.980      0.038   25.934    0.000
#> 
summary(sfit) # standardized
#> Warning: NaNs produced
#> 
#> modsem (1.0.12) ended normally after 43 iterations
#> 
#>   Estimator                                        LMS
#>   Optimization method                       EMA-NLMINB
#>   Number of model parameters                        20
#>                                                       
#>   Number of observations                          2000
#>  
#> Loglikelihood and Information Criteria:
#>   Loglikelihood                              -17493.60
#>   Akaike (AIC)                                35027.20
#>   Bayesian (BIC)                              35139.22
#>  
#> Numerical Integration:
#>   Points of integration (per dim)                   24
#>   Dimensions                                         1
#>   Total points of integration                       24
#>  
#> Fit Measures for Baseline Model (H0):
#>   Loglikelihood                              -17831.87
#>   Akaike (AIC)                                35723.75
#>   Bayesian (BIC)                              35891.78
#>   Chi-square                                     17.52
#>   Degrees of Freedom (Chi-square)                   24
#>   P-value (Chi-square)                           0.826
#>   RMSEA                                          0.000
#>  
#> Comparative Fit to H0 (LRT test):
#>   Loglikelihood change                          338.27
#>   Difference test (D)                           676.55
#>   Degrees of freedom (D)                           -10
#>   P-value (D)                                      NaN
#>  
#> R-Squared Interaction Model (H1):
#>   Y                                              0.599
#> R-Squared Baseline Model (H0):
#>   Y                                              0.395
#> R-Squared Change (H1 - H0):
#>   Y                                              0.204
#> 
#> Parameter Estimates:
#>   Coefficients                            standardized
#>   Information                                 observed
#>   Standard errors                             standard
#>  
#> Latent Variables:
#>                  Estimate  Std.Error  z.value  P(>|z|)
#>   X =~          
#>     x1              0.928      0.005  203.376    0.000
#>     x2              0.892      0.006  156.386    0.000
#>     x3              0.913      0.005  181.009    0.000
#>   Z =~          
#>     z1              0.927      0.005  200.268    0.000
#>     z2              0.898      0.006  162.739    0.000
#>     z3              0.913      0.005  183.029    0.000
#>   Y =~          
#>     y1              0.969      0.002  482.428    0.000
#>     y2              0.954      0.003  373.157    0.000
#>     y3              0.961      0.002  423.102    0.000
#> 
#> Regressions:
#>                  Estimate  Std.Error  z.value  P(>|z|)
#>   Y ~           
#>     X               0.427      0.017   24.536    0.000
#>     Z               0.368      0.018   20.494    0.000
#>     X:Z             0.459      0.017   27.019    0.000
#> 
#> Covariances:
#>                  Estimate  Std.Error  z.value  P(>|z|)
#>   X ~~          
#>     Z               0.200      0.023    8.882    0.000
#> 
#> Variances:
#>                  Estimate  Std.Error  z.value  P(>|z|)
#>    .x1              0.139      0.008   16.395    0.000
#>    .x2              0.204      0.010   20.016    0.000
#>    .x3              0.167      0.009   18.173    0.000
#>    .z1              0.141      0.009   16.416    0.000
#>    .z2              0.193      0.010   19.450    0.000
#>    .z3              0.167      0.009   18.333    0.000
#>    .y1              0.061      0.004   15.755    0.000
#>    .y2              0.090      0.005   18.494    0.000
#>    .y3              0.076      0.004   17.511    0.000
#>     X               1.000                             
#>     Z               1.000                             
#>    .Y               0.401      0.016   24.514    0.000
#> 
# }