ht_onesample_zpower(m, n, std, alpha, tm, type)

Returns the power for a normal sample with mean m, standard deviation std, and size n. The significance level is alpha and the true mean is tm. Parameter type can be 0 (left tail), 1 (right tail), or 2 (both tails).


See also ht_onesample_pro ht_onesample_z ht_onesample_std 


Example


(See NOTE below)


ht_onesample_zpower(26, 30, 1.4, .05, 25, 0)

0.9883


ht_onesample_zpower(26, 30, 1.4, .05, 25.8, 0)

0.1942


You may build a function that returns the power as a function of the true mean. To show how the power is influenced by the sample size, two power functions are built below, one for n=30 and the other for n=100. A plot of of the functions is also shown.


p30(x)=ht_onesample_zpower(26, 30, 1.4, .05, x, 0)

p30(x)=ht_onesample_zpower(26, 30, 1.4, .05, x, 0)

p100(x)=ht_onesample_zpower(26, 100, 1.4, .05, x, 0)

p100(x)=ht_onesample_zpower(26, 100, 1.4, .05, x, 0)


plot(p30, 24.8, 26, 50)

plot(p100, 24.8, 26, 50, "red")

 




NOTE: The data used in this example was taken from the textbook Introductory Statistics 6th Ed. by Neil A. Weiss with kind permission of Addison Wesly Longman, Inc. (AWL). AWL does not endorse nor it supports the Calcugator.