[R] Running Omega in R

peter dalgaard pdalgd at gmail.com
Sun Jan 15 21:26:44 CET 2017


> On 15 Jan 2017, at 20:57 , Rui Barradas <ruipbarradas at sapo.pt> wrote:
> 
> Hello,
> 
> I no nothing about package psych so if you ask whether this is the wrong list you can always try
> 
> maintainer("psych")
> [1] "William Revelle <revelle at northwestern.edu>"

...although publishing a package is not the same as issuing a blank cheque for free support, so you may want to dig a little deeper first. 

I'd check the documentation for whether the data are in the right format. In particular, can "m" be a data frame? If it wants a matrix, you probably need to give it one (m=as.matrix(construct) should do it).

-pd

> 
> Hope this helps,
> 
> Rui Barradas
> 
> Em 15-01-2017 12:32, John Smith escreveu:
>> Hi,
>> 
>> I opened a question on stack overflow I’m hoping this mailing list can help with.
>> I have a dataset below (this is made up but produces the same error I am getting)
>> 
>> structure(list(Q1 = c(4, 5, 3, 5, 4, 5, 3, 5, 5, 5, 6,
>> 3, 5, 4, 6, 5, 5, 6, 7, 4, 5, 5, 3, 4, 4, 5, 4, 3, 5, 4, 5, 5,
>> 6, 6, 3, 6, 3, 4, 4, 4, 6, 5, 3, 2, 6, 6, 4, 5, 4, 3, 6, 4, 4,
>> 5, 6, 2, 4, 3, 4, 6, 4, 6, 4, 5, 5, 6, 4, 6, 5, 5, 4, 5, 6, 6,
>> 2, 5, 4, 3, 4, 4, 4, 6, 3, 3, 5, 4, 4, 4, 5, 5, 5, 3, 6, 6, 6,
>> 6, 5, 4, 3, 5), Q2 = c(7, 4, 4, 4, 4, 6, 6, 6, 7, 6, 5,
>> 6, 5, 4, 5, 6, 6, 6, 7, 5, 4, 4, 6, 6, 4, 4, 6, 2, 6, 5, 4, 6,
>> 4, 6, 6, 6, 5, 4, 4, 4, 4, 3, 3, 4, 4, 4, 4, 6, 2, 6, 6, 5, 4,
>> 6, 6, 4, 4, 7, 6, 5, 5, 5, 5, 6, 5, 5, 4, 5, 5, 5, 4, 6, 7, 5,
>> 5, 5, 6, 5, 6, 5, 6, 7, 2, 6, 5, 7, 3, 5, 5, 3, 3, 3, 7, 4, 5,
>> 6, 6, 6, 5, 7), Q3 = c(5, 4, 5, 6, 4, 4, 5, 4, 2, 6, 5,
>> 5, 5, 5, 7, 5, 5, 6, 7, 6, 3, 6, 6, 6, 5, 6, 6, 5, 5, 4, 5, 5,
>> 6, 6, 5, 6, 5, 5, 4, 4, 6, 4, 4, 4, 4, 4, 4, 5, 5, 4, 5, 5, 4,
>> 3, 5, 4, 5, 6, 6, 6, 4, 5, 5, 5, 6, 4, 5, 5, 7, 4, 5, 6, 6, 5,
>> 5, 3, 3, 5, 4, 6, 5, 5, 1, 3, 5, 3, 2, 5, 4, 6, 6, 6, 6, 4, 6,
>> 3, 6, 6, 6, 5), Q4 = c(6, 6, 4, 7, 4, 6, 7, 6, 7, 6, 6,
>> 6, 5, 7, 7, 6, 6, 5, 7, 7, 6, 6, 7, 7, 6, 6, 6, 5, 6, 7, 5, 6,
>> 7, 5, 4, 6, 4, 3, 6, 4, 6, 6, 6, 3, 5, 7, 5, 6, 4, 6, 7, 6, 7,
>> 4, 6, 3, 5, 7, 5, 4, 6, 6, 4, 6, 5, 5, 5, 5, 7, 7, 7, 6, 6, 6,
>> 5, 6, 6, 4, 5, 7, 6, 7, 3, 5, 6, 5, 6, 5, 5, 7, 7, 6, 6, 2, 7,
>> 6, 6, 7, 7, 5)), .Names = c("Q1", "Q2", "Q3",
>> "Q4"), row.names = c(NA, 100L), class = "data.frame")
>> 
>> 
>> When i run Cronbach Alpha with R i get a result
>> 
>> psych::alpha(construct,
>>          na.rm = TRUE,
>>          title = 'myscale',
>>          n.iter = 1000)
>> 
>> 
>> When i run Omega using R i get the following error message
>> 
>> "Error in fac(r = r, nfactors = nfactors, n.obs = n.obs, rotate = rotate, : I am sorry: missing values (NAs) in the correlation matrix do not allow me to continue.
>> Please drop those variables and try again. In addition: There were 50 or more warnings (use warnings() to see the first 50)"
>> 
>> psych::omega(m = construct,
>>       nfactors = 1, fm = "pa", n.iter = 1000, p = 0.05,
>>       title = "Omega", plot = FALSE, n.obs = 100)
>> 
>> 
>> Stackoverflow Link: http://stackoverflow.com/questions/41533231/running-omega-with-psych-library-in-r?noredirect=1#comment70278453_41533231
>> 
>> If I have the wrong mailing list, could you direct me to the appropriate one (I’m aware it might not be an R issue but more of a stats question)
>> 
>> 
>> 
>> Thank you for your time
>> 
>> 
>> 
>> 	[[alternative HTML version deleted]]
>> 
>> ______________________________________________
>> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>> 
> 
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

-- 
Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Office: A 4.23
Email: pd.mes at cbs.dk  Priv: PDalgd at gmail.com



More information about the R-help mailing list