pitakakariki / simr

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

strange powerSim error #170

Open gailmargolis76 opened 4 years ago

gailmargolis76 commented 4 years ago

so i'm using lme to fit my model, like so:

fit <- lme(frailty_index ~ age, random = ~age | id, = moddat, method = 'ML')

But when i run powerSim, like so:

power <- powerSim(fit, nsim = 5, test = fixed("age"))

I get 0% power and the following cryptic output from lastResult()$errors:

stage index message 1 Fitting 1 replacement has 2 rows, data has 55899 2 Fitting 2 replacement has 2 rows, data has 55899 3 Fitting 3 replacement has 2 rows, data has 55899 4 Fitting 4 replacement has 2 rows, data has 55899 5 Fitting 5 replacement has 2 rows, data has 55899

Hard to debug when it's not clear what this means

pitakakariki commented 4 years ago

simr isn't designed to work with nlme.

captify-gbello commented 4 years ago

Thanks for the heads up, I will try with lmer or glmer