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 in cond.var + Z %*% D %*% t(Z) : non-conformable arrays #22

Open
Sannemalee opened this issue May 27, 2022 · 4 comments
Open

Error in cond.var + Z %*% D %*% t(Z) : non-conformable arrays #22

Sannemalee opened this issue May 27, 2022 · 4 comments

Comments

@Sannemalee
Copy link

Hi @aloy,

I am trying to use lmeresampler on my multilevel model (package nlme). I downloaded the latest version of the package via remotes::install_github("aloy/lmeresampler"). However, I get error messages. When I use na.action=omit, I get:
Error in [<-.data.frame(*tmp*, , as.character(mod.fixd[[2]]), value = c(2.77420893174699, :
replacement has 4079 rows, data has 4615
When I use na.action=exclude, I get Error in cond.var + Z %% D %% t(Z) : non-conformable arrays.

This is my model:
NA_SimpleMorningNAprediction <- lme(MorningNegA ~ EveningNegA_within + day_cent, random=list(PP =pdNatural(~1 + day_cent)), data=Fulldata, na.action=na.omit, control=list(opt="optim"), method = "ML", correlation = corCAR1(form = ~ day_cent|PP))
summary(NA_SimpleMorningNAprediction)

And this is the code I use for bootstrap:
boot_SimpleMorningNAprediction<-bootstrap(NA_SimpleMorningNAprediction, .f=fixef, type="parametric", B=1000)

When I use a simpler model like these below, I get the same error messages.
NA_SimpleMorningNAprediction <- lme(MorningNegA ~ EveningNegA_within, random=~1|PP, data=Fulldata, na.action=na.exclude, method = "ML")
Error in cond.var + Z %% D %% t(Z) : non-conformable arrays

NA_SimpleMorningNAprediction <- lme(MorningNegA ~ EveningNegA_within, random=~1|PP, data=Fulldata, na.action=na.omit, method = "ML")
Error in [<-.data.frame(*tmp*, , as.character(mod.fixd[[2]]), value = c(2.77420893174699, :
replacement has 4079 rows, data has 4615

Do you know what the problem is? Is this a bug?
Unfortunately, I cannot give you the real data (due to regulations).

Best wishes,
Sanne

@aloy
Copy link
Owner

aloy commented May 27, 2022

Hi @Sannemalee ,

I definitely want to get to the bottom of this. Could you use a data set similar to the one you have to share a reproducible example? I know that you can't share your data, but I am wondering if this happens with other data sets you have seen as well.

@Sannemalee
Copy link
Author

Hi @aloy ,

I've found an ESM dataset online (here: https://osf.io/t9gzu/) that I used to test. I receive the same issue. I converted it to R.
Testdata.csv
This is the script I used now to test it.

Test <- lme(AffPos ~ Connected, random=~1|ID, data=Testdata, na.action=na.exclude, method = "ML")
summary(Test)
Test <- lme(AffPos ~ Connected, random=~1|ID, data=Testdata, na.action=na.omit, method = "ML")
summary(Test)

Hope this helps!

@Sannemalee
Copy link
Author

Dear @aloy ,

I was wondering whether you have found the time to dig into this issue.

Best wishes,
Sanne

@aloy
Copy link
Owner

aloy commented Jun 17, 2022

Hi @ Sannemalee,

This fell through the cracks a bit. I will get a fix for this up soon and ping you when it's there!

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

2 participants