simr
simr copied to clipboard
cannot use powerSim/doTest when p-values in coefficient results are not labelled "Pr(>|z|)"
Hi there,
I've fitted a model using geem2, and it outputs the p-values in the coefficients table as simply "p", not "Pr(>|z|)". This results in an error as powerSim/doTest only reads p-values when the label is "Pr(>|z|)". Is there any way I can work around this/respecify a[xname, "Pr(>|z|)"] such that the subscript is no longer out of bounds?
Thank you so much for your time!
doTest(geem3, test = fixed(xname = "aglcenXorder01", method = "z")) Error in a[xname, "Pr(>|z|)"] : subscript out of bounds
simr doesn't support models outside of lm/glm/lmer/glmer yet, so I recommend treating any results with caution, even if it appears to work.
You can supply a function as the test
argument, so you could try something like:
f <- function(fit) summary(fit)$coefficients["aglcanXorder01", "p"]
The function will need to take your model as an argument and return a p-value.