summarize the results of a multi group model created with mxsem_group_by
Examples
# THE FOLLOWING EXAMPLE IS ADAPTED FROM
# https://openmx.ssri.psu.edu/docs/OpenMx/latest/_static/Rdoc/mxModel.html
library(mxsem)
model <- 'spatial =~ visual + cubes + paper
verbal =~ general + paragrap + sentence
math =~ numeric + series + arithmet'
mg_model <- mxsem(model = model,
data = OpenMx::HS.ability.data) |>
# we want separate models for all combinations of grades and schools:
mxsem_group_by(grouping_variables = "school") |>
mxTryHard()
#> Warning: This function is very experimental and may not yet work properly. Use with caution.
#> The following parameters will be the same across groups:
#> The following parameters will be group specific: spatial→cubes, spatial→paper, verbal→paragrap, verbal→sentence, math→series, math→arithmet, visual↔visual, cubes↔cubes, paper↔paper, general↔general, paragrap↔paragrap, sentence↔sentence, numeric↔numeric, series↔series, arithmet↔arithmet, spatial↔spatial, spatial↔verbal, verbal↔verbal, spatial↔math, verbal↔math, math↔math, one→visual, one→cubes, one→paper, one→general, one→paragrap, one→sentence, one→numeric, one→series, one→arithmet
#> Running untitled42 with 60 parameters
#>
#> Beginning initial fit attempt
#> Running untitled42 with 60 parameters
#>
#> Lowest minimum so far: 15915.8767169525
#> Not all eigenvalues of the Hessian are positive: 3213484187.52617, 38024.6042732865, 12689.9573264105, 5730.94837456077, 4937.62470556635, 1953.66903064577, 1890.5373601436, 1141.98745676491, 787.058171585175, 354.297843637968, 310.095509667495, 140.273619058819, 71.9595946638189, 69.7734805818321, 46.2902097160743, 44.997434886997, 42.0029790773461, 24.9088679733441, 23.5209833116692, 22.8590744854324, 20.9226016706779, 18.3026805099979, 16.0852795564987, 16.0208733821851, 15.3106438967275, 9.90809693843778, 8.45359590986983, 5.89154693280105, 5.53494988510465, 4.35907398971035, 4.18484036948047, 3.490775517344, 3.1679804510075, 2.82688715009517, 1.5990018725994, 1.5149590578571, 1.43959661269952, 1.15828394552272, 1.0547057870351, 0.740147892170961, 0.518715751074977, 0.502846713252522, 0.49234870495974, 0.411397339792435, 0.328015262140072, 0.240788228449937, 0.184255124322826, 0.150702541831436, 0.0854468657890009, 0.0836747545807092, 0.041468023841972, 0.0385716855430323, 0.0370223555134969, 0.0339803278877858, 0.0295582367040106, 0.0211168689838238, 0.00785135595685313, 0.00757281285997932, 0.00240851973486545, -1.81305267142488e-06
#>
#> Beginning fit attempt 1 of at maximum 10 extra tries
#> Running untitled42 with 60 parameters
#> Not all eigenvalues of the Hessian are positive: 3213484187.52617, 38024.6042732865, 12689.9573264105, 5730.94837456077, 4937.62470556635, 1953.66903064577, 1890.5373601436, 1141.98745676491, 787.058171585175, 354.297843637968, 310.095509667495, 140.273619058819, 71.9595946638189, 69.7734805818321, 46.2902097160743, 44.997434886997, 42.0029790773461, 24.9088679733441, 23.5209833116692, 22.8590744854324, 20.9226016706779, 18.3026805099979, 16.0852795564987, 16.0208733821851, 15.3106438967275, 9.90809693843778, 8.45359590986983, 5.89154693280105, 5.53494988510465, 4.35907398971035, 4.18484036948047, 3.490775517344, 3.1679804510075, 2.82688715009517, 1.5990018725994, 1.5149590578571, 1.43959661269952, 1.15828394552272, 1.0547057870351, 0.740147892170961, 0.518715751074977, 0.502846713252522, 0.49234870495974, 0.411397339792435, 0.328015262140072, 0.240788228449937, 0.184255124322826, 0.150702541831436, 0.0854468657890009, 0.0836747545807092, 0.041468023841972, 0.0385716855430323, 0.0370223555134969, 0.0339803278877858, 0.0295582367040106, 0.0211168689838238, 0.00785135595685313, 0.00757281285997932, 0.00240851973486545, -1.81305267142488e-06
#>
#> Beginning fit attempt 2 of at maximum 10 extra tries
#> Running untitled42 with 60 parameters
#>
#> Fit attempt worse than current best: 15967.2831980055 vs 15915.8767169525
#>
#> Beginning fit attempt 3 of at maximum 10 extra tries
#> Running untitled42 with 60 parameters
#>
#> Lowest minimum so far: 15915.8750853245
#> OpenMx status code 6 not in list of acceptable status codes, (0,0)
#>
#> Beginning fit attempt 4 of at maximum 10 extra tries
#> Running untitled42 with 60 parameters
#>
#> Lowest minimum so far: 15915.8750673873
#> OpenMx status code 6 not in list of acceptable status codes, (0,0)
#>
#> Beginning fit attempt 5 of at maximum 10 extra tries
#> Running untitled42 with 60 parameters
#>
#> Lowest minimum so far: 15915.8750671349
#> OpenMx status code 6 not in list of acceptable status codes, (0,0)
#>
#> Beginning fit attempt 6 of at maximum 10 extra tries
#> Running untitled42 with 60 parameters
#>
#> Fit attempt worse than current best: 16059.0304100892 vs 15915.8750671349
#>
#> Beginning fit attempt 7 of at maximum 10 extra tries
#> Running untitled42 with 60 parameters
#>
#> Fit attempt generated errors
#>
#> Beginning fit attempt 8 of at maximum 10 extra tries
#> Running untitled42 with 60 parameters
#>
#> Fit attempt generated errors
#>
#> Beginning fit attempt 9 of at maximum 10 extra tries
#> Running untitled42 with 60 parameters
#>
#> Fit attempt worse than current best: 15915.8881179825 vs 15915.8750671349
#>
#> Beginning fit attempt 10 of at maximum 10 extra tries
#> Running untitled42 with 60 parameters
#>
#> Fit attempt worse than current best: 16238.1934523837 vs 15915.8750671349
#>
#> Retry limit reached
#>
#>
#> Retry limit reached; Best fit=15915.875 (started at 11279122) (11 attempt(s): 9 valid, 2 errors)
#>
#> Uncertain solution found - consider parameter validity, try again, increase extraTries, change inits, change model, or check data!
#> Start values from best fit:
#> 0.429709945273199,0.286021701260794,0.31225673218928,0.442362963784498,2.27678182600356,0.956871899019149,23.8899840365454,15.2656468605984,5.97885315869133,55.1556583772903,3.53185512865124,5.84636072135132,14.0511203894793,39.6671496278968,13.6965262398739,23.5805545394239,25.1605112124131,79.8221925701932,12.1069294147164,18.9620434237828,9.13390105785465,29.5793556596205,24.8000255300579,14.3034791921614,44.8487120278314,9.95187387720649,18.8485164649265,14.4552479331535,18.7518809343646,25.8276823418522,0.318283833650721,0.222292791361689,0.302346298335569,0.479237032446563,-478.297215168249,-137.814901695725,17.4489856944854,20.7390595647791,6.42451611962401,48.0328734595165,3.66229806258974,6.68710651335202,19.4742367221004,12.4228073062705,13.7529781180879,32.8258957615205,25.3719556751718,89.9138323186705,-0.0658586012714021,-0.0830255726363468,0.000285721114832107,29.6474972956668,23.935948261696,14.1602916886227,36.6985370210847,8.46793187508731,15.9807469004286,13.8910369000318,17.5449126235407,22.7692870222378
# let's summarize the results:
summarize_multi_group_model(mg_model)
#>
#>
#> --------------------------------------------------------------------------------
#> Common Parameters:
#> [1] name matrix row col Estimate Std.Error lbound
#> [8] ubound lboundMet uboundMet
#> <0 rows> (or 0-length row.names)
#> --------------------------------------------------------------------------------
#> group_1:
#> # A tibble: 1 × 1
#> school
#> <fct>
#> 1 Grant-White
#>
#> name matrix row col Estimate
#> 1 spatial→cubes_group_1 untitled42_group_1.A cubes spatial 0.4297099
#> 2 spatial→paper_group_1 untitled42_group_1.A paper spatial 0.2860217
#> 3 verbal→paragrap_group_1 untitled42_group_1.A paragrap verbal 0.3122567
#> 4 verbal→sentence_group_1 untitled42_group_1.A sentence verbal 0.4423630
#> 5 math→series_group_1 untitled42_group_1.A series math 2.2767818
#> 6 math→arithmet_group_1 untitled42_group_1.A arithmet math 0.9568719
#> 7 visual↔visual_group_1 untitled42_group_1.S visual visual 23.8899840
#> 8 cubes↔cubes_group_1 untitled42_group_1.S cubes cubes 15.2656469
#> 9 paper↔paper_group_1 untitled42_group_1.S paper paper 5.9788532
#> 10 general↔general_group_1 untitled42_group_1.S general general 55.1556584
#> 11 paragrap↔paragrap_group_1 untitled42_group_1.S paragrap paragrap 3.5318551
#> 12 sentence↔sentence_group_1 untitled42_group_1.S sentence sentence 5.8463607
#> 13 numeric↔numeric_group_1 untitled42_group_1.S numeric numeric 14.0511204
#> 14 series↔series_group_1 untitled42_group_1.S series series 39.6671496
#> 15 arithmet↔arithmet_group_1 untitled42_group_1.S arithmet arithmet 13.6965262
#> 16 spatial↔spatial_group_1 untitled42_group_1.S spatial spatial 23.5805545
#> 17 spatial↔verbal_group_1 untitled42_group_1.S spatial verbal 25.1605112
#> 18 verbal↔verbal_group_1 untitled42_group_1.S verbal verbal 79.8221926
#> 19 spatial↔math_group_1 untitled42_group_1.S spatial math 12.1069294
#> 20 verbal↔math_group_1 untitled42_group_1.S verbal math 18.9620434
#> 21 math↔math_group_1 untitled42_group_1.S math math 9.1339011
#> 22 one→visual_group_1 untitled42_group_1.M 1 visual 29.5793557
#> 23 one→cubes_group_1 untitled42_group_1.M 1 cubes 24.8000255
#> 24 one→paper_group_1 untitled42_group_1.M 1 paper 14.3034792
#> 25 one→general_group_1 untitled42_group_1.M 1 general 44.8487120
#> 26 one→paragrap_group_1 untitled42_group_1.M 1 paragrap 9.9518739
#> 27 one→sentence_group_1 untitled42_group_1.M 1 sentence 18.8485165
#> 28 one→numeric_group_1 untitled42_group_1.M 1 numeric 14.4552479
#> 29 one→series_group_1 untitled42_group_1.M 1 series 18.7518809
#> 30 one→arithmet_group_1 untitled42_group_1.M 1 arithmet 25.8276823
#> Std.Error lbound ubound lboundMet uboundMet
#> 1 24.9052425 NA NA FALSE FALSE
#> 2 39.6618949 NA NA FALSE FALSE
#> 3 93.4259716 NA NA FALSE FALSE
#> 4 70.1654166 NA NA FALSE FALSE
#> 5 9.3349759 NA NA FALSE FALSE
#> 6 16.7208103 NA NA FALSE FALSE
#> 7 0.5213053 1e-06 NA FALSE FALSE
#> 8 1.0290573 1e-06 NA FALSE FALSE
#> 9 2.5980483 1e-06 NA FALSE FALSE
#> 10 0.2523246 1e-06 NA FALSE FALSE
#> 11 3.4804230 1e-06 NA FALSE FALSE
#> 12 1.9306882 1e-06 NA FALSE FALSE
#> 13 1.0517572 1e-06 NA FALSE FALSE
#> 14 0.3250260 1e-06 NA FALSE FALSE
#> 15 1.0887962 1e-06 NA FALSE FALSE
#> 16 0.6516164 1e-06 NA FALSE FALSE
#> 17 0.6049767 NA NA FALSE FALSE
#> 18 0.2724769 1e-06 NA FALSE FALSE
#> 19 1.8692944 NA NA FALSE FALSE
#> 20 1.2120549 NA NA FALSE FALSE
#> 21 2.2903892 1e-06 NA FALSE FALSE
#> 22 4.2133481 NA NA FALSE FALSE
#> 23 5.9196952 NA NA FALSE FALSE
#> 24 9.4066585 NA NA FALSE FALSE
#> 25 2.9317077 NA NA FALSE FALSE
#> 26 10.8878224 NA NA FALSE FALSE
#> 27 8.1088405 NA NA FALSE FALSE
#> 28 5.9847621 NA NA FALSE FALSE
#> 29 3.3271405 NA NA FALSE FALSE
#> 30 6.0897013 NA NA FALSE FALSE
#> --------------------------------------------------------------------------------
#> group_2:
#> # A tibble: 1 × 1
#> school
#> <fct>
#> 1 Pasteur
#>
#> name matrix row col
#> 31 spatial→cubes_group_2 untitled42_group_2.A cubes spatial
#> 32 spatial→paper_group_2 untitled42_group_2.A paper spatial
#> 33 verbal→paragrap_group_2 untitled42_group_2.A paragrap verbal
#> 34 verbal→sentence_group_2 untitled42_group_2.A sentence verbal
#> 35 math→series_group_2 untitled42_group_2.A series math
#> 36 math→arithmet_group_2 untitled42_group_2.A arithmet math
#> 37 visual↔visual_group_2 untitled42_group_2.S visual visual
#> 38 cubes↔cubes_group_2 untitled42_group_2.S cubes cubes
#> 39 paper↔paper_group_2 untitled42_group_2.S paper paper
#> 40 general↔general_group_2 untitled42_group_2.S general general
#> 41 paragrap↔paragrap_group_2 untitled42_group_2.S paragrap paragrap
#> 42 sentence↔sentence_group_2 untitled42_group_2.S sentence sentence
#> 43 numeric↔numeric_group_2 untitled42_group_2.S numeric numeric
#> 44 series↔series_group_2 untitled42_group_2.S series series
#> 45 arithmet↔arithmet_group_2 untitled42_group_2.S arithmet arithmet
#> 46 spatial↔spatial_group_2 untitled42_group_2.S spatial spatial
#> 47 spatial↔verbal_group_2 untitled42_group_2.S spatial verbal
#> 48 verbal↔verbal_group_2 untitled42_group_2.S verbal verbal
#> 49 spatial↔math_group_2 untitled42_group_2.S spatial math
#> 50 verbal↔math_group_2 untitled42_group_2.S verbal math
#> 51 math↔math_group_2 untitled42_group_2.S math math
#> 52 one→visual_group_2 untitled42_group_2.M 1 visual
#> 53 one→cubes_group_2 untitled42_group_2.M 1 cubes
#> 54 one→paper_group_2 untitled42_group_2.M 1 paper
#> 55 one→general_group_2 untitled42_group_2.M 1 general
#> 56 one→paragrap_group_2 untitled42_group_2.M 1 paragrap
#> 57 one→sentence_group_2 untitled42_group_2.M 1 sentence
#> 58 one→numeric_group_2 untitled42_group_2.M 1 numeric
#> 59 one→series_group_2 untitled42_group_2.M 1 series
#> 60 one→arithmet_group_2 untitled42_group_2.M 1 arithmet
#> Estimate Std.Error lbound ubound lboundMet uboundMet
#> 31 3.182838e-01 2.686781e+01 NA NA FALSE FALSE
#> 32 2.222928e-01 4.789170e+01 NA NA FALSE FALSE
#> 33 3.023463e-01 1.021755e+02 NA NA FALSE FALSE
#> 34 4.792370e-01 7.129780e+01 NA NA FALSE FALSE
#> 35 -4.782972e+02 7.017784e-02 NA NA FALSE FALSE
#> 36 -1.378149e+02 1.033567e-01 NA NA FALSE FALSE
#> 37 1.744899e+01 5.396173e-01 1e-06 NA FALSE FALSE
#> 38 2.073906e+01 8.177771e-01 1e-06 NA FALSE FALSE
#> 39 6.424516e+00 2.576895e+00 1e-06 NA FALSE FALSE
#> 40 4.803287e+01 2.872132e-01 1e-06 NA FALSE FALSE
#> 41 3.662298e+00 3.556405e+00 1e-06 NA FALSE FALSE
#> 42 6.687107e+00 1.686935e+00 1e-06 NA FALSE FALSE
#> 43 1.947424e+01 9.069046e-01 1e-06 NA FALSE FALSE
#> 44 1.242281e+01 4.051890e-01 1e-06 NA FALSE FALSE
#> 45 1.375298e+01 1.215363e+00 1e-06 NA FALSE FALSE
#> 46 3.282590e+01 5.315688e-01 1e-06 NA FALSE FALSE
#> 47 2.537196e+01 4.932973e-01 NA NA FALSE FALSE
#> 48 8.991383e+01 2.222806e-01 1e-06 NA FALSE FALSE
#> 49 -6.585860e-02 3.192828e+02 NA NA FALSE FALSE
#> 50 -8.302557e-02 1.991501e+02 NA NA FALSE FALSE
#> 51 2.857211e-04 8.076345e+04 1e-06 NA TRUE FALSE
#> 52 2.964750e+01 4.366508e+00 NA NA FALSE FALSE
#> 53 2.393595e+01 5.375023e+00 NA NA FALSE FALSE
#> 54 1.416029e+01 9.541617e+00 NA NA FALSE FALSE
#> 55 3.669854e+01 3.185237e+00 NA NA FALSE FALSE
#> 56 8.467932e+00 1.120899e+01 NA NA FALSE FALSE
#> 57 1.598075e+01 7.719922e+00 NA NA FALSE FALSE
#> 58 1.389104e+01 5.660592e+00 NA NA FALSE FALSE
#> 59 1.754491e+01 3.781031e+00 NA NA FALSE FALSE
#> 60 2.276929e+01 6.552685e+00 NA NA FALSE FALSE
#>
#> --------------------------------------------------------------------------------