ci.c.ancova: Confidence interval for an (unstandardized) contrast in...

View source: R/ci.c.ancova.R

ci.c.ancovaR Documentation

Confidence interval for an (unstandardized) contrast in ANCOVA with one covariate

Description

To calculate the confidence interval for an unstandardized contrast in the one-covariate ANCOVA.

Usage

ci.c.ancova(Psi, adj.means, s.ancova = NULL, c.weights, n,
cov.means, SSwithin.x, conf.level = 0.95, ...)

Arguments

Psi

the unstandardized contrast of adjusted means

adj.means

the vector that contains the adjusted mean of each group on the dependent variable

s.ancova

the standard deviation of the errors from the ANCOVA model (i.e., the square root of the mean square error from ANCOVA)

c.weights

the contrast weights

n

either a single number that indicates the sample size per group or a vector that contains the sample size of each group

cov.means

a vector that contains the group means of the covariate

SSwithin.x

the sum of squares within groups obtained from the summary table for ANOVA on the covariate

conf.level

the desired confidence interval coverage, (i.e., 1 - Type I error rate)

...

allows one to potentially include parameter values for inner functions

Value

lower.limit

the lower confidence limit of the (unstandardized) ANCOVA contrast

upper.limit

the upper confidence limit of the (unstandardized) ANCOVA contrast

Note

Be sure to use the standard deviation and not the error variance for s.ancova, not the square of this value which would come from the source table (i.e., do not use the variance of the error but rather use the square root).

If n receives a single number, that number is considered as the sample size per group. If n receives a vector, the vector is considered as the sample size of each group.

Be sure to use fractions not the integers to specify c.weights. For example, in an ANCOVA of four groups, if the user wants to compare the mean of group 1 and 2 with the mean of group 3 and 4, c.weights should be specified as c(0.5, 0.5, -0.5, -0.5) rather than c(1, 1, -1, -1). Make sure the sum of the contrast weights are zero.

Author(s)

Keke Lai (University of California–Merced) and Ken Kelley (University of Notre Dame; kkelley@nd.edu)

References

Kelley, K. (2007). Constructing confidence intervals for standardized effect sizes: Theory, application, and implementation. Journal of Statistical Software, 20 (8), 1–24.

Maxwell, S. E., & Delaney, H. D. (2004). Designing experiments and analyzing data: A model comparison perspective. Mahwah, NJ: Erlbaum.

See Also

ci.c, ci.sc.ancova

Examples

# Maxwell & Delaney (2004, pp. 428-468) offer an example that 30 depressive 
# individuals are randomly assigned to three groups, 10 in each, and ANCOVA 
# is performed on the posttest scores using the participants' pretest 
# scores as the covariate. The means of pretest scores of group 1 to 3 are 
# 17, 17.7, and 17.4, respectively, and the adjusted means of groups 1 to 3 
# are 7.5, 12, and 14, respectively. The error variance in ANCOVA is 29, 
# and the sum of squares within groups from ANOVA on the covariate is 
# 313.37. 

# To obtain the confidence interval for adjusted mean of group 1 versus 
# group 2:
ci.c.ancova(adj.means=c(7.5, 12, 14), s.ancova=sqrt(29), c.weights=c(1, -1, 0), 
n=10, cov.means=c(17, 17.7, 17.4), SSwithin.x=313.37)

MBESS documentation built on Oct. 26, 2023, 9:07 a.m.