My goal is to calculate the power to detect both a hypothetical future 30% increase and decrease in a proportion (call it 0.5, for example. +/-30% would be = 0.65 and 0.35, respectively), but I'm not sure if I need to formulate this into a single two-tailed test or if 2 one-tailed tests is ok (with an adjusted alpha=0.025). Running two tests doesn't seem appropriate, but running 1 test doesn't seem feasible (can't get it to handle all the info.). I'm using a one-sample test because it's a repeated measure design (same 47 locations of data collection). Also, I thought I had this figured out, but both "greater" and "not equal" or "less" and "not equal" seem like the same option: i.e. what power do I have to notice that +30% is "greater" or "not equal" to my original proportion (0.5)(?)
library(pwrss)
# 2 one-tailed tests:
pwrss.z.prop(p=0.5, p0 = 0.65,
arcsin.trans = TRUE, alpha = 0.05,
alternative = "greater", # or "not equal"?
n = 47, power = NULL)
pwrss.z.prop(p=0.5, p0 = 0.35,
arcsin.trans = TRUE,
alpha = 0.05,
alternative = "less", # or "not equal"?
n = 47, power = NULL)
This is the single two-tailed test, but is it asking "what's the power to detect a difference BETWEEN -30% and +30% change" or "what's the power to detect a -30% AND a +30% change from 0.5"? Given the high power from such a small sample size, I'd say the former is true (almost 100% we can tell the difference between a 30% decline and a 30% increase) - but this is not what I'm aiming for...so I'm stuck.
#1 two-tailed tests:
pwrss.z.prop(p=0.65, p0 = 0.35,
arcsin.trans = TRUE,
alpha = 0.05,
alternative = "not equal",
n = 47, power = NULL)
Approach: Arcsine Transformation
A Proportion against a Constant (z Test)
H0: p = p0
HA: p != p0
------------------------------
Statistical power = 0.987
n = 47
------------------------------
Alternative = “not equal”
Non-centrality parameter = 4.178
Type I error rate = 0.05
Type II error rate = 0.013
UPDATE:
Also, it appears the order in which each proportions is entered first matters, but it's not clear to me from the documentation (page 41) which is which: "p=expected proportion and p0=constant to be compared (a proportion)".