简体   繁体   中英

R: fa.parallel of psych package, global set to false

I have a problem when invoking fa.parallel() function from the psych package in R.

Due to space only the head of the dataset is shown, but i hope you get an Idea of my problem.

Given the following example dataset:

  SQ100 SQ101 SQ102 SQ103 SQ104 SQ105 SQ106 SQ107 SQ108 SQ109 SQ110 SQ111 SQ112
1     1     2     3     2     1     1     2     2    NA    NA    NA     1     1
2     3     2     2     2     1     1     3     2     3     1     3     1     1
3     1     1     1     1     1     1     1     1     1     1     5     1     1
4    NA     1    NA     1     1     1     2     1    NA    NA    NA     1     1
5     1     5     4     2     3     2     3     2     1    NA    NA     2     2
6    NA    NA    NA    NA    NA     2     1     1     1    NA    NA     1     1

I have the categories from 1-5 and NA for missing Values.

If I execute

fa.parallel.poly(dataset,global=TRUE)

The console output says:

The items do not have an equal number of response alternatives, global set to FALSE

As you can see in the Table above, there are Variables like "SQ112", which only have the values 1 and 2 or "SQ109" has 1 and NA as responses.

However that is just the observed data and response alternatives from 1-5 or NA are possible on all Variables, but are simply not observed in that case.

So I want global set to TRUE, but everytime I invoke the function it sets global to false, even if I specifiy it True in the function parameter.

What the message is indicating is that in your observed data, not all items have the same number of categories. The parallel analysis should work anyway. As of psych 1.5.1, fa.parallel now has an option to do polychoric correlations directly and so you do not need the fa.parallel.poly call. Just say fa.parallel(dataset,cor="poly"). (It will still complain about the data not having an equal number of response alternatives.)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM