## Sample size for alpha = 0.05, 90% power, assuming true effect prop1 = prop 2 = 0.5,
## equivalence bounds of 0.4 and 0.6 (so low_eqbound_prop = -0.1 and high_eqbound_prop = 0.1)
#powerTOSTtwo.prop(alpha = 0.05, statistical_power = 0.9, prop1 = 0.5, prop2 = 0.5,
# low_eqbound_prop = -0.1, high_eqbound_prop = 0.1)
power_twoprop(alpha = 0.05, power = 0.9, p1 = 0.5, p2 = 0.5,
null = 0.1, alternative = "e")
## Power for alpha = 0.05, N 542 , assuming true effect prop1 = prop 2 = 0.5,
## equivalence bounds of 0.4 and 0.6 (so low_eqbound_prop = -0.1 and high_eqbound_prop = 0.1)
#powerTOSTtwo.prop(alpha = 0.05, N = 542, prop1 = 0.5, prop2 = 0.5,
# low_eqbound_prop = -0.1, high_eqbound_prop = 0.1)
power_twoprop(alpha = 0.05, n = 542, p1 = 0.5, p2 = 0.5,
null = 0.1, alternative = "e")
#Example 4.2.4 from Chow, Wang, & Shao (2007, p. 93)
#powerTOSTtwo.prop(alpha=0.05, statistical_power=0.8, prop1 = 0.75, prop2 = 0.8,
# low_eqbound_prop = -0.2, high_eqbound_prop = 0.2)
power_twoprop(alpha = 0.05, power = 0.8, p1 = 0.75, p2 = 0.8,
null = 0.2, alternative = "e")
# Example 5 from Julious & Campbell (2012, p. 2932)
#powerTOSTtwo.prop(alpha=0.025, statistical_power=0.9, prop1 = 0.8, prop2 = 0.8,
# low_eqbound_prop=-0.1, high_eqbound_prop=0.1)
power_twoprop(alpha = 0.025, power = 0.9, p1 = 0.8, p2 = 0.8,
null = 0.1, alternative = "e")
# From Machin, D. (Ed.). (2008). Sample size tables for clinical studies (3rd ed).
# Example 9.4b equivalence of two proportions (p. 113) #
# powerTOSTtwo.prop(alpha=0.010, statistical_power=0.8, prop1 = 0.5, prop2 = 0.5,
# low_eqbound_prop = -0.2, high_eqbound_prop = 0.2)/2
power_twoprop(alpha = 0.01, power = 0.8, p1 = 0.5, p2 = 0.5,
null = 0.2, alternative = "e")
Run the code above in your browser using DataLab