pitakakariki / simr

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

Power is either 100% or 0% #205

Open ddscott2 opened 3 years ago

ddscott2 commented 3 years ago

Hello,

My colleague and I have been running different variations of a power analysis and run into an issue where the power is either 100% or 0%.

Here is our model:

SkillTwoWay2 <- glmer(Response ~ Object*OP.c + Object*Skill + (OP.c + Object|ID) + (1|Actor), data = naomit, family=binomial(link=probit))

Model specification:

Model info:

Some attempted models and output

2YPpoweranalysis2 2YPpowercurve 2YPpoweranalysis

pitakakariki commented 3 years ago

100% power is fairly common when you have a large amount of data relative to the effect size.

0% power is usually due to errors during simulations, so looking at the error logs might help.

There seems to be something weird happening with ID, looking at the "0 rows" in the first image and the NA's in the second.

ddscott2 commented 3 years ago

Here's my output after running the "$warnings" and "$errors" commands...

> powercurve
Power for predictor 'Object', (95% confidence interval),
by number of levels in ID:
     50: 100.0% (99.63, 100.0) - 10200 rows
     75: 100.0% (99.63, 100.0) - 15200 rows
     NA: 34.30% (31.36, 37.34) - 17600 rows
     NA:  0.00% ( 0.00,  0.37) - 17600 rows

