Open FrVitale opened 9 months ago
It looks like Stim
is a factor, with three levels? If you try fixef(m_GO)["StimICF"] <- 1.2
instead that should work, although it will only change the coefficient for that level of the factor - I'd recommend thinking carefully about all 12 coefficients.
The errors in powerSim
probably come from the test specification. You can use doTest
to find one that works before running the simulations again. In this case you might want something like:
doTest(m_GO, fcompare(~ ToV * Pola, "kr"))
.
If that doesn't work head(pa$errors)
should give more information.
Thank you for your response. I did run again the simulation with the specified test: pa<-powerSim(m_GO, fixed("Stim","lr"), nsim=100)
And I receive the same error.
Running head(pa$errors), I receive this output, which I actually don't understand: stage index message 1 Testing 1 Test did not return a p-value 2 Testing 2 Test did not return a p-value 3 Testing 3 Test did not return a p-value 4 Testing 4 Test did not return a p-value 5 Testing 5 Test did not return a p-value 6 Testing 6 Test did not return a p-value
You could try one of these tests which should work.
doTest(m_GO, fcompare(~ ToV * Pola, "kr"))
doTest(m_GO, fixed("Stim", "anova"))
Be careful that you're using the test that's appropriate for you research question though - testing main effects when there are interactions is tricky.
Hi, I cannot achieve runnig a correct power analysis. When I was doing Power analysis, the result of Power was always 0%. I don't know where the problem is? Here is my code and results My model:
m_GO<-lmer(MEP ~ Stim*ToV*Pola +(1|Sujeto)+0, data = GO);
and this is the power analysis:
pa<-powerSim(m_GO, test=fixed("Stim"), nsim=100)
.And this is the output I get:
I tried to change the fixed effect of "Stim" with this code:
fixef(m_GO)["Stim"] <- 1.2
but I get such result:
Then i try this code, to see which are my fixed effect:
fixef(m_GO)
and here are the results:
How can I solve this problem?
Thank you!