T-TEST Outline Hypothesis Testing Steps Bivariate Analysis
Total Page:16
File Type:pdf, Size:1020Kb
Bivariate Analysis T-TEST 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 Outline Comparison of means: t-test Hypothesis testing steps T-test is used when one variable is of a continuous nature and the other is dichotomous. T-test The t-test is used to compare the means of two groups on a given variable. Anova Examples: Difference in average blood pressure among males & females. Difference in average BMI among those who exercise and those who do not. Hypothesis testing steps Comparison of means: t-test Example 1: Identify the study objective Research question: Among university students, is there a State the null & alternative hypothesis difference between the average weight for males versus females? Select the proper test statistic Null hypothesis (Ho): μ weight males = μ weight females Calculate the test statistic Alternative hypothesis (Ha): μ weight males ≠ μ weight females Take a statistical decision based on the p-value. Statistical test: t-test Reject or accept the null hypothesis Comparison of means: t-test Comparison of means: t-test T-Test (SPSS output) If this p-value is < 0.05 then reject null hypothesis and conclude that the variances are different (accept alternative) Group Statistics and hence check this p-value for the t-test. Std. Error gender N Mean Std. Deviation Mean weight male 804 75.92 12.843 .453 If this p-value is > 0.05 then accept null hypothesis and female 1135 56.47 8.923 .265 conclude that the variances are equal and hence check this p-value for the t-test. Independent Samples Test Levene's Test for Independent Samples Test Equality of Variances t-test for Equality of Means Levene's Test for 95% Confidence Equality of Variances t-test for Equality of Means Interval of the 95% Confidence Mean Std. Error Difference Interval of the F Sig. t df Sig. (2-tailed) Difference Difference Lower Upper Mean Std. Error Difference weight Equal variances F Sig. t df Sig. (2-tailed) Difference Difference Lower Upper 132.258 .000 39.337 1937 .000 19.444 .494 18.475 20.414 weight Equal variances assumed 132.258 .000 39.337 1937 .000 19.444 .494 18.475 20.414 assumed Equal variances Equal variances 37.059 1335.508 .000 19.444 .525 18.415 20.473 37.059 1335.508 .000 19.444 .525 18.415 20.473 not assumed not assumed Comparison of means: t-test Comparison of means: t-test This is the p-value for the t-test (of whether the mean of Example 1: weight for males = mean of weight for females -- in the population). Research question: Among university students, is there a difference between the average weight for males versus Need to chose either the upper or the lower value to conclude females? whether there is a significant difference in weight between 2 groups. The choice is done based on the test of whether Ho : μ weight males = μ weight females variances of the 2 groups are assumed equal or not. Ha : μ weight males ≠ μ weight females Statistical test: t-test Independent Samples Test t-test= 37.059 P=0.000 Levene's Test for Equality of Variances t-test for Equality of Means 95% Confidence Interval of the Conclusion: At significance level of 0.05, we reject null Mean Std. Error Difference hypothesis and conclude that in the population there is a F Sig. t df Sig. (2-tailed) Difference Difference Lower Upper significant difference in the average weight of males & females. 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 Comparison of means: t-test Comparison of means: t-test T-Test (SPSS output): Example 2 This is the p-value that tests whether the variances are equal or not. Group Statistics Std. Error gradf N Mean Std. Deviation Mean Ho : variance of weight males = variance of weight females weight undergraduate 1703 64.34 14.473 .351 Ha : variance of weight males ≠ variance of weight females graduate 248 65.62 13.517 .858 Independent Samples Test Independent Samples Test Levene's Test for Equality of Variances t-test for Equality of Means Levene's Test for 95% Confidence Equality of Variances t-test for Equality of Means Interval of the 95% Confidence Mean Std. Error Difference Interval of the F Sig. t df Sig. (2-tailed) Difference Difference Lower Upper weight Equal variances Mean Std. Error Difference .130 .718 -1.315 1949 .189 -1.283 .976 -3.197 .630 assumed F Sig. t df Sig. (2-tailed) Difference Difference Lower Upper Equal variances weight Equal variances -1.384 335.007 .167 -1.283 .927 -3.107 .540 132.258 .000 39.337 1937 .000 19.444 .494 18.475 20.414 not assumed assumed Equal variances 37.059 1335.508 .000 19.444 .525 18.415 20.473 not assumed Comparison of means: t-test Comparison of means: t-test T-Test (SPSS output): Example 2 T-Test (SPSS output): Example 2 Group Statistics Independent Samples Test Std. Error Levene's Test for gradf N Mean Std. Deviation Mean Equality of Variances t-test for Equality of Means weight undergraduate 1703 64.34 14.473 .351 95% Confidence Interval of the graduate 248 65.62 13.517 .858 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 Research question: Is there a difference between the not assumed average weight for undergraduate versus graduate students? Conclusion: At significance level of 0.05, we accept the null hypothesis and conclude that in the population there is no significant difference in the average weight of undergraduate and graduate students. Comparison of means: t-test Comparison of means: t-test T-Test (SPSS output): Example 2 T-Test (SPSS output): Example 3 Group Statistics Std. Error Group Statistics gradf N Mean Std. Deviation Mean weight undergraduate 1703 64.34 14.473 .351 Std. Error graduate 248 65.62 13.517 .858 gender N Mean Std. Deviation Mean height male 800 177.66 8.595 .304 female 1135 164.74 6.066 .180 Ho: μ weight undergraduate = μ weight graduate Independent Samples Test Levene's Test for Equality of Variances t-test for Equality of Means 95% Confidence Ha: μ weight undergraduate ≠ μ weight graduate Interval of the Mean Std. Error Difference F Sig. t df Sig. (2-tailed) Difference Difference Lower Upper height Equal variances 14.068 .000 38.746 1933 .000 12.913 .333 12.260 13.567 assumed Equal variances 36.558 1341.890 .000 12.913 .353 12.221 13.606 not assumed Comparison of means: t-test Comparison of means: t-test T-Test (SPSS output): Example 2 T-Test (SPSS output): Example 3 Independent Samples Test Levene's Test for Group Statistics Equality of Variances t-test for Equality of Means 95% Confidence Std. Error Interval of the Mean Std. Error Difference gender N Mean Std. Deviation Mean F Sig. t df Sig. (2-tailed) Difference Difference Lower Upper height male 800 177.66 8.595 .304 weight Equal variances .130 .718 -1.315 1949 .189 -1.283 .976 -3.197 .630 female 1135 164.74 6.066 .180 assumed Equal variances -1.384 335.007 .167 -1.283 .927 -3.107 .540 not assumed Research question: Is there a difference between the Value of statistical test: -1.315 average height for males versus females? P-value: 0.189 Comparison of means: t-test Comparison of means: t-test T-Test (SPSS output): Example 3 T-Test (SPSS output): Example 4 Group Statistics Group Statistics Std. Error gradf N Mean Std. Deviation Mean Std. Error height undergraduate 1698 169.89 10.007 .243 gender N Mean Std. Deviation Mean height male 800 177.66 8.595 .304 graduate 247 170.87 9.157 .583 female 1135 164.74 6.066 .180 Independent Samples Test μ height males = μ height females Levene's Test for Ho: Equality of Variances t-test for Equality of Means 95% Confidence Interval of the Mean Std. Error Difference Ha: μ height males ≠ μ height females F Sig. t df Sig. (2-tailed) Difference Difference Lower Upper height Equal variances .001 .981 -1.463 1943 .144 -.986 .674 -2.309 .336 assumed Equal variances -1.563 337.417 .119 -.986 .631 -2.228 .255 not assumed Comparison of means: t-test Comparison of means: t-test T-Test (SPSS output): Example 3 T-Test (SPSS output): Example 4 Independent Samples Test Group Statistics Levene's Test for Equality of Variances t-test for Equality of Means Std. Error 95% Confidence gradf N Mean Std. Deviation Mean Interval of the height undergraduate 1698 169.89 10.007 .243 Mean Std. Error Difference F Sig. t df Sig. (2-tailed) Difference Difference Lower Upper graduate 247 170.87 9.157 .583 height Equal variances 14.068 .000 38.746 1933 .000 12.913 .333 12.260 13.567 assumed Equal variances 36.558 1341.890 .000 12.913 .353 12.221 13.606 not assumed Research question: Is there a difference between the average height for undergraduate versus graduate students? Value of statistical test: 36.558 P-value: 0.000 Comparison of means: t-test Comparison of means: t-test T-Test (SPSS output): Example 3 T-Test (SPSS output): Example 4 Independent Samples Test Group Statistics Levene's Test for Equality of Variances t-test for Equality of Means Std.