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