Closed ediachek closed 4 years ago
I think that might be a bug in extend
.
Does changing participant_id
from a factor to a character (or numeric) vector fix this?
Hi,
I changed participant_id to a numeric vector and this is what I am getting:
I’m not sure why it’s only showing me 20 participants (I have 102 in my data). I’m new to R, so it’s quite possible that there’s an error in my code. Here are the commands that I’m using:
data$participant_id <- as.numeric(data$participant_id) m_ext_subj <- extend(m, along="participant_id", n=20) c.memory <- powerCurve(m_ext_subj, along = "participant_id", test=fixed("memory"), nsim=2)
I’d appreciate any help!
It's better to comment on github rather than reply to the notification emails. Looks like it scrubbed an attachment?
Just updated the comment!
The argument n=20
"extends" the dataset to 20 participants (extend is a bit of a misnomer in this case). I'm not sure why you'd want to extend when your power is already high, but if you do e.g. n=122
will add 20 participants (you might need to check with getData
afterwards though, extend
is fairly simpe and can unbalance your data).
Have a look at c.memory$warnings
and c.memory$errors
to see if any problems were logged during the simulations.
Note that if you have a large number of observations per participant you might still have high power with fewer participants.
I'm trying to replicate the experiment and I'd like to see what the sample size should be to get the same effect size for multiple fixed effects.
Yes, it looks like I have high power even with as few as 30 people.
Ok, I have managed to resolve the issue by: i) changing "participant_id" from a factor to numeric; ii) testing the fixed effect that is smaller than the original one; iii) increasing the number of simulations. Attaching the power curve for 100 simulations.
Thank you for your help!
Hi,
I am testing complex fixed effects on the data that has already been collected. Here is the model:
_m <- glmer(response.numeric ~ 1+ memory + disfluency + planning.hypothesis + pauses.ums + (1|participantid) + (1|item), data=data,family=binomial)
Now, I'd like to do a replication study and I want to figure out the sample size. I am using the powerCurve function. The code is below:
_c.memory <- powerCurve(m, along = "participantid", test=fixed("memory"), nsim=100)
Unfortunately, what I get is the following:
I have been trying to extend my data but I get the following error:
_> m_ext_subj <- extend(m, along="participantid", n=20) Error in
levels<-.factor
(*tmp*
, value = values) : number of levels differsI'd appreciate any suggestions on how to fix this!