Time elapsed: 27 h 39 m 51 s
> powercurve$warnings
``` stage index message 1 Fitting 5 Model failed to converge with max|grad| = 0.00205799 (tol = 0.002, component 1) 2 Fitting 38 Model failed to converge with max|grad| = 0.00244169 (tol = 0.002, component 1) 3 Fitting 91 Model failed to converge with max|grad| = 0.00869988 (tol = 0.002, component 1) 4 Fitting 99 Model failed to converge with max|grad| = 0.00251589 (tol = 0.002, component 1) 5 Fitting 115 Model failed to converge with max|grad| = 0.00645221 (tol = 0.002, component 1) 6 Fitting 128 Model failed to converge with max|grad| = 0.00235001 (tol = 0.002, component 1) 7 Fitting 136 unable to evaluate scaled gradient 8 Fitting 136 Model failed to converge: degenerate Hessian with 1 negative eigenvalues 9 Fitting 161 Model failed to converge with max|grad| = 0.00280555 (tol = 0.002, component 1) 10 Fitting 165 Model failed to converge with max|grad| = 0.00201384 (tol = 0.002, component 1) 11 Fitting 174 Model failed to converge with max|grad| = 0.00284025 (tol = 0.002, component 1) 12 Fitting 180 Model failed to converge with max|grad| = 0.00700165 (tol = 0.002, component 1) 13 Fitting 224 Model failed to converge with max|grad| = 0.0020029 (tol = 0.002, component 1) 14 Fitting 229 Model failed to converge with max|grad| = 0.00409838 (tol = 0.002, component 1) 15 Fitting 252 Model failed to converge with max|grad| = 0.00875469 (tol = 0.002, component 1) 16 Fitting 257 Model failed to converge with max|grad| = 0.00247186 (tol = 0.002, component 1) 17 Fitting 264 Model failed to converge with max|grad| = 0.00347681 (tol = 0.002, component 1) 18 Fitting 317 Model failed to converge with max|grad| = 0.00251065 (tol = 0.002, component 1) 19 Fitting 343 Model failed to converge with max|grad| = 0.00234863 (tol = 0.002, component 1) 20 Fitting 377 Model failed to converge with max|grad| = 0.0191392 (tol = 0.002, component 1) 21 Fitting 395 Model failed to converge with max|grad| = 0.00366437 (tol = 0.002, component 1) 22 Fitting 426 Model failed to converge with max|grad| = 0.0026537 (tol = 0.002, component 1) 23 Fitting 430 Model failed to converge with max|grad| = 0.0029423 (tol = 0.002, component 1) 24 Fitting 458 Model failed to converge with max|grad| = 0.0026936 (tol = 0.002, component 1) 25 Fitting 475 Model failed to converge with max|grad| = 0.00228073 (tol = 0.002, component 1) 26 Fitting 509 Model failed to converge with max|grad| = 0.00204699 (tol = 0.002, component 1) 27 Fitting 518 Model failed to converge with max|grad| = 0.00232475 (tol = 0.002, component 1) 28 Fitting 547 Model failed to converge with max|grad| = 0.00621942 (tol = 0.002, component 1) 29 Fitting 587 Model failed to converge with max|grad| = 0.00285965 (tol = 0.002, component 1) 30 Fitting 593 Model failed to converge with max|grad| = 0.00222545 (tol = 0.002, component 1) 31 Fitting 607 Model failed to converge with max|grad| = 0.00341633 (tol = 0.002, component 1) 32 Fitting 624 Model failed to converge with max|grad| = 0.00419294 (tol = 0.002, component 1) 33 Fitting 645 Model failed to converge with max|grad| = 0.00262336 (tol = 0.002, component 1) 34 Fitting 661 Model failed to converge with max|grad| = 0.00419406 (tol = 0.002, component 1) 35 Fitting 678 Model failed to converge with max|grad| = 0.00261629 (tol = 0.002, component 1) 36 Fitting 716 Model failed to converge with max|grad| = 0.00604536 (tol = 0.002, component 1) 37 Fitting 729 Model failed to converge with max|grad| = 0.00612607 (tol = 0.002, component 1) 38 Fitting 730 Model failed to converge with max|grad| = 0.00200509 (tol = 0.002, component 1) 39 Fitting 808 Model failed to converge with max|grad| = 0.00219246 (tol = 0.002, component 1) 40 Fitting 896 Model failed to converge with max|grad| = 0.00230179 (tol = 0.002, component 1) 41 Fitting 900 Model failed to converge with max|grad| = 0.00229673 (tol = 0.002, component 1) 42 Fitting 903 Model failed to converge with max|grad| = 0.00766229 (tol = 0.002, component 1) 43 Fitting 981 Model failed to converge with max|grad| = 0.00616083 (tol = 0.002, component 1) 44 Fitting 991 Model failed to converge with max|grad| = 0.00318362 (tol = 0.002, component 1) 45 Fitting 996 Model failed to converge with max|grad| = 0.00215487 (tol = 0.002, component 1) 46 Fitting 998 Model failed to converge with max|grad| = 0.00394671 (tol = 0.002, component 1) 47 Fitting 3 Model failed to converge with max|grad| = 0.0029139 (tol = 0.002, component 1) 48 Fitting 9 Model failed to converge with max|grad| = 0.00757528 (tol = 0.002, component 1) 49 Fitting 10 Model failed to converge with max|grad| = 0.833708 (tol = 0.002, component 1) 50 Fitting 57 Model failed to converge with max|grad| = 0.00918637 (tol = 0.002, component 1) 51 Fitting 80 Model failed to converge with max|grad| = 0.00278841 (tol = 0.002, component 1) 52 Fitting 115 Model failed to converge with max|grad| = 0.00243277 (tol = 0.002, component 1) 53 Fitting 119 Model failed to converge with max|grad| = 0.00934591 (tol = 0.002, component 1) 54 Fitting 164 Model failed to converge with max|grad| = 0.00205531 (tol = 0.002, component 1) 55 Fitting 225 Model failed to converge with max|grad| = 0.00207476 (tol = 0.002, component 1) 56 Fitting 243 Model failed to converge with max|grad| = 0.504264 (tol = 0.002, component 1) 57 Fitting 264 Model failed to converge with max|grad| = 1.54674 (tol = 0.002, component 1) 58 Fitting 266 Model failed to converge with max|grad| = 0.0872681 (tol = 0.002, component 1) 59 Fitting 266 Model is nearly unidentifiable: very large eigenvalue\n - Rescale variables? 60 Fitting 275 Model failed to converge with max|grad| = 0.00320754 (tol = 0.002, component 1) 61 Fitting 377 Model failed to converge with max|grad| = 0.0102782 (tol = 0.002, component 1) 62 Fitting 387 Model failed to converge with max|grad| = 0.00220211 (tol = 0.002, component 1) 63 Fitting 411 Model failed to converge with max|grad| = 1.19436 (tol = 0.002, component 1) 64 Fitting 437 Model failed to converge with max|grad| = 0.0106277 (tol = 0.002, component 1) 65 Fitting 444 Model failed to converge with max|grad| = 0.00809652 (tol = 0.002, component 1) 66 Fitting 471 Model failed to converge with max|grad| = 0.00320446 (tol = 0.002, component 1) 67 Fitting 512 Model failed to converge with max|grad| = 0.00259598 (tol = 0.002, component 1) 68 Fitting 514 Model failed to converge with max|grad| = 0.00348399 (tol = 0.002, component 1) 69 Fitting 523 Model failed to converge with max|grad| = 0.00874823 (tol = 0.002, component 1) 70 Fitting 526 Model failed to converge with max|grad| = 0.00724222 (tol = 0.002, component 1) 71 Fitting 547 Model failed to converge with max|grad| = 0.00515456 (tol = 0.002, component 1) 72 Fitting 563 Model failed to converge with max|grad| = 0.00203198 (tol = 0.002, component 1) 73 Fitting 650 Model failed to converge with max|grad| = 0.0028225 (tol = 0.002, component 1) 74 Fitting 676 Model failed to converge with max|grad| = 0.00211598 (tol = 0.002, component 1) 75 Fitting 683 Model failed to converge with max|grad| = 0.00260387 (tol = 0.002, component 1) 76 Fitting 687 Model failed to converge with max|grad| = 0.00512881 (tol = 0.002, component 1) 77 Fitting 717 Model failed to converge with max|grad| = 0.00376529 (tol = 0.002, component 1) 78 Fitting 732 Model failed to converge with max|grad| = 0.00392673 (tol = 0.002, component 1) 79 Fitting 739 Model failed to converge with max|grad| = 0.0894933 (tol = 0.002, component 1) 80 Fitting 739 Model is nearly unidentifiable: very large eigenvalue\n - Rescale variables? 81 Fitting 783 Model failed to converge with max|grad| = 1.3048 (tol = 0.002, component 1) 82 Fitting 956 Model failed to converge with max|grad| = 0.00284147 (tol = 0.002, component 1) 83 Fitting 964 Model failed to converge with max|grad| = 0.00224885 (tol = 0.002, component 1) 84 Fitting 36 Model failed to converge with max|grad| = 0.643561 (tol = 0.002, component 1) 85 Fitting 57 Model failed to converge with max|grad| = 0.0040457 (tol = 0.002, component 1) 86 Fitting 84 Model failed to converge with max|grad| = 0.484554 (tol = 0.002, component 1) 87 Fitting 85 Model failed to converge with max|grad| = 0.00615877 (tol = 0.002, component 1) 88 Fitting 91 Model failed to converge with max|grad| = 0.00728123 (tol = 0.002, component 1) 89 Fitting 119 Model failed to converge with max|grad| = 0.82934 (tol = 0.002, component 1) 90 Fitting 127 Model failed to converge with max|grad| = 0.00216308 (tol = 0.002, component 1) 91 Fitting 141 Model failed to converge with max|grad| = 0.00311577 (tol = 0.002, component 1) 92 Fitting 142 Model failed to converge with max|grad| = 0.00430735 (tol = 0.002, component 1) 93 Fitting 157 Model failed to converge with max|grad| = 0.00229396 (tol = 0.002, component 1) 94 Fitting 204 Model failed to converge with max|grad| = 0.00230505 (tol = 0.002, component 1) 95 Fitting 216 Model failed to converge with max|grad| = 2.12461 (tol = 0.002, component 1) 96 Fitting 226 Model failed to converge with max|grad| = 1.0728 (tol = 0.002, component 1) 97 Fitting 246 Model failed to converge with max|grad| = 0.00252009 (tol = 0.002, component 1) 98 Fitting 251 Model failed to converge with max|grad| = 0.00330139 (tol = 0.002, component 1) 99 Fitting 299 Model failed to converge with max|grad| = 0.00302492 (tol = 0.002, component 1) 100 Fitting 313 Model failed to converge with max|grad| = 0.0026517 (tol = 0.002, component 1) 101 Fitting 330 Model failed to converge with max|grad| = 0.00303762 (tol = 0.002, component 1) 102 Fitting 337 Model failed to converge with max|grad| = 0.329658 (tol = 0.002, component 1) ```
> powercurve$errors
``` stage index message 1 Fitting 318 cannot allocate vector of size 138 Kb 2 Fitting 345 cannot allocate vector of size 825 Kb 3 Fitting 346 cannot allocate vector of size 825 Kb 4 Fitting 347 cannot allocate vector of size 825 Kb 5 Fitting 348 cannot allocate vector of size 825 Kb 6 Fitting 349 cannot allocate vector of size 825 Kb 7 Fitting 350 cannot allocate vector of size 825 Kb 8 Fitting 351 cannot allocate vector of size 825 Kb 9 Fitting 352 cannot allocate vector of size 825 Kb 10 Fitting 353 cannot allocate vector of size 825 Kb 11 Fitting 354 cannot allocate vector of size 825 Kb 12 Fitting 355 cannot allocate vector of size 825 Kb 13 Fitting 356 cannot allocate vector of size 825 Kb 14 Fitting 357 cannot allocate vector of size 825 Kb 15 Fitting 358 cannot allocate vector of size 825 Kb 16 Fitting 359 cannot allocate vector of size 825 Kb 17 Fitting 360 cannot allocate vector of size 825 Kb 18 Fitting 361 cannot allocate vector of size 825 Kb 19 Fitting 362 cannot allocate vector of size 825 Kb 20 Fitting 363 cannot allocate vector of size 825 Kb 21 Fitting 364 cannot allocate vector of size 825 Kb 22 Fitting 365 cannot allocate vector of size 825 Kb 23 Fitting 366 cannot allocate vector of size 825 Kb 24 Fitting 367 cannot allocate vector of size 825 Kb 25 Fitting 368 cannot allocate vector of size 825 Kb 26 Fitting 369 cannot allocate vector of size 825 Kb 27 Fitting 370 cannot allocate vector of size 825 Kb 28 Fitting 371 cannot allocate vector of size 825 Kb 29 Fitting 372 cannot allocate vector of size 825 Kb 30 Fitting 373 cannot allocate vector of size 825 Kb 31 Fitting 374 cannot allocate vector of size 825 Kb 32 Fitting 375 cannot allocate vector of size 825 Kb 33 Fitting 376 cannot allocate vector of size 825 Kb 34 Fitting 377 cannot allocate vector of size 825 Kb 35 Fitting 378 cannot allocate vector of size 825 Kb 36 Fitting 379 cannot allocate vector of size 825 Kb 37 Fitting 380 cannot allocate vector of size 825 Kb 38 Fitting 381 cannot allocate vector of size 825 Kb 39 Fitting 382 cannot allocate vector of size 825 Kb 40 Fitting 383 cannot allocate vector of size 825 Kb 41 Fitting 384 cannot allocate vector of size 825 Kb 42 Fitting 385 cannot allocate vector of size 825 Kb 43 Fitting 386 cannot allocate vector of size 825 Kb 44 Fitting 387 cannot allocate vector of size 825 Kb 45 Fitting 388 cannot allocate vector of size 825 Kb 46 Fitting 389 cannot allocate vector of size 825 Kb 47 Fitting 390 cannot allocate vector of size 825 Kb 48 Fitting 391 cannot allocate vector of size 825 Kb 49 Fitting 392 cannot allocate vector of size 825 Kb 50 Fitting 393 cannot allocate vector of size 825 Kb 51 Fitting 394 cannot allocate vector of size 825 Kb 52 Fitting 395 cannot allocate vector of size 825 Kb 53 Fitting 396 cannot allocate vector of size 825 Kb 54 Fitting 397 cannot allocate vector of size 825 Kb 55 Fitting 398 cannot allocate vector of size 825 Kb 56 Fitting 399 cannot allocate vector of size 825 Kb 57 Fitting 400 cannot allocate vector of size 825 Kb 58 Fitting 401 cannot allocate vector of size 825 Kb 59 Fitting 402 cannot allocate vector of size 825 Kb 60 Fitting 403 cannot allocate vector of size 825 Kb 61 Fitting 404 cannot allocate vector of size 825 Kb 62 Fitting 405 cannot allocate vector of size 825 Kb 63 Fitting 406 cannot allocate vector of size 825 Kb 64 Fitting 407 cannot allocate vector of size 825 Kb 65 Fitting 408 cannot allocate vector of size 825 Kb 66 Fitting 409 cannot allocate vector of size 825 Kb 67 Fitting 410 cannot allocate vector of size 825 Kb 68 Fitting 411 cannot allocate vector of size 825 Kb 69 Fitting 412 cannot allocate vector of size 825 Kb 70 Fitting 413 cannot allocate vector of size 825 Kb 71 Fitting 414 cannot allocate vector of size 825 Kb 72 Fitting 415 cannot allocate vector of size 825 Kb 73 Fitting 416 cannot allocate vector of size 825 Kb 74 Fitting 417 cannot allocate vector of size 825 Kb 75 Fitting 418 cannot allocate vector of size 825 Kb 76 Fitting 419 cannot allocate vector of size 825 Kb 77 Fitting 420 cannot allocate vector of size 825 Kb 78 Fitting 421 cannot allocate vector of size 825 Kb 79 Fitting 422 cannot allocate vector of size 825 Kb 80 Fitting 423 cannot allocate vector of size 825 Kb 81 Fitting 424 cannot allocate vector of size 825 Kb 82 Fitting 425 cannot allocate vector of size 825 Kb 83 Fitting 426 cannot allocate vector of size 825 Kb 84 Fitting 427 cannot allocate vector of size 825 Kb 85 Fitting 428 cannot allocate vector of size 825 Kb 86 Fitting 429 cannot allocate vector of size 825 Kb 87 Fitting 430 cannot allocate vector of size 825 Kb 88 Fitting 431 cannot allocate vector of size 825 Kb 89 Fitting 432 cannot allocate vector of size 825 Kb 90 Fitting 433 cannot allocate vector of size 825 Kb 91 Fitting 434 cannot allocate vector of size 825 Kb 92 Fitting 435 cannot allocate vector of size 825 Kb 93 Fitting 436 cannot allocate vector of size 825 Kb 94 Fitting 437 cannot allocate vector of size 825 Kb 95 Fitting 438 cannot allocate vector of size 825 Kb 96 Fitting 439 cannot allocate vector of size 825 Kb 97 Fitting 440 cannot allocate vector of size 825 Kb 98 Fitting 441 cannot allocate vector of size 825 Kb 99 Fitting 442 cannot allocate vector of size 825 Kb 100 Fitting 443 cannot allocate vector of size 825 Kb 101 Fitting 444 cannot allocate vector of size 825 Kb 102 Fitting 445 cannot allocate vector of size 825 Kb 103 Fitting 446 cannot allocate vector of size 825 Kb 104 Fitting 447 cannot allocate vector of size 825 Kb 105 Fitting 448 cannot allocate vector of size 825 Kb 106 Fitting 449 cannot allocate vector of size 825 Kb 107 Fitting 450 cannot allocate vector of size 825 Kb 108 Fitting 451 cannot allocate vector of size 825 Kb 109 Fitting 452 cannot allocate vector of size 825 Kb 110 Fitting 453 cannot allocate vector of size 825 Kb 111 Fitting 454 cannot allocate vector of size 825 Kb 112 Fitting 455 cannot allocate vector of size 825 Kb 113 Fitting 456 cannot allocate vector of size 825 Kb 114 Fitting 457 cannot allocate vector of size 825 Kb 115 Fitting 458 cannot allocate vector of size 825 Kb 116 Fitting 459 cannot allocate vector of size 825 Kb 117 Fitting 460 cannot allocate vector of size 825 Kb 118 Fitting 461 cannot allocate vector of size 825 Kb 119 Fitting 462 cannot allocate vector of size 825 Kb 120 Fitting 463 cannot allocate vector of size 825 Kb 121 Fitting 464 cannot allocate vector of size 825 Kb 122 Fitting 465 cannot allocate vector of size 825 Kb 123 Fitting 466 cannot allocate vector of size 825 Kb 124 Fitting 467 cannot allocate vector of size 825 Kb 125 Fitting 468 cannot allocate vector of size 825 Kb 126 Fitting 469 cannot allocate vector of size 825 Kb 127 Fitting 470 cannot allocate vector of size 825 Kb 128 Fitting 471 cannot allocate vector of size 825 Kb 129 Fitting 472 cannot allocate vector of size 825 Kb 130 Fitting 473 cannot allocate vector of size 825 Kb 131 Fitting 474 cannot allocate vector of size 825 Kb 132 Fitting 475 cannot allocate vector of size 825 Kb 133 Fitting 476 cannot allocate vector of size 825 Kb 134 Fitting 477 cannot allocate vector of size 825 Kb 135 Fitting 478 cannot allocate vector of size 825 Kb 136 Fitting 479 cannot allocate vector of size 825 Kb 137 Fitting 480 cannot allocate vector of size 825 Kb 138 Fitting 481 cannot allocate vector of size 825 Kb 139 Fitting 482 cannot allocate vector of size 825 Kb 140 Fitting 483 cannot allocate vector of size 825 Kb 141 Fitting 484 cannot allocate vector of size 825 Kb 142 Fitting 485 cannot allocate vector of size 825 Kb 143 Fitting 486 cannot allocate vector of size 825 Kb 144 Fitting 487 cannot allocate vector of size 825 Kb 145 Fitting 488 cannot allocate vector of size 825 Kb 146 Fitting 489 cannot allocate vector of size 825 Kb 147 Fitting 490 cannot allocate vector of size 825 Kb 148 Fitting 491 cannot allocate vector of size 825 Kb 149 Fitting 492 cannot allocate vector of size 825 Kb 150 Fitting 493 cannot allocate vector of size 825 Kb 151 Fitting 494 cannot allocate vector of size 825 Kb 152 Fitting 495 cannot allocate vector of size 825 Kb 153 Fitting 496 cannot allocate vector of size 825 Kb 154 Fitting 497 cannot allocate vector of size 825 Kb 155 Fitting 498 cannot allocate vector of size 825 Kb 156 Fitting 499 cannot allocate vector of size 825 Kb 157 Fitting 500 cannot allocate vector of size 825 Kb 158 Fitting 501 cannot allocate vector of size 825 Kb 159 Fitting 502 cannot allocate vector of size 825 Kb 160 Fitting 503 cannot allocate vector of size 825 Kb 161 Fitting 504 cannot allocate vector of size 825 Kb 162 Fitting 505 cannot allocate vector of size 825 Kb 163 Fitting 506 cannot allocate vector of size 825 Kb 164 Fitting 507 cannot allocate vector of size 825 Kb 165 Fitting 508 cannot allocate vector of size 825 Kb 166 Fitting 509 cannot allocate vector of size 825 Kb 167 Fitting 510 cannot allocate vector of size 825 Kb 168 Fitting 511 cannot allocate vector of size 825 Kb 169 Fitting 512 cannot allocate vector of size 825 Kb 170 Fitting 513 cannot allocate vector of size 825 Kb 171 Fitting 514 cannot allocate vector of size 825 Kb 172 Fitting 515 cannot allocate vector of size 825 Kb 173 Fitting 516 cannot allocate vector of size 825 Kb 174 Fitting 517 cannot allocate vector of size 825 Kb 175 Fitting 518 cannot allocate vector of size 825 Kb 176 Fitting 519 cannot allocate vector of size 825 Kb 177 Fitting 520 cannot allocate vector of size 825 Kb 178 Fitting 521 cannot allocate vector of size 825 Kb 179 Fitting 522 cannot allocate vector of size 825 Kb 180 Fitting 523 cannot allocate vector of size 825 Kb 181 Fitting 524 cannot allocate vector of size 825 Kb 182 Fitting 525 cannot allocate vector of size 825 Kb 183 Fitting 526 cannot allocate vector of size 825 Kb 184 Fitting 527 cannot allocate vector of size 825 Kb 185 Fitting 528 cannot allocate vector of size 825 Kb 186 Fitting 529 cannot allocate vector of size 825 Kb 187 Fitting 530 cannot allocate vector of size 825 Kb 188 Fitting 531 cannot allocate vector of size 825 Kb 189 Fitting 532 cannot allocate vector of size 825 Kb 190 Fitting 533 cannot allocate vector of size 825 Kb 191 Fitting 534 cannot allocate vector of size 825 Kb 192 Fitting 535 cannot allocate vector of size 825 Kb 193 Fitting 536 cannot allocate vector of size 825 Kb 194 Fitting 537 cannot allocate vector of size 825 Kb 195 Fitting 538 cannot allocate vector of size 825 Kb 196 Fitting 539 cannot allocate vector of size 825 Kb 197 Fitting 540 cannot allocate vector of size 825 Kb 198 Fitting 541 cannot allocate vector of size 825 Kb 199 Fitting 542 cannot allocate vector of size 825 Kb 200 Fitting 543 cannot allocate vector of size 825 Kb 201 Fitting 544 cannot allocate vector of size 825 Kb 202 Fitting 545 cannot allocate vector of size 825 Kb 203 Fitting 546 cannot allocate vector of size 825 Kb 204 Fitting 547 cannot allocate vector of size 825 Kb 205 Fitting 548 cannot allocate vector of size 825 Kb 206 Fitting 549 cannot allocate vector of size 825 Kb 207 Fitting 550 cannot allocate vector of size 825 Kb 208 Fitting 551 cannot allocate vector of size 825 Kb 209 Fitting 552 cannot allocate vector of size 825 Kb 210 Fitting 553 cannot allocate vector of size 825 Kb 211 Fitting 554 cannot allocate vector of size 825 Kb 212 Fitting 555 cannot allocate vector of size 825 Kb 213 Fitting 556 cannot allocate vector of size 825 Kb 214 Fitting 557 cannot allocate vector of size 825 Kb 215 Fitting 558 cannot allocate vector of size 825 Kb 216 Fitting 559 cannot allocate vector of size 825 Kb 217 Fitting 560 cannot allocate vector of size 825 Kb 218 Fitting 561 cannot allocate vector of size 825 Kb 219 Fitting 562 cannot allocate vector of size 825 Kb 220 Fitting 563 cannot allocate vector of size 825 Kb 221 Fitting 564 cannot allocate vector of size 825 Kb 222 Fitting 565 cannot allocate vector of size 825 Kb 223 Fitting 566 cannot allocate vector of size 825 Kb 224 Fitting 567 cannot allocate vector of size 825 Kb 225 Fitting 568 cannot allocate vector of size 825 Kb 226 Fitting 569 cannot allocate vector of size 825 Kb 227 Fitting 570 cannot allocate vector of size 825 Kb 228 Fitting 571 cannot allocate vector of size 825 Kb 229 Fitting 572 cannot allocate vector of size 825 Kb 230 Fitting 573 cannot allocate vector of size 825 Kb 231 Fitting 574 cannot allocate vector of size 825 Kb 232 Fitting 575 cannot allocate vector of size 825 Kb 233 Fitting 576 cannot allocate vector of size 825 Kb 234 Fitting 577 cannot allocate vector of size 825 Kb 235 Fitting 578 cannot allocate vector of size 825 Kb 236 Fitting 579 cannot allocate vector of size 825 Kb 237 Fitting 580 cannot allocate vector of size 825 Kb 238 Fitting 581 cannot allocate vector of size 825 Kb 239 Fitting 582 cannot allocate vector of size 825 Kb 240 Fitting 583 cannot allocate vector of size 825 Kb 241 Fitting 584 cannot allocate vector of size 825 Kb 242 Fitting 585 cannot allocate vector of size 825 Kb 243 Fitting 586 cannot allocate vector of size 825 Kb 244 Fitting 587 cannot allocate vector of size 825 Kb 245 Fitting 588 cannot allocate vector of size 825 Kb 246 Fitting 589 cannot allocate vector of size 825 Kb 247 Fitting 590 cannot allocate vector of size 825 Kb 248 Fitting 591 cannot allocate vector of size 825 Kb 249 Fitting 592 cannot allocate vector of size 825 Kb 250 Fitting 593 cannot allocate vector of size 825 Kb 251 Fitting 594 cannot allocate vector of size 825 Kb 252 Fitting 595 cannot allocate vector of size 825 Kb 253 Fitting 596 cannot allocate vector of size 825 Kb 254 Fitting 597 cannot allocate vector of size 825 Kb 255 Fitting 598 cannot allocate vector of size 825 Kb 256 Fitting 599 cannot allocate vector of size 825 Kb 257 Fitting 600 cannot allocate vector of size 825 Kb 258 Fitting 601 cannot allocate vector of size 825 Kb 259 Fitting 602 cannot allocate vector of size 825 Kb 260 Fitting 603 cannot allocate vector of size 825 Kb 261 Fitting 604 cannot allocate vector of size 825 Kb 262 Fitting 605 cannot allocate vector of size 825 Kb 263 Fitting 606 cannot allocate vector of size 825 Kb 264 Fitting 607 cannot allocate vector of size 825 Kb 265 Fitting 608 cannot allocate vector of size 825 Kb 266 Fitting 609 cannot allocate vector of size 825 Kb 267 Fitting 610 cannot allocate vector of size 825 Kb 268 Fitting 611 cannot allocate vector of size 825 Kb 269 Fitting 612 cannot allocate vector of size 825 Kb 270 Fitting 613 cannot allocate vector of size 825 Kb 271 Fitting 614 cannot allocate vector of size 825 Kb 272 Fitting 615 cannot allocate vector of size 825 Kb 273 Fitting 616 cannot allocate vector of size 825 Kb 274 Fitting 617 cannot allocate vector of size 825 Kb 275 Fitting 618 cannot allocate vector of size 825 Kb 276 Fitting 619 cannot allocate vector of size 825 Kb 277 Fitting 620 cannot allocate vector of size 825 Kb 278 Fitting 621 cannot allocate vector of size 825 Kb 279 Fitting 622 cannot allocate vector of size 825 Kb 280 Fitting 623 cannot allocate vector of size 825 Kb 281 Fitting 624 cannot allocate vector of size 825 Kb 282 Fitting 625 cannot allocate vector of size 825 Kb 283 Fitting 626 cannot allocate vector of size 825 Kb 284 Fitting 627 cannot allocate vector of size 825 Kb 285 Fitting 628 cannot allocate vector of size 825 Kb 286 Fitting 629 cannot allocate vector of size 825 Kb 287 Fitting 630 cannot allocate vector of size 825 Kb 288 Fitting 631 cannot allocate vector of size 825 Kb 289 Fitting 632 cannot allocate vector of size 825 Kb 290 Fitting 633 cannot allocate vector of size 825 Kb 291 Fitting 634 cannot allocate vector of size 825 Kb 292 Fitting 635 cannot allocate vector of size 825 Kb 293 Fitting 636 cannot allocate vector of size 825 Kb 294 Fitting 637 cannot allocate vector of size 825 Kb 295 Fitting 638 cannot allocate vector of size 825 Kb 296 Fitting 639 cannot allocate vector of size 825 Kb 297 Fitting 640 cannot allocate vector of size 825 Kb 298 Fitting 641 cannot allocate vector of size 825 Kb 299 Fitting 642 cannot allocate vector of size 825 Kb 300 Fitting 643 cannot allocate vector of size 825 Kb 301 Fitting 644 cannot allocate vector of size 825 Kb 302 Fitting 645 cannot allocate vector of size 825 Kb 303 Fitting 646 cannot allocate vector of size 825 Kb 304 Fitting 647 cannot allocate vector of size 825 Kb 305 Fitting 648 cannot allocate vector of size 825 Kb 306 Fitting 649 cannot allocate vector of size 825 Kb 307 Fitting 650 cannot allocate vector of size 825 Kb 308 Fitting 651 cannot allocate vector of size 825 Kb 309 Fitting 652 cannot allocate vector of size 825 Kb 310 Fitting 653 cannot allocate vector of size 825 Kb 311 Fitting 654 cannot allocate vector of size 825 Kb 312 Fitting 655 cannot allocate vector of size 825 Kb 313 Fitting 656 cannot allocate vector of size 825 Kb 314 Fitting 657 cannot allocate vector of size 825 Kb 315 Fitting 658 cannot allocate vector of size 825 Kb 316 Fitting 659 cannot allocate vector of size 825 Kb 317 Fitting 660 cannot allocate vector of size 825 Kb 318 Fitting 661 cannot allocate vector of size 825 Kb 319 Fitting 662 cannot allocate vector of size 825 Kb 320 Fitting 663 cannot allocate vector of size 825 Kb 321 Fitting 664 cannot allocate vector of size 825 Kb 322 Fitting 665 cannot allocate vector of size 825 Kb 323 Fitting 666 cannot allocate vector of size 825 Kb 324 Fitting 667 cannot allocate vector of size 825 Kb 325 Fitting 668 cannot allocate vector of size 825 Kb 326 Fitting 669 cannot allocate vector of size 825 Kb 327 Fitting 670 cannot allocate vector of size 825 Kb 328 Fitting 671 cannot allocate vector of size 825 Kb 329 Fitting 672 cannot allocate vector of size 825 Kb 330 Fitting 673 cannot allocate vector of size 825 Kb 331 Fitting 674 cannot allocate vector of size 825 Kb 332 Fitting 675 cannot allocate vector of size 825 Kb 333 Fitting 676 cannot allocate vector of size 825 Kb [ reached 'max' / getOption("max.print") -- omitted 1324 rows ]
ddscott2 commented 3 years ago

Here's what I ran:

powersim <- powerSim(SkillTwoWay2, fixed("Object:OP.c"), nsim = 10) 

powercurve <- powerCurve(SkillTwoWay2, fixed("Object"), along = "ID", breaks=c(50, 75, 100, 125))

Output for powersim:

> powersim
Power for predictor 'Object:OP.c', (95% confidence interval):
      100.0% (69.15, 100.0)

Test: z-test
      Effect size for Object:OP.c is 0.33

Based on 10 simulations, (1 warning, 0 errors)
alpha = 0.05, nrow = 17600

Time elapsed: 0 h 12 m 12 s

nb: result might be an observed power calculation
pitakakariki commented 3 years ago

Look like you're running out of memory. If powerSim is coping you might be better off running a separate powerSim for each sample size?

ddscott2 commented 3 years ago

I ran the first two sample sizes, with the $warnings and $error reports too:

> powercurve1 <- powerCurve(SkillTwoWay2, fixed("Object"), along = "ID", breaks=c(50))
Calculating power at 1 sample sizes along ID
This appears to be an "observed power" calculation===================================================================================================================================================================================|

> powercurve2 <- powerCurve(SkillTwoWay2, fixed("Object"), along = "ID", breaks=c(75))
Calculating power at 1 sample sizes along ID
This appears to be an "observed power" calculation===================================================================================================================================================================================|

> powercurve1
Power for predictor 'Object', (95% confidence interval),
by number of levels in ID:
     50:  0.00% ( 0.00,  0.37) - 0 rows

Time elapsed: 0 h 26 m 41 s

> powercurve2
Power for predictor 'Object', (95% confidence interval),
by number of levels in ID:
     75:  0.00% ( 0.00,  0.37) - 0 rows

Time elapsed: 0 h 26 m 45 s

> powercurve1$warnings
[1] stage   index   message
<0 rows> (or 0-length row.names)
> powercurve1$errors
``` stage index message 1 Fitting 1 object 'Response' not found 2 Fitting 2 object 'Response' not found 3 Fitting 3 object 'Response' not found 4 Fitting 4 object 'Response' not found 5 Fitting 5 object 'Response' not found 6 Fitting 6 object 'Response' not found 7 Fitting 7 object 'Response' not found 8 Fitting 8 object 'Response' not found 9 Fitting 9 object 'Response' not found 10 Fitting 10 object 'Response' not found 11 Fitting 11 object 'Response' not found 12 Fitting 12 object 'Response' not found 13 Fitting 13 object 'Response' not found 14 Fitting 14 object 'Response' not found 15 Fitting 15 object 'Response' not found 16 Fitting 16 object 'Response' not found 17 Fitting 17 object 'Response' not found 18 Fitting 18 object 'Response' not found 19 Fitting 19 object 'Response' not found 20 Fitting 20 object 'Response' not found 21 Fitting 21 object 'Response' not found 22 Fitting 22 object 'Response' not found 23 Fitting 23 object 'Response' not found 24 Fitting 24 object 'Response' not found 25 Fitting 25 object 'Response' not found 26 Fitting 26 object 'Response' not found 27 Fitting 27 object 'Response' not found 28 Fitting 28 object 'Response' not found 29 Fitting 29 object 'Response' not found 30 Fitting 30 object 'Response' not found 31 Fitting 31 object 'Response' not found 32 Fitting 32 object 'Response' not found 33 Fitting 33 object 'Response' not found 34 Fitting 34 object 'Response' not found 35 Fitting 35 object 'Response' not found 36 Fitting 36 object 'Response' not found 37 Fitting 37 object 'Response' not found 38 Fitting 38 object 'Response' not found 39 Fitting 39 object 'Response' not found 40 Fitting 40 object 'Response' not found 41 Fitting 41 object 'Response' not found 42 Fitting 42 object 'Response' not found 43 Fitting 43 object 'Response' not found 44 Fitting 44 object 'Response' not found 45 Fitting 45 object 'Response' not found 46 Fitting 46 object 'Response' not found 47 Fitting 47 object 'Response' not found 48 Fitting 48 object 'Response' not found 49 Fitting 49 object 'Response' not found 50 Fitting 50 object 'Response' not found 51 Fitting 51 object 'Response' not found 52 Fitting 52 object 'Response' not found 53 Fitting 53 object 'Response' not found 54 Fitting 54 object 'Response' not found 55 Fitting 55 object 'Response' not found 56 Fitting 56 object 'Response' not found 57 Fitting 57 object 'Response' not found 58 Fitting 58 object 'Response' not found 59 Fitting 59 object 'Response' not found 60 Fitting 60 object 'Response' not found 61 Fitting 61 object 'Response' not found 62 Fitting 62 object 'Response' not found 63 Fitting 63 object 'Response' not found 64 Fitting 64 object 'Response' not found 65 Fitting 65 object 'Response' not found 66 Fitting 66 object 'Response' not found 67 Fitting 67 object 'Response' not found 68 Fitting 68 object 'Response' not found 69 Fitting 69 object 'Response' not found 70 Fitting 70 object 'Response' not found 71 Fitting 71 object 'Response' not found 72 Fitting 72 object 'Response' not found 73 Fitting 73 object 'Response' not found 74 Fitting 74 object 'Response' not found 75 Fitting 75 object 'Response' not found 76 Fitting 76 object 'Response' not found 77 Fitting 77 object 'Response' not found 78 Fitting 78 object 'Response' not found 79 Fitting 79 object 'Response' not found 80 Fitting 80 object 'Response' not found 81 Fitting 81 object 'Response' not found 82 Fitting 82 object 'Response' not found 83 Fitting 83 object 'Response' not found 84 Fitting 84 object 'Response' not found 85 Fitting 85 object 'Response' not found 86 Fitting 86 object 'Response' not found 87 Fitting 87 object 'Response' not found 88 Fitting 88 object 'Response' not found 89 Fitting 89 object 'Response' not found 90 Fitting 90 object 'Response' not found 91 Fitting 91 object 'Response' not found 92 Fitting 92 object 'Response' not found 93 Fitting 93 object 'Response' not found 94 Fitting 94 object 'Response' not found 95 Fitting 95 object 'Response' not found 96 Fitting 96 object 'Response' not found 97 Fitting 97 object 'Response' not found 98 Fitting 98 object 'Response' not found 99 Fitting 99 object 'Response' not found 100 Fitting 100 object 'Response' not found 101 Fitting 101 object 'Response' not found 102 Fitting 102 object 'Response' not found 103 Fitting 103 object 'Response' not found 104 Fitting 104 object 'Response' not found 105 Fitting 105 object 'Response' not found 106 Fitting 106 object 'Response' not found 107 Fitting 107 object 'Response' not found 108 Fitting 108 object 'Response' not found 109 Fitting 109 object 'Response' not found 110 Fitting 110 object 'Response' not found 111 Fitting 111 object 'Response' not found 112 Fitting 112 object 'Response' not found 113 Fitting 113 object 'Response' not found 114 Fitting 114 object 'Response' not found 115 Fitting 115 object 'Response' not found 116 Fitting 116 object 'Response' not found 117 Fitting 117 object 'Response' not found 118 Fitting 118 object 'Response' not found 119 Fitting 119 object 'Response' not found 120 Fitting 120 object 'Response' not found 121 Fitting 121 object 'Response' not found 122 Fitting 122 object 'Response' not found 123 Fitting 123 object 'Response' not found 124 Fitting 124 object 'Response' not found 125 Fitting 125 object 'Response' not found 126 Fitting 126 object 'Response' not found 127 Fitting 127 object 'Response' not found 128 Fitting 128 object 'Response' not found 129 Fitting 129 object 'Response' not found 130 Fitting 130 object 'Response' not found 131 Fitting 131 object 'Response' not found 132 Fitting 132 object 'Response' not found 133 Fitting 133 object 'Response' not found 134 Fitting 134 object 'Response' not found 135 Fitting 135 object 'Response' not found 136 Fitting 136 object 'Response' not found 137 Fitting 137 object 'Response' not found 138 Fitting 138 object 'Response' not found 139 Fitting 139 object 'Response' not found 140 Fitting 140 object 'Response' not found 141 Fitting 141 object 'Response' not found 142 Fitting 142 object 'Response' not found 143 Fitting 143 object 'Response' not found 144 Fitting 144 object 'Response' not found 145 Fitting 145 object 'Response' not found 146 Fitting 146 object 'Response' not found 147 Fitting 147 object 'Response' not found 148 Fitting 148 object 'Response' not found 149 Fitting 149 object 'Response' not found 150 Fitting 150 object 'Response' not found 151 Fitting 151 object 'Response' not found 152 Fitting 152 object 'Response' not found 153 Fitting 153 object 'Response' not found 154 Fitting 154 object 'Response' not found 155 Fitting 155 object 'Response' not found 156 Fitting 156 object 'Response' not found 157 Fitting 157 object 'Response' not found 158 Fitting 158 object 'Response' not found 159 Fitting 159 object 'Response' not found 160 Fitting 160 object 'Response' not found 161 Fitting 161 object 'Response' not found 162 Fitting 162 object 'Response' not found 163 Fitting 163 object 'Response' not found 164 Fitting 164 object 'Response' not found 165 Fitting 165 object 'Response' not found 166 Fitting 166 object 'Response' not found 167 Fitting 167 object 'Response' not found 168 Fitting 168 object 'Response' not found 169 Fitting 169 object 'Response' not found 170 Fitting 170 object 'Response' not found 171 Fitting 171 object 'Response' not found 172 Fitting 172 object 'Response' not found 173 Fitting 173 object 'Response' not found 174 Fitting 174 object 'Response' not found 175 Fitting 175 object 'Response' not found 176 Fitting 176 object 'Response' not found 177 Fitting 177 object 'Response' not found 178 Fitting 178 object 'Response' not found 179 Fitting 179 object 'Response' not found 180 Fitting 180 object 'Response' not found 181 Fitting 181 object 'Response' not found 182 Fitting 182 object 'Response' not found 183 Fitting 183 object 'Response' not found 184 Fitting 184 object 'Response' not found 185 Fitting 185 object 'Response' not found 186 Fitting 186 object 'Response' not found 187 Fitting 187 object 'Response' not found 188 Fitting 188 object 'Response' not found 189 Fitting 189 object 'Response' not found 190 Fitting 190 object 'Response' not found 191 Fitting 191 object 'Response' not found 192 Fitting 192 object 'Response' not found 193 Fitting 193 object 'Response' not found 194 Fitting 194 object 'Response' not found 195 Fitting 195 object 'Response' not found 196 Fitting 196 object 'Response' not found 197 Fitting 197 object 'Response' not found 198 Fitting 198 object 'Response' not found 199 Fitting 199 object 'Response' not found 200 Fitting 200 object 'Response' not found 201 Fitting 201 object 'Response' not found 202 Fitting 202 object 'Response' not found 203 Fitting 203 object 'Response' not found 204 Fitting 204 object 'Response' not found 205 Fitting 205 object 'Response' not found 206 Fitting 206 object 'Response' not found 207 Fitting 207 object 'Response' not found 208 Fitting 208 object 'Response' not found 209 Fitting 209 object 'Response' not found 210 Fitting 210 object 'Response' not found 211 Fitting 211 object 'Response' not found 212 Fitting 212 object 'Response' not found 213 Fitting 213 object 'Response' not found 214 Fitting 214 object 'Response' not found 215 Fitting 215 object 'Response' not found 216 Fitting 216 object 'Response' not found 217 Fitting 217 object 'Response' not found 218 Fitting 218 object 'Response' not found 219 Fitting 219 object 'Response' not found 220 Fitting 220 object 'Response' not found 221 Fitting 221 object 'Response' not found 222 Fitting 222 object 'Response' not found 223 Fitting 223 object 'Response' not found 224 Fitting 224 object 'Response' not found 225 Fitting 225 object 'Response' not found 226 Fitting 226 object 'Response' not found 227 Fitting 227 object 'Response' not found 228 Fitting 228 object 'Response' not found 229 Fitting 229 object 'Response' not found 230 Fitting 230 object 'Response' not found 231 Fitting 231 object 'Response' not found 232 Fitting 232 object 'Response' not found 233 Fitting 233 object 'Response' not found 234 Fitting 234 object 'Response' not found 235 Fitting 235 object 'Response' not found 236 Fitting 236 object 'Response' not found 237 Fitting 237 object 'Response' not found 238 Fitting 238 object 'Response' not found 239 Fitting 239 object 'Response' not found 240 Fitting 240 object 'Response' not found 241 Fitting 241 object 'Response' not found 242 Fitting 242 object 'Response' not found 243 Fitting 243 object 'Response' not found 244 Fitting 244 object 'Response' not found 245 Fitting 245 object 'Response' not found 246 Fitting 246 object 'Response' not found 247 Fitting 247 object 'Response' not found 248 Fitting 248 object 'Response' not found 249 Fitting 249 object 'Response' not found 250 Fitting 250 object 'Response' not found 251 Fitting 251 object 'Response' not found 252 Fitting 252 object 'Response' not found 253 Fitting 253 object 'Response' not found 254 Fitting 254 object 'Response' not found 255 Fitting 255 object 'Response' not found 256 Fitting 256 object 'Response' not found 257 Fitting 257 object 'Response' not found 258 Fitting 258 object 'Response' not found 259 Fitting 259 object 'Response' not found 260 Fitting 260 object 'Response' not found 261 Fitting 261 object 'Response' not found 262 Fitting 262 object 'Response' not found 263 Fitting 263 object 'Response' not found 264 Fitting 264 object 'Response' not found 265 Fitting 265 object 'Response' not found 266 Fitting 266 object 'Response' not found 267 Fitting 267 object 'Response' not found 268 Fitting 268 object 'Response' not found 269 Fitting 269 object 'Response' not found 270 Fitting 270 object 'Response' not found 271 Fitting 271 object 'Response' not found 272 Fitting 272 object 'Response' not found 273 Fitting 273 object 'Response' not found 274 Fitting 274 object 'Response' not found 275 Fitting 275 object 'Response' not found 276 Fitting 276 object 'Response' not found 277 Fitting 277 object 'Response' not found 278 Fitting 278 object 'Response' not found 279 Fitting 279 object 'Response' not found 280 Fitting 280 object 'Response' not found 281 Fitting 281 object 'Response' not found 282 Fitting 282 object 'Response' not found 283 Fitting 283 object 'Response' not found 284 Fitting 284 object 'Response' not found 285 Fitting 285 object 'Response' not found 286 Fitting 286 object 'Response' not found 287 Fitting 287 object 'Response' not found 288 Fitting 288 object 'Response' not found 289 Fitting 289 object 'Response' not found 290 Fitting 290 object 'Response' not found 291 Fitting 291 object 'Response' not found 292 Fitting 292 object 'Response' not found 293 Fitting 293 object 'Response' not found 294 Fitting 294 object 'Response' not found 295 Fitting 295 object 'Response' not found 296 Fitting 296 object 'Response' not found 297 Fitting 297 object 'Response' not found 298 Fitting 298 object 'Response' not found 299 Fitting 299 object 'Response' not found 300 Fitting 300 object 'Response' not found 301 Fitting 301 object 'Response' not found 302 Fitting 302 object 'Response' not found 303 Fitting 303 object 'Response' not found 304 Fitting 304 object 'Response' not found 305 Fitting 305 object 'Response' not found 306 Fitting 306 object 'Response' not found 307 Fitting 307 object 'Response' not found 308 Fitting 308 object 'Response' not found 309 Fitting 309 object 'Response' not found 310 Fitting 310 object 'Response' not found 311 Fitting 311 object 'Response' not found 312 Fitting 312 object 'Response' not found 313 Fitting 313 object 'Response' not found 314 Fitting 314 object 'Response' not found 315 Fitting 315 object 'Response' not found 316 Fitting 316 object 'Response' not found 317 Fitting 317 object 'Response' not found 318 Fitting 318 object 'Response' not found 319 Fitting 319 object 'Response' not found 320 Fitting 320 object 'Response' not found 321 Fitting 321 object 'Response' not found 322 Fitting 322 object 'Response' not found 323 Fitting 323 object 'Response' not found 324 Fitting 324 object 'Response' not found 325 Fitting 325 object 'Response' not found 326 Fitting 326 object 'Response' not found 327 Fitting 327 object 'Response' not found 328 Fitting 328 object 'Response' not found 329 Fitting 329 object 'Response' not found 330 Fitting 330 object 'Response' not found 331 Fitting 331 object 'Response' not found 332 Fitting 332 object 'Response' not found 333 Fitting 333 object 'Response' not found [ reached 'max' / getOption("max.print") -- omitted 667 rows ] ```
> powercurve2$warnings
[1] stage   index   message
<0 rows> (or 0-length row.names)
> powercurve2$errors
``` stage index message 1 Fitting 1 object 'Response' not found 2 Fitting 2 object 'Response' not found 3 Fitting 3 object 'Response' not found 4 Fitting 4 object 'Response' not found 5 Fitting 5 object 'Response' not found 6 Fitting 6 object 'Response' not found 7 Fitting 7 object 'Response' not found 8 Fitting 8 object 'Response' not found 9 Fitting 9 object 'Response' not found 10 Fitting 10 object 'Response' not found 11 Fitting 11 object 'Response' not found 12 Fitting 12 object 'Response' not found 13 Fitting 13 object 'Response' not found 14 Fitting 14 object 'Response' not found 15 Fitting 15 object 'Response' not found 16 Fitting 16 object 'Response' not found 17 Fitting 17 object 'Response' not found 18 Fitting 18 object 'Response' not found 19 Fitting 19 object 'Response' not found 20 Fitting 20 object 'Response' not found 21 Fitting 21 object 'Response' not found 22 Fitting 22 object 'Response' not found 23 Fitting 23 object 'Response' not found 24 Fitting 24 object 'Response' not found 25 Fitting 25 object 'Response' not found 26 Fitting 26 object 'Response' not found 27 Fitting 27 object 'Response' not found 28 Fitting 28 object 'Response' not found 29 Fitting 29 object 'Response' not found 30 Fitting 30 object 'Response' not found 31 Fitting 31 object 'Response' not found 32 Fitting 32 object 'Response' not found 33 Fitting 33 object 'Response' not found 34 Fitting 34 object 'Response' not found 35 Fitting 35 object 'Response' not found 36 Fitting 36 object 'Response' not found 37 Fitting 37 object 'Response' not found 38 Fitting 38 object 'Response' not found 39 Fitting 39 object 'Response' not found 40 Fitting 40 object 'Response' not found 41 Fitting 41 object 'Response' not found 42 Fitting 42 object 'Response' not found 43 Fitting 43 object 'Response' not found 44 Fitting 44 object 'Response' not found 45 Fitting 45 object 'Response' not found 46 Fitting 46 object 'Response' not found 47 Fitting 47 object 'Response' not found 48 Fitting 48 object 'Response' not found 49 Fitting 49 object 'Response' not found 50 Fitting 50 object 'Response' not found 51 Fitting 51 object 'Response' not found 52 Fitting 52 object 'Response' not found 53 Fitting 53 object 'Response' not found 54 Fitting 54 object 'Response' not found 55 Fitting 55 object 'Response' not found 56 Fitting 56 object 'Response' not found 57 Fitting 57 object 'Response' not found 58 Fitting 58 object 'Response' not found 59 Fitting 59 object 'Response' not found 60 Fitting 60 object 'Response' not found 61 Fitting 61 object 'Response' not found 62 Fitting 62 object 'Response' not found 63 Fitting 63 object 'Response' not found 64 Fitting 64 object 'Response' not found 65 Fitting 65 object 'Response' not found 66 Fitting 66 object 'Response' not found 67 Fitting 67 object 'Response' not found 68 Fitting 68 object 'Response' not found 69 Fitting 69 object 'Response' not found 70 Fitting 70 object 'Response' not found 71 Fitting 71 object 'Response' not found 72 Fitting 72 object 'Response' not found 73 Fitting 73 object 'Response' not found 74 Fitting 74 object 'Response' not found 75 Fitting 75 object 'Response' not found 76 Fitting 76 object 'Response' not found 77 Fitting 77 object 'Response' not found 78 Fitting 78 object 'Response' not found 79 Fitting 79 object 'Response' not found 80 Fitting 80 object 'Response' not found 81 Fitting 81 object 'Response' not found 82 Fitting 82 object 'Response' not found 83 Fitting 83 object 'Response' not found 84 Fitting 84 object 'Response' not found 85 Fitting 85 object 'Response' not found 86 Fitting 86 object 'Response' not found 87 Fitting 87 object 'Response' not found 88 Fitting 88 object 'Response' not found 89 Fitting 89 object 'Response' not found 90 Fitting 90 object 'Response' not found 91 Fitting 91 object 'Response' not found 92 Fitting 92 object 'Response' not found 93 Fitting 93 object 'Response' not found 94 Fitting 94 object 'Response' not found 95 Fitting 95 object 'Response' not found 96 Fitting 96 object 'Response' not found 97 Fitting 97 object 'Response' not found 98 Fitting 98 object 'Response' not found 99 Fitting 99 object 'Response' not found 100 Fitting 100 object 'Response' not found 101 Fitting 101 object 'Response' not found 102 Fitting 102 object 'Response' not found 103 Fitting 103 object 'Response' not found 104 Fitting 104 object 'Response' not found 105 Fitting 105 object 'Response' not found 106 Fitting 106 object 'Response' not found 107 Fitting 107 object 'Response' not found 108 Fitting 108 object 'Response' not found 109 Fitting 109 object 'Response' not found 110 Fitting 110 object 'Response' not found 111 Fitting 111 object 'Response' not found 112 Fitting 112 object 'Response' not found 113 Fitting 113 object 'Response' not found 114 Fitting 114 object 'Response' not found 115 Fitting 115 object 'Response' not found 116 Fitting 116 object 'Response' not found 117 Fitting 117 object 'Response' not found 118 Fitting 118 object 'Response' not found 119 Fitting 119 object 'Response' not found 120 Fitting 120 object 'Response' not found 121 Fitting 121 object 'Response' not found 122 Fitting 122 object 'Response' not found 123 Fitting 123 object 'Response' not found 124 Fitting 124 object 'Response' not found 125 Fitting 125 object 'Response' not found 126 Fitting 126 object 'Response' not found 127 Fitting 127 object 'Response' not found 128 Fitting 128 object 'Response' not found 129 Fitting 129 object 'Response' not found 130 Fitting 130 object 'Response' not found 131 Fitting 131 object 'Response' not found 132 Fitting 132 object 'Response' not found 133 Fitting 133 object 'Response' not found 134 Fitting 134 object 'Response' not found 135 Fitting 135 object 'Response' not found 136 Fitting 136 object 'Response' not found 137 Fitting 137 object 'Response' not found 138 Fitting 138 object 'Response' not found 139 Fitting 139 object 'Response' not found 140 Fitting 140 object 'Response' not found 141 Fitting 141 object 'Response' not found 142 Fitting 142 object 'Response' not found 143 Fitting 143 object 'Response' not found 144 Fitting 144 object 'Response' not found 145 Fitting 145 object 'Response' not found 146 Fitting 146 object 'Response' not found 147 Fitting 147 object 'Response' not found 148 Fitting 148 object 'Response' not found 149 Fitting 149 object 'Response' not found 150 Fitting 150 object 'Response' not found 151 Fitting 151 object 'Response' not found 152 Fitting 152 object 'Response' not found 153 Fitting 153 object 'Response' not found 154 Fitting 154 object 'Response' not found 155 Fitting 155 object 'Response' not found 156 Fitting 156 object 'Response' not found 157 Fitting 157 object 'Response' not found 158 Fitting 158 object 'Response' not found 159 Fitting 159 object 'Response' not found 160 Fitting 160 object 'Response' not found 161 Fitting 161 object 'Response' not found 162 Fitting 162 object 'Response' not found 163 Fitting 163 object 'Response' not found 164 Fitting 164 object 'Response' not found 165 Fitting 165 object 'Response' not found 166 Fitting 166 object 'Response' not found 167 Fitting 167 object 'Response' not found 168 Fitting 168 object 'Response' not found 169 Fitting 169 object 'Response' not found 170 Fitting 170 object 'Response' not found 171 Fitting 171 object 'Response' not found 172 Fitting 172 object 'Response' not found 173 Fitting 173 object 'Response' not found 174 Fitting 174 object 'Response' not found 175 Fitting 175 object 'Response' not found 176 Fitting 176 object 'Response' not found 177 Fitting 177 object 'Response' not found 178 Fitting 178 object 'Response' not found 179 Fitting 179 object 'Response' not found 180 Fitting 180 object 'Response' not found 181 Fitting 181 object 'Response' not found 182 Fitting 182 object 'Response' not found 183 Fitting 183 object 'Response' not found 184 Fitting 184 object 'Response' not found 185 Fitting 185 object 'Response' not found 186 Fitting 186 object 'Response' not found 187 Fitting 187 object 'Response' not found 188 Fitting 188 object 'Response' not found 189 Fitting 189 object 'Response' not found 190 Fitting 190 object 'Response' not found 191 Fitting 191 object 'Response' not found 192 Fitting 192 object 'Response' not found 193 Fitting 193 object 'Response' not found 194 Fitting 194 object 'Response' not found 195 Fitting 195 object 'Response' not found 196 Fitting 196 object 'Response' not found 197 Fitting 197 object 'Response' not found 198 Fitting 198 object 'Response' not found 199 Fitting 199 object 'Response' not found 200 Fitting 200 object 'Response' not found 201 Fitting 201 object 'Response' not found 202 Fitting 202 object 'Response' not found 203 Fitting 203 object 'Response' not found 204 Fitting 204 object 'Response' not found 205 Fitting 205 object 'Response' not found 206 Fitting 206 object 'Response' not found 207 Fitting 207 object 'Response' not found 208 Fitting 208 object 'Response' not found 209 Fitting 209 object 'Response' not found 210 Fitting 210 object 'Response' not found 211 Fitting 211 object 'Response' not found 212 Fitting 212 object 'Response' not found 213 Fitting 213 object 'Response' not found 214 Fitting 214 object 'Response' not found 215 Fitting 215 object 'Response' not found 216 Fitting 216 object 'Response' not found 217 Fitting 217 object 'Response' not found 218 Fitting 218 object 'Response' not found 219 Fitting 219 object 'Response' not found 220 Fitting 220 object 'Response' not found 221 Fitting 221 object 'Response' not found 222 Fitting 222 object 'Response' not found 223 Fitting 223 object 'Response' not found 224 Fitting 224 object 'Response' not found 225 Fitting 225 object 'Response' not found 226 Fitting 226 object 'Response' not found 227 Fitting 227 object 'Response' not found 228 Fitting 228 object 'Response' not found 229 Fitting 229 object 'Response' not found 230 Fitting 230 object 'Response' not found 231 Fitting 231 object 'Response' not found 232 Fitting 232 object 'Response' not found 233 Fitting 233 object 'Response' not found 234 Fitting 234 object 'Response' not found 235 Fitting 235 object 'Response' not found 236 Fitting 236 object 'Response' not found 237 Fitting 237 object 'Response' not found 238 Fitting 238 object 'Response' not found 239 Fitting 239 object 'Response' not found 240 Fitting 240 object 'Response' not found 241 Fitting 241 object 'Response' not found 242 Fitting 242 object 'Response' not found 243 Fitting 243 object 'Response' not found 244 Fitting 244 object 'Response' not found 245 Fitting 245 object 'Response' not found 246 Fitting 246 object 'Response' not found 247 Fitting 247 object 'Response' not found 248 Fitting 248 object 'Response' not found 249 Fitting 249 object 'Response' not found 250 Fitting 250 object 'Response' not found 251 Fitting 251 object 'Response' not found 252 Fitting 252 object 'Response' not found 253 Fitting 253 object 'Response' not found 254 Fitting 254 object 'Response' not found 255 Fitting 255 object 'Response' not found 256 Fitting 256 object 'Response' not found 257 Fitting 257 object 'Response' not found 258 Fitting 258 object 'Response' not found 259 Fitting 259 object 'Response' not found 260 Fitting 260 object 'Response' not found 261 Fitting 261 object 'Response' not found 262 Fitting 262 object 'Response' not found 263 Fitting 263 object 'Response' not found 264 Fitting 264 object 'Response' not found 265 Fitting 265 object 'Response' not found 266 Fitting 266 object 'Response' not found 267 Fitting 267 object 'Response' not found 268 Fitting 268 object 'Response' not found 269 Fitting 269 object 'Response' not found 270 Fitting 270 object 'Response' not found 271 Fitting 271 object 'Response' not found 272 Fitting 272 object 'Response' not found 273 Fitting 273 object 'Response' not found 274 Fitting 274 object 'Response' not found 275 Fitting 275 object 'Response' not found 276 Fitting 276 object 'Response' not found 277 Fitting 277 object 'Response' not found 278 Fitting 278 object 'Response' not found 279 Fitting 279 object 'Response' not found 280 Fitting 280 object 'Response' not found 281 Fitting 281 object 'Response' not found 282 Fitting 282 object 'Response' not found 283 Fitting 283 object 'Response' not found 284 Fitting 284 object 'Response' not found 285 Fitting 285 object 'Response' not found 286 Fitting 286 object 'Response' not found 287 Fitting 287 object 'Response' not found 288 Fitting 288 object 'Response' not found 289 Fitting 289 object 'Response' not found 290 Fitting 290 object 'Response' not found 291 Fitting 291 object 'Response' not found 292 Fitting 292 object 'Response' not found 293 Fitting 293 object 'Response' not found 294 Fitting 294 object 'Response' not found 295 Fitting 295 object 'Response' not found 296 Fitting 296 object 'Response' not found 297 Fitting 297 object 'Response' not found 298 Fitting 298 object 'Response' not found 299 Fitting 299 object 'Response' not found 300 Fitting 300 object 'Response' not found 301 Fitting 301 object 'Response' not found 302 Fitting 302 object 'Response' not found 303 Fitting 303 object 'Response' not found 304 Fitting 304 object 'Response' not found 305 Fitting 305 object 'Response' not found 306 Fitting 306 object 'Response' not found 307 Fitting 307 object 'Response' not found 308 Fitting 308 object 'Response' not found 309 Fitting 309 object 'Response' not found 310 Fitting 310 object 'Response' not found 311 Fitting 311 object 'Response' not found 312 Fitting 312 object 'Response' not found 313 Fitting 313 object 'Response' not found 314 Fitting 314 object 'Response' not found 315 Fitting 315 object 'Response' not found 316 Fitting 316 object 'Response' not found 317 Fitting 317 object 'Response' not found 318 Fitting 318 object 'Response' not found 319 Fitting 319 object 'Response' not found 320 Fitting 320 object 'Response' not found 321 Fitting 321 object 'Response' not found 322 Fitting 322 object 'Response' not found 323 Fitting 323 object 'Response' not found 324 Fitting 324 object 'Response' not found 325 Fitting 325 object 'Response' not found 326 Fitting 326 object 'Response' not found 327 Fitting 327 object 'Response' not found 328 Fitting 328 object 'Response' not found 329 Fitting 329 object 'Response' not found 330 Fitting 330 object 'Response' not found 331 Fitting 331 object 'Response' not found 332 Fitting 332 object 'Response' not found 333 Fitting 333 object 'Response' not found [ reached 'max' / getOption("max.print") -- omitted 667 rows ] ```
ddscott2 commented 3 years ago

Did I correctly run a powerSim for each sample size?

pitakakariki commented 3 years ago

One of your problems is that you appear to have only 92 ID's in your data set and you're trying to set breaks at 100 and 125.

I don't know why you're getting those "0 rows" results though. Could you please try the following:

str(naomit$ID)
sort(unique(naomit$ID))

I'd also recommend setting nsim when you're trying out powerCurve (like you have with powerSim) and not run large values of nsim until you have it working.

ddscott2 commented 3 years ago
> str(naomit$ID)
 Factor w/ 92 levels "0qajoaqo","100",..: 1 1 1 1 1 1 1 1 1 1 ...
> sort(unique(naomit$ID))
 [1] 0qajoaqo 100      101      102      103      104      106      107      108      109      111      112      113      114      115     
[16] 116      117      118      119      120      121      122      123      124      1ia2528x 1nshvpsy 1rr3xfrc 1w9jcj6d 2vlt2v2n 469ikial
[31] 5cl2qh5d 6mprqjfs 72jrug5w 79r9ob8q 82f94y0r 8g8c8b0c 8o6zgmlr 8s46ki0d bpii6i6t c1ihbqon d07miqx5 d3u0mv82 d4pzhzuv doujtcdp eqqowmki
[46] fd0ppmhk fhe60ywj fiw7o4le g4grw9v4 gu4pmqdo hqs5z3ny iee5otw5 irnf7ptw itembr31 iu23r0b8 iwg56hov j8arfng0 kz43a4li lmkj9lxu mgyg0zch
[61] ml05q0f1 mviyrtuh mzo5vci3 ne7fqm9r nubr18c2 o82g6766 ojnj4qff onxsdarj pt93mnno qhcpszrl qy6ihy95 rtlxrm22 rzigt3jr saq3btyr sblyczt0
[76] t2lpq7ym u3z3slfe vvwjon74 w15c8joa wpux51u5 yn36nefa yvmh7j75 ziedvces ziql5otu zmbmxdsx zqqewrvy zyux38sq
92 Levels: 0qajoaqo 100 101 102 103 104 106 107 108 109 111 112 113 114 115 116 117 118 119 120 121 122 123 124 1ia2528x 1nshvpsy ... zyux38sq
ddscott2 commented 3 years ago
> powercurve1 <- powerCurve(SkillTwoWay2, fixed("Object"), along = "ID", breaks=c(50), nsim = 10)
Calculating power at 1 sample sizes along ID
This appears to be an "observed power" calculation=======================================================================================|
> powercurve2 <- powerCurve(SkillTwoWay2, fixed("Object"), along = "ID", breaks=c(75), nsim = 10)
Calculating power at 1 sample sizes along ID
This appears to be an "observed power" calculation=======================================================================================|
> powercurve1
Power for predictor 'Object', (95% confidence interval),
by number of levels in ID:
     50: 100.0% (69.15, 100.0) - 10200 rows

Time elapsed: 0 h 4 m 31 s

> powercurve2
Power for predictor 'Object', (95% confidence interval),
by number of levels in ID:
     75: 100.0% (69.15, 100.0) - 15200 rows

Time elapsed: 0 h 8 m 28 s

Here's the output after I included nsim

pitakakariki commented 3 years ago

Now this is very strange. Has anything changed between running these two?

> powercurve1 <- powerCurve(SkillTwoWay2, fixed("Object"), along = "ID", breaks=c(50))
Calculating power at 1 sample sizes along ID
This appears to be an "observed power" calculation===================================================================================================================================================================================|

> powercurve1
Power for predictor 'Object', (95% confidence interval),
by number of levels in ID:
     50:  0.00% ( 0.00,  0.37) - 0 rows

Time elapsed: 0 h 26 m 41 s
> powercurve1 <- powerCurve(SkillTwoWay2, fixed("Object"), along = "ID", breaks=c(50), nsim = 10)
Calculating power at 1 sample sizes along ID
This appears to be an "observed power" calculation=======================================================================================|

> powercurve1
Power for predictor 'Object', (95% confidence interval),
by number of levels in ID:
     50: 100.0% (69.15, 100.0) - 10200 rows

Time elapsed: 0 h 4 m 31 s

Is this reproducible? If you run them one immediately after the other, with only nsim changed, does the same thing happen?

pitakakariki commented 3 years ago

table(naomit$ID) might be useful later too please.

ddscott2 commented 3 years ago

I ran them immediately after the other, this is what I got:

> powercurve <- powerCurve(SkillTwoWay2, fixed("Object"), along = "ID", breaks=c(50))
Calculating power at 1 sample sizes along ID
(1/1) Simulating: |==========            (1/1) Simulating: |============          (1/1) Simulating: |====================  (1/1) Simulating: |======================(1/1) Simulating: |======================(1/1) Simulating: |======================(1/1) Simulating: |======================(1/1) Simulating: |======================(1/1) Simulating: |===============================================================(1/1) Simulating: |======================(1/1) Simulating: |======================(1/1) Simulating: |======================(1/1) Simulating: |======================(1/1) Simulating: |======================(1/1) Simulating: |======================(1/1) Simulating: |======================(1/1) Simulating: |======================This appears to be an "observed power" calculation=======================================================================================|
> powercurve1 <- powerCurve(SkillTwoWay2, fixed("Object"), along = "ID", breaks=c(50), nsim = 10)
Calculating power at 1 sample sizes along ID
This appears to be an "observed power" calculation=======================================================================================|
> powercurve
Power for predictor 'Object', (95% confidence interval),
by number of levels in ID:
     50: 100.0% (99.63, 100.0) - 10200 rows

Time elapsed: 8 h 34 m 38 s
> powercurve1
Power for predictor 'Object', (95% confidence interval),
by number of levels in ID:
     50: 100.0% (69.15, 100.0) - 10200 rows

Time elapsed: 0 h 5 m 13 s

Here's what I get after running table(naomit$ID)

> table(naomit$ID)

0qajoaqo      100      101      102      103      104      106      107      108      109      111      112      113      114      115      116      117      118 
     200      200      200      200      200      200      200      200      200      200      200      200      200      200      400      200      200      200 
     119      120      121      122      123      124 1ia2528x 1nshvpsy 1rr3xfrc 1w9jcj6d 2vlt2v2n 469ikial 5cl2qh5d 6mprqjfs 72jrug5w 79r9ob8q 7rbd77vi 82f94y0r 
     200      200      200      200      200      200      200      200      200      200      200      200      200      200      200      200        0      200 
8embhxsq 8g8c8b0c 8o6zgmlr 8s46ki0d bpii6i6t bpx1s04c c1ihbqon d07miqx5 d3u0mv82 d4pzhzuv doujtcdp eqqowmki fd0ppmhk fhe60ywj fiw7o4le g4grw9v4 gu4pmqdo hqs5z3ny 
       0      200      200      200      200        0      200      200      200      200      200      200      200      200      200      200      200      200 
iee5otw5 irnf7ptw itembr31 iu23r0b8 iwg56hov j8arfng0 kz43a4li lmkj9lxu mgyg0zch ml05q0f1 mviyrtuh mzo5vci3 ne7fqm9r nubr18c2 o82g6766 ojnj4qff onxsdarj pt93mnno 
     200      200      200      200      200      200      200      200      200      200      200      200      200      200      200      200      200      200 
qhcpszrl qy6ihy95 rb1phxuq rtlxrm22 rzigt3jr saq3btyr sblyczt0 t2lpq7ym u3z3slfe vvwjon74 w15c8joa wpux51u5 yd0oewno yn36nefa yvmh7j75 ziedvces ziql5otu zmbmxdsx 
     200      200        0      200      200      200      200      200      200      200      200      200        0      200      200      200      200      200 
zqqewrvy zyux38sq 
     200      200 
pitakakariki commented 3 years ago

Looks like that's working now? Can you remember what you changed?

If you want to test for 100 or 125 participants you will probably need to use extend. You should be careful with your unbalanced data though, I would recommend removing ID 115 and running droplevels on your ID factor.

jrk1 commented 3 years ago

Hi, I have the same / very similar issue. I have a dataset were 150 participants rated 80 stimuli (Trials), which all differed on three variables (populistic: 0 or 1; false : 0 or 1; and cognitiveutility: 0 or 1). A trial can have all possible combinations on these three variables and data is balanced.

I have a pilot data set of about 150 participants that was sufficient observe effects of each factor:

model1 <- lmer(susceptibility ~ False + Populistic + CognitiveUtility + (1|Participant) + (1|Trial), datafile) summary(model1)

linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest'] Formula: susceptibility ~ False + Populistic + CognitiveUtility + (1 | Participant) + (1 | Trial) Data: datafile

REML criterion at convergence: 38771.8

Scaled residuals: Min 1Q Median 3Q Max -3.5929 -0.5980 -0.0350 0.5481 3.7207

Random effects: Groups Name Variance Std.Dev. Participant (Intercept) 1.13120 1.0636
Trial (Intercept) 0.09113 0.3019
Residual 1.22322 1.1060
Number of obs: 12466, groups: Participant, 156; Trial, 80

Fixed effects: Estimate Std. Error df t value Pr(>|t|)
(Intercept) 2.82633 0.11046 221.95525 25.587 < 2e-16 False1 -0.26731 0.07035 76.00739 -3.800 0.00029 Populistic1 -0.31432 0.07035 76.00739 -4.468 2.71e-05 CognitiveUtility1 0.59458 0.07035 76.00739 8.452 1.50e-12

Signif. codes: 0 ‘’ 0.001 ‘’ 0.01 ‘’ 0.05 ‘.’ 0.1 ‘ ’ 1

Correlation of Fixed Effects: (Intr) False1 Pplst1 False1 -0.318
Populistic1 -0.319 0.000
CgntvUtlty1 -0.319 0.000 0.000

So far so good. What I want to do next, is to test whether I can reduce the number of Trials, while still have sufficient power to observe one of the effects (False).

So I run the following code (low nsim as I am testing things out): p_curve_model <- powerCurve(model1, test = fixed("False"), along="Trial", breaks=c(10,20,30,40, 50,60,70,80), nsim = 20)

The problem is that I always get the following results where Power suddently goes from 0 to more when I reach 50 trials:

Power for predictor 'False', (95% confidence interval), by number of levels in Trial: 10: 0.00% ( 0.00, 16.84) - 1560 rows 20: 0.00% ( 0.00, 16.84) - 3120 rows 30: 0.00% ( 0.00, 16.84) - 4680 rows 40: 0.00% ( 0.00, 16.84) - 6240 rows 50: 60.00% (36.05, 80.88) - 7800 rows 60: 100.0% (83.16, 100.0) - 9360 rows 70: 100.0% (83.16, 100.0) - 10920 rows 80: 100.0% (83.16, 100.0) - 12480 rows

Time elapsed: 0 h 0 m 59 s

I also get the following error messages:

stage index                                                        message

1 Fitting 1 contrasts can be applied only to factors with 2 or more levels 2 Fitting 2 contrasts can be applied only to factors with 2 or more levels 3 Fitting 3 contrasts can be applied only to factors with 2 or more levels 4 Fitting 4 contrasts can be applied only to factors with 2 or more levels 5 Fitting 5 contrasts can be applied only to factors with 2 or more levels 6 Fitting 6 contrasts can be applied only to factors with 2 or more levels 7 Fitting 7 contrasts can be applied only to factors with 2 or more levels 8 Fitting 8 contrasts can be applied only to factors with 2 or more levels 9 Fitting 9 contrasts can be applied only to factors with 2 or more levels 10 Fitting 10 contrasts can be applied only to factors with 2 or more levels 11 Fitting 11 contrasts can be applied only to factors with 2 or more levels 12 Fitting 12 contrasts can be applied only to factors with 2 or more levels 13 Fitting 13 contrasts can be applied only to factors with 2 or more levels 14 Fitting 14 contrasts can be applied only to factors with 2 or more levels 15 Fitting 15 contrasts can be applied only to factors with 2 or more levels 16 Fitting 16 contrasts can be applied only to factors with 2 or more levels 17 Fitting 17 contrasts can be applied only to factors with 2 or more levels 18 Fitting 18 contrasts can be applied only to factors with 2 or more levels 19 Fitting 19 contrasts can be applied only to factors with 2 or more levels 20 Fitting 20 contrasts can be applied only to factors with 2 or more levels 21 Fitting 1 contrasts can be applied only to factors with 2 or more levels 22 Fitting 2 contrasts can be applied only to factors with 2 or more levels 23 Fitting 3 contrasts can be applied only to factors with 2 or more levels 24 Fitting 4 contrasts can be applied only to factors with 2 or more levels 25 Fitting 5 contrasts can be applied only to factors with 2 or more levels 26 Fitting 6 contrasts can be applied only to factors with 2 or more levels 27 Fitting 7 contrasts can be applied only to factors with 2 or more levels 28 Fitting 8 contrasts can be applied only to factors with 2 or more levels 29 Fitting 9 contrasts can be applied only to factors with 2 or more levels 30 Fitting 10 contrasts can be applied only to factors with 2 or more levels 31 Fitting 11 contrasts can be applied only to factors with 2 or more levels 32 Fitting 12 contrasts can be applied only to factors with 2 or more levels 33 Fitting 13 contrasts can be applied only to factors with 2 or more levels 34 Fitting 14 contrasts can be applied only to factors with 2 or more levels 35 Fitting 15 contrasts can be applied only to factors with 2 or more levels 36 Fitting 16 contrasts can be applied only to factors with 2 or more levels 37 Fitting 17 contrasts can be applied only to factors with 2 or more levels 38 Fitting 18 contrasts can be applied only to factors with 2 or more levels 39 Fitting 19 contrasts can be applied only to factors with 2 or more levels 40 Fitting 20 contrasts can be applied only to factors with 2 or more levels 41 Fitting 1 contrasts can be applied only to factors with 2 or more levels 42 Fitting 2 contrasts can be applied only to factors with 2 or more levels 43 Fitting 3 contrasts can be applied only to factors with 2 or more levels 44 Fitting 4 contrasts can be applied only to factors with 2 or more levels 45 Fitting 5 contrasts can be applied only to factors with 2 or more levels 46 Fitting 6 contrasts can be applied only to factors with 2 or more levels 47 Fitting 7 contrasts can be applied only to factors with 2 or more levels 48 Fitting 8 contrasts can be applied only to factors with 2 or more levels 49 Fitting 9 contrasts can be applied only to factors with 2 or more levels 50 Fitting 10 contrasts can be applied only to factors with 2 or more levels 51 Fitting 11 contrasts can be applied only to factors with 2 or more levels 52 Fitting 12 contrasts can be applied only to factors with 2 or more levels 53 Fitting 13 contrasts can be applied only to factors with 2 or more levels 54 Fitting 14 contrasts can be applied only to factors with 2 or more levels 55 Fitting 15 contrasts can be applied only to factors with 2 or more levels 56 Fitting 16 contrasts can be applied only to factors with 2 or more levels 57 Fitting 17 contrasts can be applied only to factors with 2 or more levels 58 Fitting 18 contrasts can be applied only to factors with 2 or more levels 59 Fitting 19 contrasts can be applied only to factors with 2 or more levels 60 Fitting 20 contrasts can be applied only to factors with 2 or more levels 61 Fitting 1 contrasts can be applied only to factors with 2 or more levels 62 Fitting 2 contrasts can be applied only to factors with 2 or more levels 63 Fitting 3 contrasts can be applied only to factors with 2 or more levels 64 Fitting 4 contrasts can be applied only to factors with 2 or more levels 65 Fitting 5 contrasts can be applied only to factors with 2 or more levels 66 Fitting 6 contrasts can be applied only to factors with 2 or more levels 67 Fitting 7 contrasts can be applied only to factors with 2 or more levels 68 Fitting 8 contrasts can be applied only to factors with 2 or more levels 69 Fitting 9 contrasts can be applied only to factors with 2 or more levels 70 Fitting 10 contrasts can be applied only to factors with 2 or more levels 71 Fitting 11 contrasts can be applied only to factors with 2 or more levels 72 Fitting 12 contrasts can be applied only to factors with 2 or more levels 73 Fitting 13 contrasts can be applied only to factors with 2 or more levels 74 Fitting 14 contrasts can be applied only to factors with 2 or more levels 75 Fitting 15 contrasts can be applied only to factors with 2 or more levels 76 Fitting 16 contrasts can be applied only to factors with 2 or more levels 77 Fitting 17 contrasts can be applied only to factors with 2 or more levels 78 Fitting 18 contrasts can be applied only to factors with 2 or more levels 79 Fitting 19 contrasts can be applied only to factors with 2 or more levels 80 Fitting 20 contrasts can be applied only to factors with 2 or more levels

I don't understand this, because there are no variables with less than 2 levels.

str(datafile$Trial) Factor w/ 80 levels "1","2","3","4",..: 1 2 3 4 5 6 7 8 9 10 ... str(datafile$Participant) Factor w/ 156 levels "1","3","4","6",..: 1 1 1 1 1 1 1 1 1 1 ... str(datafile$False) Factor w/ 2 levels "0","1": 2 2 2 2 2 2 2 2 2 2 ... str(datafile$Populistic) Factor w/ 2 levels "0","1": 2 2 2 2 2 2 2 2 2 2 ... str(datafile$CognitiveUtility) Factor w/ 2 levels "0","1": 2 2 2 2 2 2 2 2 2 2 ...

Any help would be highly appreciated!

jrk1 commented 3 years ago

I found the problem. Given the data structure, until Trial 40, one variable is constant (i.e., 1 level). I was assuming that each simulation draws a random sample from Trial, but that seems not to be the case.

jrk1 commented 3 years ago

If Trial level is = 40 for instance, it will only draw random samples (I assume with replacement) from the first 40 trials. I would wish a function that rather selects randomly 40 trials from the total 80 trials available.