Mod <- glmer(cbind(Prop*n,n - Prop*n) ~ Condition + (1|Subject), family = binomial,
data = Data)
Model Summary:
Generalized linear mixed model fit by maximum likelihood (Laplace Approximation) ['glmerMod']
Family: binomial ( logit )
Formula: cbind(Prop * n, n - Prop * n) ~ Condition + (1 | Subject)
Data: Data
AIC BIC logLik deviance df.resid
137.7 144.0 -64.8 129.7 32
Scaled residuals:
Min 1Q Median 3Q Max
-2.14108 -0.63739 0.02805 0.61375 1.33598
Random effects:
Groups Name Variance Std.Dev.
Subject (Intercept) 0.2012 0.4486
Number of obs: 36, groups: Subject, 6
Fixed effects:
Estimate Std. Error z value Pr(>|z|)
(Intercept) 3.166e-01 2.633e-01 1.202 0.229
ConditionOROCL - TNR -3.948e-06 2.673e-01 0.000 1.000
ConditionOROCL + TNR -7.118e-02 2.667e-01 -0.267 0.790
Correlation of Fixed Effects:
(Intr) CORO-T
CnOROCL-TNR -0.508
CnOROCL+TNR -0.509 0.501
Power estimation:
powerSim(Mod, test = fixed("Condition"), nsim = 100)
Result:
Power [user defined], (95% confidence interval):================================================================================================================================|
0.00% ( 0.00, 3.62)
Test: [user defined function]
Based on 100 simulations, (0 warnings, 100 errors)
alpha = 0.05, nrow = 72
Time elapsed: 0 h 0 m 5 s
nb: result might be an observed power calculation
Warning message:
In observedPowerWarning(sim) :
This appears to be an "observed power" calculation
List of errors:
lastResult()$errors
stage index message
1 Fitting 1 invalid subscript type 'language'
2 Fitting 2 invalid subscript type 'language'
3 Fitting 3 invalid subscript type 'language'
4 Fitting 4 invalid subscript type 'language'
...
100 Fitting 100 invalid subscript type 'language'
It's probably having trouble with the calculations within cbind. Try adding a variable for Prop*n to your data frame rather than calculating it in the model formula.
I am trying to do an observed power calculation for a glmer binomial model; but, the results are 0% power with the same error on every simulation:
stage index message 1 Fitting 1 invalid subscript type 'language'
Example:
Model:
Model Summary:
Power estimation:
powerSim(Mod, test = fixed("Condition"), nsim = 100)
Result:
List of errors: