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

error with loading data into umxEFA #236

Open
mariahkahwaji opened this issue Nov 18, 2023 · 4 comments
Open

error with loading data into umxEFA #236

mariahkahwaji opened this issue Nov 18, 2023 · 4 comments

Comments

@mariahkahwaji
Copy link

Hi! I am having an issue with getting this error everytime I run umxEFA:
Error in h(simpleError(msg, call)) :
error in evaluating the argument 'x' in selecting a method for function 'print': argument is not a matrix

I have tried the data as both a dataframe and a matrix. I also tried running without any specifications (i.e., just putting in the data frame, number of factors, and rotation). A portion of the output runs but it stops as soon as it gets to the factor correlation matrix output. I would like to know if I need to format the dataframe a certain way before using it or if there is some other troubleshooting I can do?

@tbates
Copy link
Owner

tbates commented Nov 23, 2023

hi @mariahkahwaji,
In the first instance can you upgrade to the newest version of umx/R just to be on a level playing field. Then post here

  1. The result of traceback() run immediately after this failed run of umxEFA along with
  2. The result from umxVersion()

@mcneale
Copy link
Collaborator

mcneale commented Nov 27, 2023

I am wondering if the raw data were provided as data, or a covariance/correlation matrix? It seems to me that the function desires raw data, not a correlation matrix, and that if a correlation matrix was entered, the sample size would seem to be the same as the number of variables, which could generate errors. Speculation here because OP didn't include their script for inspection/debugging.

@mariahkahwaji
Copy link
Author

Thank you for the feedback. This is what was produced. myVars is a dataframe of raw data.

traceback()
7: h(simpleError(msg, call))
6: .handleSimpleError(function (cond)
.Internal(C_tryCatchHelper(addr, 1L, cond)), "argument is not a matrix",
base::quote(t.default(rm)))
5: t.default(rm)
4: t(rm)
3: solve(t(rm) %% rm)
2: print(solve(t(rm) %
% rm))
1: umxEFA(x = myVars, factors = 2, scores = "Regression", minManifests = NA,
rotation = "geominQ", return = "model", report = "html",
summary = TRUE, name = "efa", digits = 2)
umxVersion()
umx version: 4.16.0
OpenMx version: 2.21.10 [GIT v2.21.10]
R version: R version 4.3.2 (2023-10-31)
Platform: x86_64-pc-linux-gnu
Default optimizer: SLSQP
NPSOL-enabled?: No
OpenMP-enabled?: Yes
You can update OpenMx with:
install.OpenMx(c("NPSOL", "travis", "CRAN", "open travis build page")

@tbates
Copy link
Owner

tbates commented Nov 29, 2023

hi,
If you email your df "myVars" to me (tim.bates@ed.ac.uk), I'll reproduce and diagnose.
Looks like the factor correlation matrix of the rotation is invalid.

Also, I've not heard or used geominQ rotation. What happens with something like oblimin instead?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants