public class ANCOVAEx2 extends Object
Performs one-way analysis of covariance and tests for parallelism.
This example fits a one-way analysis of covariance model and performs a test for parallelism using data discussed by Snedecor and Cochran (1967, Table 14.8.1, pages 438-443). The responses are weight gains (in pounds per day) of 40 pigs for four groups of pigs under varying treatments. Two covariates-initial age (in days) and initial weight (in pounds) are used. For each treatment, there are 10 pigs. Only the first 5 pigs from each treatment are shown here.
Treatment 1 | Treatment 2 | Treatment 3 | Treatment 4 | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Age | Wt. | Gain | Age | Wt. | Gain | Age | Wt. | Gain | Age | Wt. | Gain |
78 | 61 | 1.4 | 78 | 74 | 1.61 | 78 | 80 | 1.67 | 77 | 62 | 1.4 |
90 | 59 | 1.79 | 99 | 75 | 1.31 | 83 | 61 | 1.41 | 71 | 55 | 1.47 |
94 | 76 | 1.72 | 80 | 64 | 1.12 | 79 | 62 | 1.73 | 78 | 62 | 1.37 |
71 | 50 | 1.47 | 75 | 48 | 1.35 | 70 | 47 | 1.23 | 70 | 43 | 1.15 |
99 | 61 | 1.26 | 94 | 62 | 1.29 | 85 | 59 | 1.49 | 95 | 57 | 1.22 |
For these data, the test for non-parallelism is not statistically significant (p = 0.901). The one-way analysis of covariance test for the treatment means adjusted for the covariates, assuming parallel slopes, is statistically significant at a stated significance level of \(\alpha = 0.05\), (p = 0.04931). Multiple comparisons can be done using the least significant difference approach of comparing each pair of treatment groups with the two-sample student-t test. Since the adjusted means in the one-way analysis of covariance are correlated, the standard error for these comparisons must be computed using the variances and covariances in covm. The standard errors for these comparisons are fairly similar ranging from 0.0630 to 0.0638. The Student's t comparisons identify differences between groups 1 and 2, and 1 and 4 as being statistically significant with p-values of 0.01225 and 0.03854 respectively.
Constructor and Description |
---|
ANCOVAEx2() |
public static void main(String[] args)
Copyright © 2020 Rogue Wave Software. All rights reserved.