parameters icon indicating copy to clipboard operation
parameters copied to clipboard

Support for psych::omega models

Open DominiqueMakowski opened this issue 4 years ago • 8 comments

It thought it would be easy and similar to model_parameters.principal, but no 😢

psych::omega(mtcars)
#> Loading required namespace: GPArotation

#> Omega 
#> Call: psych::omega(m = mtcars)
#> Alpha:                 0.88 
#> G.6:                   0.97 
#> Omega Hierarchical:    0.57 
#> Omega H asymptotic:    0.58 
#> Omega Total            0.97 
#> 
#> Schmid Leiman Factor loadings greater than  0.2 
#>           g   F1*   F2*   F3*   h2   u2   p2
#> mpg-   0.58 -0.67        0.29 0.88 0.12 0.38
#> cyl    0.70 -0.61  0.28       0.96 0.04 0.52
#> disp   0.59 -0.71             0.89 0.11 0.39
#> hp     0.77 -0.31  0.23  0.36 0.87 0.13 0.68
#> drat-  0.27 -0.79             0.71 0.29 0.10
#> wt     0.43 -0.79        0.31 0.91 0.09 0.20
#> qsec-  0.81        0.50       0.95 0.05 0.70
#> vs-    0.74 -0.27  0.38       0.77 0.23 0.71
#> am-         -0.89             0.81 0.19 0.00
#> gear         0.87        0.32 0.87 0.13 0.00
#> carb   0.68              0.63 0.87 0.13 0.53
#> 
#> With eigenvalues of:
#>    g  F1*  F2*  F3* 
#> 3.70 4.36 0.60 0.83 
#> 
#> general/max  0.85   max/min =   7.24
#> mean percent general =  0.38    with sd =  0.27 and cv of  0.71 
#> Explained Common Variance of the general factor =  0.39 
#> 
#> The degrees of freedom are 25  and the fit is  1.3 
#> The number of observations was  32  with Chi Square =  31.8  with prob <  0.16
#> The root mean square of the residuals is  0.02 
#> The df corrected root mean square of the residuals is  0.02
#> RMSEA index =  0.14  and the 10 % confidence intervals are  0 0.181
#> BIC =  -54.85
#> 
#> Compare this with the adequacy of just a general factor and no group factors
#> The degrees of freedom for just the general factor are 44  and the fit is  10.25 
#> The number of observations was  32  with Chi Square =  264.78  with prob <  2.7e-33
#> The root mean square of the residuals is  0.39 
#> The df corrected root mean square of the residuals is  0.44 
#> 
#> RMSEA index =  0.448  and the 10 % confidence intervals are  0.356 0.45
#> BIC =  112.29 
#> 
#> Measures of factor score adequacy             
#>                                                  g  F1*   F2*  F3*
#> Correlation of scores with factors            0.87 0.97  0.60 0.84
#> Multiple R square of scores with factors      0.76 0.95  0.36 0.71
#> Minimum correlation of factor score estimates 0.52 0.90 -0.28 0.42
#> 
#>  Total, General and Subset omega for each subset
#>                                                  g  F1*  F2*  F3*
#> Omega total for total scores and subscales    0.97 0.90 0.91 0.87
#> Omega general for total scores and subscales  0.57 0.31 0.69 0.60
#> Omega group for total scores and subscales    0.26 0.59 0.22 0.28

Created on 2019-10-04 by the reprex package (v0.3.0)

DominiqueMakowski avatar Oct 04 '19 11:10 DominiqueMakowski

@zen-juen is assigned to this 😈

Running model_parameters() on an omega model would return the table with the different omegas for the different dimensions (and items?). And running summary() on this output (i.e., summary(model_parameters(omega_model))) would return the table of variance (see code below). Finally, using plot() (to be added to see?) would provide the heatmap:

image

here's the code for referencce that Zen wrote for our current study (so we have to make it reusable):

om <- psych::omega(m = questions, nfactors = 4, fm = "ml", title = "Omega of LIE Scale", plot = "FALSE", n.obs = nrow(questions), flip=FALSE)

# Table of omega coefficients
table_om <- om$omega.group
colnames(table_om) <- c("Omega (total)", "Omega (hierarchical)", "Omega (group)")
table_om


# Table of variance accounted for
table_variance <- om$omega.group %>%
  mutate(Composite = c("G", "F1", "F2", "F3", "F4")) %>%
  mutate(Total = total*100,
         General = (general/total)*100,
         Group = (group/total)*100) %>%
  select(Composite, Total, General, Group)
colnames(table_variance) <- c("Composite", "Total Variance (%)", "Variance due to General Factor (%)", "Variance due to Group Factor (%)")
table_variance 


# Plot
cor.plot(om)

DominiqueMakowski avatar Jan 09 '20 09:01 DominiqueMakowski

We could think of that:

  1. model_parameters.omega() runs on psych::omega() models (the output of e.g. psych::omega(mtcars))
  2. this returns an object of class parameters_omega and we can then have a summary.parameters_omega() method for it
  3. we could also add a function that computes the reliability indices related to omega models, maybe in performance, that would run on efa, pca and omega models. For instance, called structure_reliabilitty() or something like that (@strengejacke this is a bit problematic as it's not only about items but rather about dimensions, so not sure if it fits under item_reliabiltiy())

@zen-juen we can start by focusing on (1)

DominiqueMakowski avatar Jan 13 '20 02:01 DominiqueMakowski

any news on this?

strengejacke avatar Apr 03 '20 14:04 strengejacke

still haven't had time to look back into it 😕

DominiqueMakowski avatar Apr 03 '20 14:04 DominiqueMakowski

bump

strengejacke avatar Nov 14 '20 15:11 strengejacke

bump 😁

strengejacke avatar Apr 02 '22 22:04 strengejacke

DominiqueMakowski avatar Apr 03 '22 00:04 DominiqueMakowski

(I don't have currently any bandwith for that 😢 but one day it will happen 🤞)

DominiqueMakowski avatar Apr 03 '22 00:04 DominiqueMakowski