Skip to content

[Bug]: EFA and PCA issues with ordinal and binary data #3163

@juliuspfadt

Description

@juliuspfadt

JASP Version

0.19.2

Commit ID

jasp-stats/jasp-desktop@410d926

JASP Module

Factor

What analysis are you seeing the problem on?

EFA, PCA

What OS are you seeing the problem on?

macOS Silicon

Bug Description

The following happened (from the forum https://forum.cogsci.nl/discussion/comment/30883#Comment_30883):
Trying to do an EFA with the dataset that is ordinal with three response categories (0, 1, 2) and choosing poly/tetrachoric correlations. However, some of the variables had restricted range, that is, responses were only 0 and 2. The way we do the poly/tetra correlations is to use mixedCor from the psych package which detects the scaling of the involved variables and automatically calculates the correct correlation. So for the restricted variables it assumed they were binary. Unfortunately the package also seems to assume a binary variable has to be 0/1, otherwise it fails.

Image

Expected Behaviour

not fail and treat the variables as they are scaled in JASP, so ordinal should stay ordinal even if there are only two response categories.

Steps to Reproduce

see above.

Log (if any)

No response

More Debug Information

Now, we would not want to fix the R package, but actually treat each variable as it is treated in JASP. So if the variable is ordinal, we can specify that for the psych function and not have it run its automatic detection. We need to be careful to transform the variables to numeric though.

Final Checklist

  • I have included a screenshot showcasing the issue, if possible.
  • I have included a JASP file (zipped) or data file that causes the crash/bug, if applicable.
  • I have accurately described the bug, and steps to reproduce it.

Metadata

Metadata

Assignees

Labels

Bug: MediumBugs that don't influence the basic function of the app, but it's better to fix them at some point.Module: jaspFactorOS: macOS Silicon

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions