简体   繁体   中英

error with psych package fa.parallel() call

I get the following error with the script:

fa.parallel(eser[,-1], fa="pc", n.iter=10,
             show.legend=FALSE, main="Example Scree plot with parallel analysis")

Error in fa.parallel(eser[, -1], fa = "pc", n.iter = 10, show.legend =
FALSE,  :  object 'fa.values.sim' not found

What kind of object is fa.values.sim ? The scree plot, however, comes out correctly. Do you have an idea to help me fixing the error? I use Rstudio v0.97.310 under R v2.15.3

Thanks a lot for any help you might provide.


The eser data frame is the following:

Participant Price Software Aesthetics Brand
1           P1     6        5          3     4
2           P2     7        3          2     2
3           P3     6        4          4     5
4           P4     5        7          1     3
5           P5     7        7          5     5
6           P6     6        4          2     3
7           P7     5        7          2     1
8           P8     6        5          4     4
9           P9     3        5          6     7
10         P10     1        3          7     5
11         P11     2        6          6     7
12         P12     5        7          7     6
13         P13     2        4          5     6
14         P14     3        5          6     5
15         P15     1        6          5     5
16         P16     2        3          7     7
17         P17     3        3          5     6

I have fixed this bug in the next release of psych package (1.3.6).

A request to all users of the psych package. If you find a bug, let me know. This is the best way to get them fixed.

Bill

I think this is a mistake in the function. You can read its source code by typing its name into the command line in R. Then you can search for all the occurences of fa.values.sim . Every one of these is inside an if (fa != "pc") statement. So when the function tries to assign results , it can't because fa.values.sim is indeed not defined if fa == "pc" . But this error happens after the plot statement, so your plot is not affected.

To sum up, there is a bug in the code for fa.parallel . If all you care about is the plot, you are indeed fine. You can ignore the error message.

If you really want the error message to disappear, change your command to:

fa.parallel(eser[,-1], fa="foo", n.iter=10,
             show.legend=FALSE, main="Example Scree plot with parallel analysis")

This works because of the way the function happens to be written.

library(psych)
fa.parallel(USJudgeRatings[,-1], fa="PC", n.iter=100,
show.legend=FALSE, main="Scree plot with parallel analysis")

The above hung R for unknown reasons. Is there a bug? Thank you

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