ci.lc.mean.bs: Confidence interval for a linear contrast of means in a...

View source: R/statpsych1.R

ci.lc.mean.bsR Documentation

Confidence interval for a linear contrast of means in a between-subjects design

Description

Computes a test statistic and confidence interval for a linear contrast of means. This function computes both 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.lc.mean.bs(alpha, m, sd, n, v)

Arguments

alpha

alpha level for 1-alpha confidence

m

vector of estimated group means

sd

vector of estimated group standard deviations

n

vector of sample sizes

v

vector of betwen-subjects contrast coefficients

Value

Returns a 2-row matrix. The columns are:

  • Estimate - estimated linear contrast

  • 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

References

\insertRef

Snedecor1980statpsych

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)
v <- c(.5, .5, -.5, -.5)
ci.lc.mean.bs(.05, m, sd, n, v)

# Should return:
#                              Estimate       SE         t       df 
# Equal Variances Assumed:        -5.35 1.300136 -4.114955 36.00000 
# Equal Variances Not Assumed:    -5.35 1.300136 -4.114955 33.52169 
#                                         p         LL        UL
# Equal Variances Assumed:     0.0002152581  -7.986797 -2.713203
# Equal Variances Not Assumed: 0.0002372436  -7.993583 -2.706417



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