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

Outline Comparison of : 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 ƒ 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 are different (accept alternative) Group and hence check this p-value for the t-test. Std. Error gender N 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% 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 : 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. 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

ƒ Ho: μ height undergraduate = μ height graduate ƒ Conclusion: At significance level of 0.05, we reject the null hypothesis and conclude that in the population there is a significant difference in the average height of males and ƒ Ha: μ height undergraduate ≠ μ height graduate females. Comparison of means: t-test SPSS commands for t-test

ƒ T-Test (SPSS output): Example 4 Example 3 † Analyze Independent Samples Test „ Compare Means Levene's Test for † Equality of Variances t-test for Equality of Means Independent Samples t-test 95% Confidence ƒ select height as the dependent variable Interval of the Mean Std. Error Difference ƒ select gender as the independent variable 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 Example 4 Equal variances -1.563 337.417 .119 -.986 .631 -2.228 .255 not assumed † Analyze „ Compare Means ƒ Value of statistical test: -1.463 † Independent Samples t-test ƒ select height as the dependent variable ƒ P-value: 0.144 ƒ select gradf as the independent variable

Comparison of means: t-test

ƒ T-Test (SPSS output): Example 4

Independent Samples Test

Levene's Test for Equality of Variances t-test for Equality of Means 95% Confidence END Interval of the Mean Std. Error Difference 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 ƒ 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 height of undergraduate and graduate students.

SPSS commands for t-test

Example 1 † Analyze „ Compare Means

† Independent Samples t-test ƒ select weight as the dependent variable ƒ select gender as the independent variable

Example 2 † Analyze „ Compare Means

† Independent Samples t-test ƒ select weight as the dependent variable ƒ select gradf as the independent variable