Bivariate Analysis
Variable 1 2 LEVELS >2 LEVELS CONTINUOUS Variable 2 2 LEVELS X2 X2 t-test chi square test chi square test
>2 LEVELS X2 X2 ANOVA chi square test chi square test (F-test) CONTINUOUS t-test ANOVA -Correlation (F-test) -Simple linear Regression
Comparison of means: F-test
Example 1: Research question: Among university students, is the average weight of students in university “A” different than that in university “B” and that in university “C”? Is there an association between weight and type of university?
Ho : Average weight A = Average weight B = Average weight C Ha : At least two averages are different
Statistical test: F-test = (Analysis of Variance)= ANOVA
Comparison of means: F-test
One way F-Test (SPSS output): Example 1
Descriptives weight 95% Confidence Interval for Mean N Mean Std. Deviation Std. Error Lower Bound Upper Bound Minimum Maximum A 290 65.59 13.297 .781 64.06 67.13 41 125 B 1340 63.46 14.201 .388 62.70 64.22 39 135 C 345 67.74 15.299 .824 66.12 69.36 42 115 Total 1975 64.52 14.360 .323 63.89 65.15 39 135
ANOVA
weight Sum of Squares df Mean Square F Sig. Between Groups 5414.963 2 2707.482 13.293 .000 Within Groups 401651.5 1972 203.677 Total 407066.5 1974 Comparison of means: F-test
This is the p-value for the F-test (testing of the null hypothesis of whether the mean of weight for A = mean of weight for B = mean of weight for C).
If this p-value is > 0.05 then accept null hypothesis and conclude that the means of the 3 groups are equal.
If the p-value is < 0.05 then reject null hypothesis (accept the alternative) and conclude that at least two means are different.
ANOVA
weight Sum of Squares df Mean Square F Sig. Between Groups 5414.963 2 2707.482 13.293 .000 Within Groups 401651.5 1972 203.677 Total 407066.5 1974
Comparison of means: F-test
ANOVA
weight Sum of Squares df Mean Square F Sig. Between Groups 5414.963 2 2707.482 13.293 .000 Within Groups 401651.5 1972 203.677 Total 407066.5 1974
Since p-value is < 0.05 then reject null hypothesis (accept the alternative) and conclude that at least two means are different.
BUT which of the means are different???
Comparison of means: F-test
If we want to know exactly what 2 means are different: need to ask for Post Hoc Test
Post Hoc Tests
Multiple Comparisons
Dependent Variable: weight Bonferroni
Mean Difference 95% Confidence Interval (I) university (J) university (I-J) Std. Error Sig. Lower Bound Upper Bound A B 2.135 .924 .063 -.08 4.35 C -2.144 1.137 .178 -4.87 .58 B A -2.135 .924 .063 -4.35 .08 C -4.279* .862 .000 -6.34 -2.21 C A 2.144 1.137 .178 -.58 4.87 B 4.279* .862 .000 2.21 6.34 *. The mean difference is significant at the .05 level. Comparison of means: F-test
A p-value < 0.05 (*) identifies significance between 2 groups: In this example differences in average of weight are between B and C. Post Hoc Tests
Multiple Comparisons
Dependent Variable: weight Bonferroni
Mean Difference 95% Confidence Interval (I) university (J) university (I-J) Std. Error Sig. Lower Bound Upper Bound A B 2.135 .924 .063 -.08 4.35 C -2.144 1.137 .178 -4.87 .58 B A -2.135 .924 .063 -4.35 .08 C -4.279* .862 .000 -6.34 -2.21 C A 2.144 1.137 .178 -.58 4.87 B 4.279* .862 .000 2.21 6.34 *. The mean difference is significant at the .05 level.
Comparison of means: F-test
Example 1:
Research question: Is there an association between weight and type of university?
Ho : Average weight A = Average weight B = Average weight C
Ha : At least two averages are different
Statistical test: F-test = 13.293; p<0.05
Conclusion: There is a significant relationship between weight and type of university. Based on the post Hoc test, differences in average of weight are between B and C.
Comparison of means: F-test
One way F-Test (SPSS output): Example 2
Descriptives height 95% Confidence Interval for Mean N Mean Std. Deviation Std. Error Lower Bound Upper Bound Minimum Maximum A 291 170.63 12.197 .715 169.22 172.03 72 194 B 1339 169.47 9.446 .258 168.96 169.97 58 202 C 341 171.80 9.336 .506 170.80 172.79 150 201 Total 1971 170.04 9.917 .223 169.60 170.48 58 202
ANOVA
height Sum of Squares df Mean Square F Sig. Between Groups 1589.713 2 794.856 8.140 .000 Within Groups 192172.9 1968 97.649 Total 193762.6 1970 Comparison of means: F-test
Post Hoc Tests (SPSS output): Example 2
Multiple Comparisons
Dependent Variable: height Bonferroni
Mean Difference 95% Confidence Interval (I) university (J) university (I-J) Std. Error Sig. Lower Bound Upper Bound A B 1.158 .639 .211 -.37 2.69 C -1.171 .789 .413 -3.06 .72 B A -1.158 .639 .211 -2.69 .37 C -2.328* .599 .000 -3.76 -.89 C A 1.171 .789 .413 -.72 3.06 B 2.328* .599 .000 .89 3.76 *. The mean difference is significant at the .05 level.
Comparison of means: F-test
One way F-Test (SPSS output): Example 2
Descriptives height 95% Confidence Interval for Mean N Mean Std. Deviation Std. Error Lower Bound Upper Bound Minimum Maximum A 291 170.63 12.197 .715 169.22 172.03 72 194 B 1339 169.47 9.446 .258 168.96 169.97 58 202 C 341 171.80 9.336 .506 170.80 172.79 150 201 Total 1971 170.04 9.917 .223 169.60 170.48 58 202
Research question: Is there an association between height and type of university?
Comparison of means: F-test
One way F-Test (SPSS output): Example 2
Descriptives height 95% Confidence Interval for Mean N Mean Std. Deviation Std. Error Lower Bound Upper Bound Minimum Maximum A 291 170.63 12.197 .715 169.22 172.03 72 194 B 1339 169.47 9.446 .258 168.96 169.97 58 202 C 341 171.80 9.336 .506 170.80 172.79 150 201 Total 1971 170.04 9.917 .223 169.60 170.48 58 202
Ho: Average height A = Average height B = Average height C
Ha: At least two averages are different Comparison of means: F-test
One way F-Test (SPSS output): Example 2
ANOVA height Sum of Squares df Mean Square F Sig. Between Groups 1589.713 2 794.856 8.140 .000 Within Groups 192172.9 1968 97.649 Total 193762.6 1970
Value of statistical test: 8.140
P-value: 0.000
Comparison of means: F-test
One way F-Test (SPSS output): Example 2
Multiple Comparisons
Dependent Variable: height Bonferroni
Mean Difference 95% Confidence Interval (I) university (J) university (I-J) Std. Error Sig. Lower Bound Upper Bound A B 1.158 .639 .211 -.37 2.69 C -1.171 .789 .413 -3.06 .72 B A -1.158 .639 .211 -2.69 .37 C -2.328* .599 .000 -3.76 -.89 C A 1.171 .789 .413 -.72 3.06 B 2.328* .599 .000 .89 3.76 *. The mean difference is significant at the .05 level.
There is a difference in average of height between B and C.
Comparison of means: F-test
One way F-Test (SPSS output): Example 2
ANOVA height Sum of Squares df Mean Square F Sig. Between Groups 1589.713 2 794.856 8.140 .000 Within Groups 192172.9 1968 97.649 Total 193762.6 1970
Conclusion: There is a significant relationship between height and type of university. Based on the post Hoc test, differences in average of height are between B and C. SPSS commands for F-test
Example 1 Analyze Compare Means
One way ANOVA select weight as the dependent variable select university as the factor
Go to options- chose descriptive statistics
Go to Post Hoc- Select Bonferroni for equal variance assumed
SPSS commands for F-test
Example 2 Analyze Compare Means
One way ANOVA select height as the dependent variable select university as the factor
Go to options- chose descriptive statistics
Go to Post Hoc- Select Bonferroni for equal variance assumed
T-TEST: CI VS. P-VALUE Hypothesis Testing (P-Value) & Confidence Interval (CI)
In hypothesis testing (p-value): Decision of whether to accept or not the null hypothesis
In confidence interval: Estimation of the parameter Decision of whether to accept or not the null hypothesis
P-value & Confidence interval
Example 1: T-test
Group Statistics
Std. Error gender N Mean Std. Deviation Mean weight male 804 75.92 12.843 .453 female 1135 56.47 8.923 .265
Independent Samples Test
Levene's Test for Equality of Variances t-test for Equality of Means 95% Confidence Interval of the Mean Std. Error Difference F Sig. t df Sig. (2-tailed) Difference Difference Lower Upper weight Equal variances 132.258 .000 39.337 1937 .000 19.444 .494 18.475 20.414 assumed Equal variances 37.059 1335.508 .000 19.444 .525 18.415 20.473 not assumed
CI: Estimation of the parameter
Example 1: T-test
Independent Samples Test
Levene's Test for Equality of Variances t-test for Equality of Means 95% Confidence Interval of the Mean Std. Error Difference F Sig. t df Sig. (2-tailed) Difference Difference Lower Upper weight Equal variances 132.258 .000 39.337 1937 .000 19.444 .494 18.475 20.414 assumed Equal variances 37.059 1335.508 .000 19.444 .525 18.415 20.473 not assumed Confidence Interval: Estimation of the parameter is determining the difference in the means of weight for males & females, in the population.
Interpretation of 95% Confidence Interval: Difference in the means of the two samples in this example is 19.4; In the population, we are 95% confident that the difference in the means of weight for males and females is between 18.4 & 20.5. CI: Decision on null hypothesis
Example 1: T-test
Independent Samples Test
Levene's Test for Equality of Variances t-test for Equality of Means 95% Confidence Interval of the Mean Std. Error Difference F Sig. t df Sig. (2-tailed) Difference Difference Lower Upper weight Equal variances 132.258 .000 39.337 1937 .000 19.444 .494 18.475 20.414 assumed Equal variances 37.059 1335.508 .000 19.444 .525 18.415 20.473 not assumed
Confidence Interval: Decision of whether to accept or not the null hypothesis. If the CI includes the value of the null hypothesis then accept null hypothesis If the CI does not include the value of the null hypothesis then, reject the null hypothesis & accept the alternative.
CI: Decision on null hypothesis
Ho : μ males = μ females μ males - μ females = 0
Ha : μ males ≠ μ females μ males - μ females ≠ 0
IF the confidence interval includes zero (for this example) then accept null hypothesis. IF the confidence interval does not include zero, then, reject the null hypothesis and accept the alternative.
CI: Decision on null hypothesis
Example 1: T-test
Independent Samples Test
Levene's Test for Equality of Variances t-test for Equality of Means 95% Confidence Interval of the Mean Std. Error Difference F Sig. t df Sig. (2-tailed) Difference Difference Lower Upper weight Equal variances 132.258 .000 39.337 1937 .000 19.444 .494 18.475 20.414 assumed Equal variances 37.059 1335.508 .000 19.444 .525 18.415 20.473 not assumed
Decision of whether to accept or not the null hypothesis:
The 95% CI = 18.4 - 20.5; does not include zero; hence reject the null hypothesis and accept the alternative. CI: Decision on null hypothesis
Example 2: T-test By looking at the 95% CI; would your decision be to accept or reject the null hypothesis? Explain.
Group Statistics
Std. Error gradf N Mean Std. Deviation Mean weight undergraduate 1703 64.34 14.473 .351 graduate 248 65.62 13.517 .858
Independent Samples Test
Levene's Test for Equality of Variances t-test for Equality of Means 95% Confidence Interval of the Mean Std. Error Difference F Sig. t df Sig. (2-tailed) Difference Difference Lower Upper weight Equal variances .130 .718 -1.315 1949 .189 -1.283 .976 -3.197 .630 assumed Equal variances -1.384 335.007 .167 -1.283 .927 -3.107 .540 not assumed
CI: Decision on null hypothesis
Example 2: T-test By looking at the 95% CI; would your decision be to accept or reject the null hypothesis? Explain.
Independent Samples Test
Levene's Test for Equality of Variances t-test for Equality of Means 95% Confidence Interval of the Mean Std. Error Difference F Sig. t df Sig. (2-tailed) Difference Difference Lower Upper weight Equal variances .130 .718 -1.315 1949 .189 -1.283 .976 -3.197 .630 assumed Equal variances -1.384 335.007 .167 -1.283 .927 -3.107 .540 not assumed
The 95% CI = -3.197 – 0.630; It does include zero; hence accept the null hypothesis.