Bivariate Analysis T-TEST. Comparison of means: t-test. Outline. Hypothesis testing steps. Comparison of means: t-test

Bivariate Analysis T-TEST Variable 1 Variable 2 Outline 2 LEVELS >2 LEVELS CONTINUOUS 2 LEVELS X2 X2 t-test >2 LEVELS X2 ANOVA X2 chi squar...
Author: Theresa Sherman
0 downloads 2 Views 127KB Size
Bivariate Analysis T-TEST

Variable 1 Variable 2

Outline

2 LEVELS

>2 LEVELS

CONTINUOUS

2 LEVELS

X2

X2

t-test

>2 LEVELS

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

END

Suggest Documents