In this model, the variables being used are as follows:
Y1 - Dependent Variable Y2 - Dependent Variable X - Covariate Variable GPS - Grouping Variable
We will be testing the hypothesis: H0: Joint mean 1 = Joint mean 2
It can be assumed that the observations are independent of one another.
We will be using the Multivariate Analysis of Covariance Model of: Yij(adj) = Yij - Bw (Xij -X)
In the descriptive statistics, you can see the mean for the dependent variables is higher for group 2 than group 1. However, the standard deviations for Group 1 are smaller than that of Group 2.
##
## Descriptive statistics by group
## group: 1
## vars n mean sd median trimmed mad min max range skew kurtosis se
## GPS* 1 15 1.00 0.00 1 1.00 0.00 1 1 0 NaN NaN 0.00
## X 2 15 10.67 2.02 11 10.69 1.48 7 14 7 -0.25 -1.17 0.52
## Y1 3 15 11.73 3.49 12 11.77 2.97 6 17 11 -0.50 -1.00 0.90
## Y2 4 15 5.80 3.51 6 5.69 4.45 1 12 11 0.16 -1.48 0.91
## ------------------------------------------------------------
## group: 2
## vars n mean sd median trimmed mad min max range skew kurtosis se
## GPS* 1 14 2.00 0.00 2.0 2.00 0.00 2 2 0 NaN NaN 0.00
## X 2 14 11.36 3.23 10.5 11.33 2.97 7 16 9 0.34 -1.51 0.86
## Y1 3 14 12.64 3.34 13.0 12.67 3.71 7 18 11 -0.11 -1.25 0.89
## Y2 4 14 7.29 5.33 5.0 6.92 2.97 1 18 17 0.84 -0.74 1.42
One assumption is that the dependent variables must be normally distributed. We find that the dependent variable Y1 is normally distributed with a p-value of .3795. However, Y2 is not normally distributed with a p-value of .0385.
##
## Jarque-Bera test for normality
##
## data: yy1
## JB = 1.1955, p-value = 0.366
##
## Jarque-Bera test for normality
##
## data: yy2
## JB = 4.6227, p-value = 0.054
The next assumption being tested is the assumption regarding correlation between teh variables. Y1 and Y2 have a high correlation while Y1 and X do not have high correlation, which can be seen in the p value.
##
## Pearson's product-moment correlation
##
## data: hw6$Y1 and hw6$Y2
## t = -0.12987, df = 27, p-value = 0.8976
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
## -0.3879392 0.3446760
## sample estimates:
## cor
## -0.02498606
##
## Pearson's product-moment correlation
##
## data: hw6$Y1 and hw6$X
## t = 2.7639, df = 27, p-value = 0.01016
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
## 0.1245335 0.7133365
## sample estimates:
## cor
## 0.4696054
##
## Pearson's product-moment correlation
##
## data: hw6$Y2 and hw6$X
## t = -1.1938, df = 27, p-value = 0.2429
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
## -0.5456415 0.1553394
## sample estimates:
## cor
## -0.2239144
We next test to see if the dependent variables are not impacted by the grouping variable. Y1 in the first boxplot is not impacted by the group, however, Y2 shows signifcantly different means and spreads.
In this next assumption, we are looking for any interaction between the concommitant variable and the grouping variable. We can see using the Wilks, Pillai, Hotelling, and Roy tests that there is no interaction.
## Df Wilks approx F num Df den Df Pr(>F)
## GPS 1 0.95079 0.6211 2 24 0.54578
## X 1 0.73514 4.3234 2 24 0.02491 *
## GPS:X 1 0.99517 0.0583 2 24 0.94354
## Residuals 25
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## Df Pillai approx F num Df den Df Pr(>F)
## GPS 1 0.049209 0.6211 2 24 0.54578
## X 1 0.264858 4.3234 2 24 0.02491 *
## GPS:X 1 0.004831 0.0583 2 24 0.94354
## Residuals 25
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## Df Hotelling-Lawley approx F num Df den Df Pr(>F)
## GPS 1 0.05176 0.6211 2 24 0.54578
## X 1 0.36028 4.3234 2 24 0.02491 *
## GPS:X 1 0.00485 0.0583 2 24 0.94354
## Residuals 25
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## Df Roy approx F num Df den Df Pr(>F)
## GPS 1 0.05176 0.6211 2 24 0.54578
## X 1 0.36028 4.3234 2 24 0.02491 *
## GPS:X 1 0.00485 0.0583 2 24 0.94354
## Residuals 25
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
The Box M test shows that the multivariate samples are similar. The P-value of .267 reflects the homogeniety of the covariance matrices.
## $Chisq
## [1] 3.950713
##
## $df
## [1] 3
##
## $p.value
## [1] 0.2668357
##
## $Test
## [1] "BoxM"
##
## attr(,"class")
## [1] "MVTests" "list"
Because the interaction term, GPS:X, is significantly correlated, we are able to conduct the analysis.
## Df Wilks approx F num Df den Df Pr(>F)
## GPS 1 0.95079 0.6211 2 24 0.54578
## X 1 0.73514 4.3234 2 24 0.02491 *
## GPS:X 1 0.99517 0.0583 2 24 0.94354
## Residuals 25
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
The analysis shows that the covariant variable is significant for the first group.
## [1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2
## Levels: 1 2
## Df Sum Sq Mean Sq F value Pr(>F)
## X 1 71.04 71.04 7.409 0.0114 *
## GPS 1 1.80 1.80 0.187 0.6686
## Residuals 26 249.30 9.59
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## GPS effect
## GPS
## 1 2
## 11.92974 12.43242
##
## Lower 95 Percent Confidence Limits
## GPS
## 1 2
## 10.27921 10.72344
##
## Upper 95 Percent Confidence Limits
## GPS
## 1 2
## 13.58027 14.14141
## [1] 0.8029711 0.8314088
The second analysis shows that the second group is not significant.
## [1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2
## Levels: 1 2
## Df Sum Sq Mean Sq F value Pr(>F)
## X 1 27.9 27.94 1.433 0.242
## GPS 1 22.5 22.48 1.153 0.293
## Residuals 26 506.8 19.49
##
## GPS effect
## GPS
## 1 2
## 5.659033 7.436750
##
## Lower 95 Percent Confidence Limits
## GPS
## 1 2
## 3.305663 5.000035
##
## Upper 95 Percent Confidence Limits
## GPS
## 1 2
## 8.012403 9.873466
## [1] 1.144897 1.185444
Not sure what happened with the lines, but they’re supposed to show as not parallel.