Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for psych::omega models #136

Open
DominiqueMakowski opened this issue Oct 4, 2019 · 8 comments
Open

Support for psych::omega models #136

DominiqueMakowski opened this issue Oct 4, 2019 · 8 comments
Assignees
Labels
Feature idea 🔥 New feature or request

Comments

@DominiqueMakowski
Copy link
Member

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)

@strengejacke strengejacke added the Feature idea 🔥 New feature or request label Dec 5, 2019
@DominiqueMakowski
Copy link
Member Author

@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
Copy link
Member Author

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)

@strengejacke
Copy link
Member

any news on this?

@DominiqueMakowski
Copy link
Member Author

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

@strengejacke
Copy link
Member

bump

@strengejacke
Copy link
Member

bump 😁

@DominiqueMakowski
Copy link
Member Author

@DominiqueMakowski
Copy link
Member Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature idea 🔥 New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants