ci.slope.mean.bs: Confidence interval for the slope of means in a single-factor...

View source: R/statpsych1.R

ci.slope.mean.bsR Documentation

Confidence interval for the slope of means in a single-factor design with a quantitative between-subjects factor

Description

Computes a test statistic and confidence interval for the slope of means in a single-factor 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.

Usage

ci.slope.mean.bs(alpha, m, sd, n, x)

Arguments

alpha

alpha level for 1-alpha confidence

m

vector of sample means

sd

vector of sample standard deviations

n

vector of sample sizes

x

vector of numeric predictor variable values

Value

Returns a 2-row matrix. The columns are:

  • Estimate - estimated slope

  • SE - standard error

  • t - t test statistic

  • df - degrees of freedom

  • p - p-value

  • LL - lower limit of the confidence interval

  • UL - upper limit of the confidence interval

Examples

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)

# 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



statpsych documentation built on July 9, 2023, 6:50 p.m.