R/statpsych1.R
ci.slope.mean.bs.Rd
Computes a test statistic and confidence interval for the slope of means in a one-factor experimental design with a quantitative between-subjects factor. This function computes both the unequal variance and equal variance confidence intervals and test statistics. A Satterthwaite adjustment to the degrees of freedom is used with the unequal variance method.
ci.slope.mean.bs(alpha, m, sd, n, x)
alpha level for 1-alpha confidence
vector of sample means
vector of sample standard deviations
vector of sample sizes
vector of numeric predictor variable values
Returns a 2-row matrix. The columns are:
Estimate - estimated slope
SE - standard error
t - t test statistic
df - degrees of freedom
p - two-sided p-value
LL - lower limit of the confidence interval
UL - upper limit of the confidence interval
m <- c(33.5, 37.9, 38.0, 44.1)
sd <- c(3.84, 3.84, 3.65, 4.98)
n <- c(10,10,10,10)
x <- c(5, 10, 20, 30)
ci.slope.mean.bs(.05, m, sd, n, x)
#> Estimate SE t df
#> Equal Variances Assumed: 0.3664407 0.06770529 5.412290 36.00000
#> Equal Variances Not Assumed: 0.3664407 0.07336289 4.994905 18.65826
#> p LL UL
#> Equal Variances Assumed: 4.242080e-06 0.2291280 0.5037534
#> Equal Variances Not Assumed: 8.468223e-05 0.2126998 0.5201815
# Should return:
# Estimate SE t df
# Equal Variances Assumed: 0.3664407 0.06770529 5.412290 36.00000
# Equal Variances Not Assumed: 0.3664407 0.07336289 4.994905 18.65826
# p LL UL
# Equal Variances Assumed: 4.242080e-06 0.2291280 0.5037534
# Equal Variances Not Assumed: 8.468223e-05 0.2126998 0.5201815