R/statpsych1.R
pi.score2.Rd
For a 2-group experimental design, this function computes a prediction interval for how the response variable score for one randomly selected person from the study population would differ under the two treatment conditions. Both equal variance and unequal variance prediction intervals are computed.
pi.score2(alpha, m1, m2, sd1, sd2, n1, n2)
alpha level for 1-alpha confidence
estaimted mean for group 1
estimated mean for group 1
estimated standard deviation for group 1
estimated standard deviation for group 2
sample size for group 1
sample size for group 2
Returns a 2-row matrix. The columns are:
Predicted - predicted difference in scores
df - degrees of freedom
LL - lower limit of the prediction interval
UL - upper limit of the prediction interval
Hahn GJ (1977). “A prediction interval on the difference between two future sample means and its application to a claim of product superiority.” Technometrics, 19(2), 131--134. ISSN 0040-1706, doi:10.1080/00401706.1977.10489520 .
pi.score2(.05, 29.57, 18.35, 2.68, 1.92, 40, 45)
#> Predicted df LL UL
#> Equal Variances Assumed: 11.22 83.00000 4.650454 17.78955
#> Equal Variances Not Assumed: 11.22 72.34319 4.603642 17.83636
# Should return:
# Predicted df LL UL
# Equal Variances Assumed: 11.22 83.00000 4.650454 17.78955
# Equal Variances Not Assumed: 11.22 72.34319 4.603642 17.83636