Closed carolywang closed 4 years ago
Does the test work outside of simr?
drop1(modelWord, test="Chisq")
Seems like it works, here is the result to drop1(modelWord, ``test="Chisq"):
I'll need more information then, for example the specification of modelWord
.
Thanks for your help! Here is the model (logRTmodelWord is what I used in my original script):
logRTmodelWord <- lmer(logRT ~ 1 + targetWordFactor + (1+targetWordFactor|subject) + (1+targetWordFactor|item), data = pauseDetValidNoFillersExcluded, REML=FALSE)
I'll need the bit where you specify the contrasts too.
The contrasts:
pauseDetValidNoFillersExcluded$targetWordFactor <- factor(pauseDetValidNoFillersExcluded$targetWordFactor, c("W","WW","NW")) contrasts(pauseDetValidNoFillersExcluded$targetWordFactor)
So you're not actually manually setting the contrasts?
Not for treatment contrasts I think, as these are actually the default setting in R.
So does this mean that the error message is not directly related to contrast?
It's not something I've seen before, could have something to do with the singular fit.
I can't replicate the problem. Check that you've got the latest lme4 and simr, and if it still doesn't work you'll need to send me the dataset and script.
Hi Peter,
Thank you very much for offering to help. I have checked that I have been using the latest lme4 and simr. Attached please find my script and dataset. You can run the script directly after setting up setwd.
Apart from the powerSim function that produces the error “wrong number of contrasts matrix row”, powerCurve function does not work with my data either and the error shows that "object 'logRT' not found”.
I would sincerely appreciate your help on this.
Many thanks, Carol
On 30 Jan 2019, at 01:18, Peter Green notifications@github.com wrote:
I can't replicate the problem. Check that you've got the latest lme4 and simr, and if it still doesn't work you'll need to send me the dataset and script.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/pitakakariki/simr/issues/148#issuecomment-458773419, or mute the thread https://github.com/notifications/unsubscribe-auth/AJ6En-36EWfrYA9ovBgZFPNtJQmoBjmKks5vIPL0gaJpZM4aY9H2.
You can't attach files when replying to Github threads, you'll need to email the files to the address listed on CRAN.
Hi Peter, I just forwarded the files to your simr gmail. Thanks very much!
It will take me a while to track down the actual problem, but I think it's something to do with missing values.
In the meantime, you can probably work around this by removing incomplete rows from your data before fitting the model.
Removing missing data did solve the problem! Thanks a lot for your help!
Hi Peter,
Thanks very much for your simr package.
I have been trying the powerSim function with the following scripts:
But it gives me the following results with errors:
I checked that all of the 20 errors are "wrong number of contrast matrix rows". This is strange because the contrasts I used with the "targetWordFactor" did not cause any problem for the lmer model (modelWord). It is a 3-level default treatment contrast that looks something like this:
Could you tell me how I can fix this error please?
Many thanks!! Carol