This function is a wrapper for the as_ram and run_mx functions.

estimate_mx(x, ...)

Arguments

x

An object of class tidy_sem.

...

Additional parameters passed to the estimating function.

Value

An object of class MxModel.

Examples

df <- iris[1:4]
names(df) <- paste0("x_", 1:4)
model <- tidy_sem(df)
model <- measurement(model)
res <- estimate_mx(model)
#> Running model with 12 parameters
summary(res)
#> Summary of model 
#>  
#> free parameters:
#>            name matrix row col   Estimate  Std.Error A
#> 1  model.A[2,5]      A x_2   x -0.3496930 0.04368088  
#> 2  model.A[3,5]      A x_3   x  2.7756479 0.16951610  
#> 3  model.A[4,5]      A x_4   x  1.0270097 0.06928619  
#> 4  model.S[1,1]      S x_1 x_1  0.2352754 0.02950758  
#> 5  model.S[2,2]      S x_2 x_2  0.1341924 0.01400654  
#> 6  model.S[3,3]      S x_3 x_3 -0.3394000 0.08104076  
#> 7  model.S[4,4]      S x_4 x_4  0.1068763 0.01823579  
#> 8  model.S[5,5]      S   x   x  0.4458469 0.07469201  
#> 9  model.M[1,1]      M   1 x_1  5.8433334 0.06738560  
#> 10 model.M[1,2]      M   1 x_2  3.0573333 0.03546951  
#> 11 model.M[1,3]      M   1 x_3  3.7580003 0.14365481  
#> 12 model.M[1,4]      M   1 x_4  1.1993335 0.06202867  
#> 
#> Model Statistics: 
#>                |  Parameters  |  Degrees of Freedom  |  Fit (-2lnL units)
#>        Model:             12                    588              819.4226
#>    Saturated:             14                    586                    NA
#> Independence:              8                    592                    NA
#> Number of observations/statistics: 150/600
#> 
#> Information Criteria: 
#>       |  df Penalty  |  Parameters Penalty  |  Sample-Size Adjusted
#> AIC:      -356.5774               843.4226                 845.7000
#> BIC:     -2126.8309               879.5503                 841.5725
#> To get additional fit indices, see help(mxRefModels)
#> timestamp: 2023-10-11 12:13:14 
#> Wall clock time: 0.009603977 secs 
#> optimizer:  SLSQP 
#> OpenMx version number: 2.21.8 
#> Need help?  See help(mxSummary) 
#>