pitakakariki / simr

Power Analysis of Generalised Linear Mixed Models by Simulation
68 stars 19 forks source link

Mismatch between 'theta' parameter vector names and internal names #235

Open ZKorda opened 2 years ago

ZKorda commented 2 years ago

Hi,

I am encountering an error when I am trying to run powerSim. There is no misssing data in my model.

My model: model2 <- lmer(y~ task*workload*bin*lum+timeTask + (task*workload|participant)+ (1|trial), data=data)

powerSim: sim_treat <- powerSim(model2, nsim=2, test=fixed("task:workload:bin:lum+timeTask", "z"))

I also tried specifing it differently (e.g., see below) but I always get the same results: sim_treat <- powerSim(model2, nsim=2, test=fixed("taskvs:workloadeasy:bin500-1000:lumchange+timeTask", "z"))

sim_treat 
Power for predictor 'task:workload:bin:lum+timeTask', (95% confidence interval):
       0.00% ( 0.00, 84.19)

Test: z-test

Based on 2 simulations, (0 warnings, 2 errors)
alpha = 0.05, nrow = NA

Time elapsed: 0 h 0 m 5 s
lastResult()$errors
 stage index
1 Simulating     1
2 Simulating     2
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   message
1 mismatch between 'theta' parameter vector names and internal names (trial.(Intercept),participant.(Intercept),participant.taskvs.(Intercept),participant.workloadhard.(Intercept),participant.workloadsingle.(Intercept),participant.taskvs:workloadhard.(Intercept),participant.taskvs:workloadsingle.(Intercept),participant.taskvs,participant.workloadhard.taskvs,participant.workloadsingle.taskvs,participant.taskvs:workloadhard.taskvs,participant.taskvs:workloadsingle.taskvs,participant.workloadhard,participant.workloadsingle.workloadhard,participant.taskvs:workloadhard.workloadhard,participant.taskvs:workloadsingle.workloadhard,participant.workloadsingle,participant.taskvs:workloadhard.workloadsingle,participant.taskvs:workloadsingle.workloadsingle,participant.taskvs:workloadhard,participant.taskvs:workloadsingle.taskvs:workloadhard,participant.taskvs:workloadsingle)

I am not sure what this message means and I could not find any answers here. I see it uses intercept, trial and participant, which does not make any sense to me since this is a part of the random structure, not fixed effects.

Any ideas what can I do?

pitakakariki commented 2 years ago

Thanks for reporting this error. It might be a couple of days before I can get to it.

Would it be possible for you to send me the data you're using so I can replicate this? You can use the maintainer email address here: https://cran.r-project.org/web/packages/simr/index.html

pitakakariki commented 2 years ago

Needed to close this: