You are on page 1of 9

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

Comparisons of proportions:
Chi Square Test (X2 test)
Example 1:

 Research question: Is there a relationship between regular

physical activity (PA) and gender?

females

females

Chi Square Test (X2 test)

 Example 1: Chi square test (SPSS output)
gender * regular PA Crosstabulation

Count
regular PA
No Yes Total
gender male 469 349 818
female 810 347 1157
Total 1279 696 1975

Chi-Square Tests

Asymp. Sig. Exact Sig. Exact Sig.

Value df (2-sided) (2-sided) (1-sided)
Pearson Chi-Square 33.727b 1 .000
Continuity Correction a 33.174 1 .000
Likelihood Ratio 33.553 1 .000
Fisher's Exact Test .000 .000
Linear-by-Linear
33.710 1 .000
Association
N of Valid Cases 1975
a. Computed only for a 2x2 table
b. 0 cells (.0%) have expected count less than 5. The minimum expected count is 288.
27.
Chi Square Test (X2 test)
 This is the p-value for the Chi square test.

 If the p-value is >0.05 then accept null hypothesis & conclude

that the 2 proportions are equal.

 If the p-value is <0.05 then reject null hypothesis (accept the

alternative) & conclude that the 2 proportions are different.

Chi-Square Tests

Asymp. Sig. Exact Sig. Exact Sig.

Value df (2-sided) (2-sided) (1-sided)
Pearson Chi-Square 33.727b 1 .000
Continuity Correction a
33.174 1 .000
Likelihood Ratio 33.553 1 .000
Fisher's Exact Test .000 .000
Linear-by-Linear
33.710 1 .000
Association
N of Valid Cases 1975
a. Computed only for a 2x2 table
b. 0 cells (.0%) have expected count less than 5. The minimum expected count is 288.
27.

Chi-Square Tests

Asymp. Sig. Exact Sig. Exact Sig.

Value df (2-sided) (2-sided) (1-sided)
Pearson Chi-Square 33.727b 1 .000
Continuity Correction a 33.174 1 .000
Likelihood Ratio 33.553 1 .000
Fisher's Exact Test .000 .000
Linear-by-Linear
33.710 1 .000
Association
N of Valid Cases 1975
a. Computed only for a 2x2 table
b. 0 cells (.0%) have expected count less than 5. The minimum expected count is 288.
27.

 P-value: 0.000

Chi Square Test (X2 test)

Example 1:
 Research question: Is there a relationship between regular
physical activity and gender?
 Ho: Proportion of PA among males = proportion of PA among
females
 Ha: Proportion of PA among males ≠ proportion of PA among
females
 Statistical test: Chi square test= 33.727 P=0.000
 Conclusion: At significance level of 0.05, we reject null
hypothesis and conclude that in the population there is
significant difference in the proportions of PA among males
and females.
Chi Square Test (X2 test)
Example 1: Total Percent (%)

gender * regular PA Crosstabulation

regular PA
No Yes Total
gender male Count 469 349 818
% of Total 23.7% 17.7% 41.4%
female Count 810 347 1157
% of Total 41.0% 17.6% 58.6%
Total Count 1279 696 1975
% of Total 64.8% 35.2% 100.0%

Chi Square Test (X2 test)

Example 1: Row Percent (%)

gender * regular PA Crosstabulation

regular PA
No Yes Total
gender male Count 469 349 818
% within gender 57.3% 42.7% 100.0%
female Count 810 347 1157
% within gender 70.0% 30.0% 100.0%
Total Count 1279 696 1975
% within gender 64.8% 35.2% 100.0%

Chi Square Test (X2 test)

Example 1: Column Percent (%)

gender * regular PA Crosstabulation

regular PA
No Yes Total
gender male Count 469 349 818
% within regular PA 36.7% 50.1% 41.4%
female Count 810 347 1157
% within regular PA 63.3% 49.9% 58.6%
Total Count 1279 696 1975
% within regular PA 100.0% 100.0% 100.0%
Chi Square Test (X2 test)
Example 1: All Percentages
gender * regular PA Crosstabulation

regular PA
No Yes Total
gender male Count 469 349 818
% within gender 57.3% 42.7% 100.0%
% within regular PA 36.7% 50.1% 41.4%
% of Total 23.7% 17.7% 41.4%
female Count 810 347 1157
% within gender 70.0% 30.0% 100.0%
% within regular PA 63.3% 49.9% 58.6%
% of Total 41.0% 17.6% 58.6%
Total Count 1279 696 1975
% within gender 64.8% 35.2% 100.0%
% within regular PA 100.0% 100.0% 100.0%
% of Total 64.8% 35.2% 100.0%

Chi Square Test (X2 test)

 Example 2: Chi square test (SPSS output)
major * regular PA Crosstabulation

regular PA
No Yes Total
major health Count 122 69 191
% within major 63.9% 36.1% 100.0%
% within regular PA 9.5% 9.9% 9.7%
% of Total 6.2% 3.5% 9.7%
science Count 344 161 505
% within major 68.1% 31.9% 100.0%
% within regular PA 26.8% 23.2% 25.5%
% of Total 17.4% 8.1% 25.5%
engineering Count 147 91 238
% within major 61.8% 38.2% 100.0%
% within regular PA 11.5% 13.1% 12.0%
% of Total 7.4% 4.6% 12.0%
law Count 171 104 275
% within major 62.2% 37.8% 100.0%
% within regular PA 13.3% 15.0% 13.9%
% of Total 8.6% 5.3% 13.9%
business Count 222 137 359
% within major 61.8% 38.2% 100.0%
% within regular PA 17.3% 19.7% 18.2%
% of Total 11.2% 6.9% 18.2%
arts Count 277 132 409
% within major 67.7% 32.3% 100.0%
% within regular PA 21.6% 19.0% 20.7%
% of Total 14.0% 6.7% 20.7%
Total Count 1283 694 1977
% within major 64.9% 35.1% 100.0%
% within regular PA 100.0% 100.0% 100.0%
% of Total 64.9% 35.1% 100.0%

Chi Square Test (X2 test)

 Example 2: Chi square test (SPSS output)
Chi-Square Tests

Asymp. Sig.
Value df (2-sided)
Pearson Chi-Square 7.215a 5 .205
Likelihood Ratio 7.227 5 .204
Linear-by-Linear
.017 1 .898
Association
N of Valid Cases 1977
a. 0 cells (.0%) have expected count less than 5. The
minimum expected count is 67.05.

 Research question: Is there a relationship between regular

physical activity and students’ majors?
Chi Square Test (X2 test)
 Example 2: Chi square test (SPSS output)
Chi-Square Tests

Asymp. Sig.
Value df (2-sided)
Pearson Chi-Square 7.215a 5 .205
Likelihood Ratio 7.227 5 .204
Linear-by-Linear
.017 1 .898
Association
N of Valid Cases 1977
a. 0 cells (.0%) have expected count less than 5. The
minimum expected count is 67.05.

Chi Square Test (X2 test)

 Example 2: Chi square test (SPSS output)
Chi-Square Tests

Asymp. Sig.
Value df (2-sided)
Pearson Chi-Square 7.215a 5 .205
Likelihood Ratio 7.227 5 .204
Linear-by-Linear
.017 1 .898
Association
N of Valid Cases 1977
a. 0 cells (.0%) have expected count less than 5. The
minimum expected count is 67.05.

 P-value: 0.205

Chi Square Test (X2 test)

 Example 2: Chi square test (SPSS output)
Chi-Square Tests

Asymp. Sig.
Value df (2-sided)
Pearson Chi-Square 7.215a 5 .205
Likelihood Ratio 7.227 5 .204
Linear-by-Linear
.017 1 .898
Association
N of Valid Cases 1977
a. 0 cells (.0%) have expected count less than 5. The
minimum expected count is 67.05.

 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 proportions of PA among the
different students’ majors.
SPSS commands for X2 test
Example 1
 Analyze
 Descriptive statistics
 Crosstabs
 select major for row
 select regular PA for column
Go to Statistics-chose chi square




percentages

Relation between hypothesis

testing & Confidence Interval (CI)
Example 1: A cohort study

Lung No Lung
cancer cancer
Smoking

Yes 32 168

No 15 185

Results: Chi square test X2 = 6.97, p-value < 0.01

95%Confidence Interval around RR: 1.21-3.73

Hypothesis testing & CI

Example 1: A cohort study

 Ho: RR=1
 Ha: RR≠1

 Conclusion based on results of Chi square test (X2=

6.97, p-value < 0.01):
 Because p-value of chi square test < 0.05, reject Ho.
 Therefore, there is a significant association between
smoking and lung cancer.
Hypothesis testing & CI
Example 1: A cohort study

 Ho: RR=1
 Ha: RR≠1

 Conclusion based on results of 95% confidence

interval around RR: (1.21-3.73):
 We are 95% confident that the RR between smoking and
lung cancer in the population is between 1.21-3.73.

 Because the 95% Confidence Interval does not include

the value of the null hypothesis (1) then reject the null
hypothesis and accept the alternative. Therefore, there is
a significant association between smoking & lung cancer.

Hypothesis testing & CI

Example 2: A case control study
Breast No Breast
cancer cancer

Yes 69 66
sweetener
Artificial

No 22 134

Results: Chi square test (X2) = 46.1, p-value <0.0001

95% Confidence Interval around OR: (3.72-10.87)

Hypothesis testing & CI

Example 2: A case control study
 Ho: OR = 1
 Ha: OR ≠ 1

 Results: Chi square test (X2) = 46.1, p-value <0.0001

95% Confidence Interval around OR: (3.72-10.87)

What is the conclusion based on results of 95% CI ????

Hypothesis testing & CI
Example 2: A case control study
 Ho: OR = 1
 Ha: OR ≠ 1

 Conclusion based on Chi square test (X2= 46.1, p-value

<0.0001):
 Because p-value of chi square test < 0.05, reject Ho.
 Therefore, there is a significant association between
artificial sweeteners and breast cancer.

Hypothesis testing & CI

Example 2: A case control study
 Ho: OR = 1
 Ha: OR ≠ 1

 Conclusion based on 95% Confidence Interval around

OR (3.72-10.87):
 We are 95% confident that the OR between artificial
sweetener & breast cancer in the population is between
3.72-10.87.
 Because the 95% Confidence Interval does not include
the value of the null hypothesis (1) then reject the null
hypothesis & accept the alternative. Therefore, there is
a significant association between artificial sweetener &
breast cancer.

Hypothesis testing & CI

T (True) or F (False):

Results of a case control study to assess the

association between physical activity and
depression were as follows: OR = 4.2 and 95%
Confidence Interval (0.9-8.9). Based on these
results, we would conclude that in the
population there is no relation between PA and
depression because the confidence Interval
includes 4.2
Hypothesis testing & CI
T (True) or F (False):

In studying whether there is an association

between engaging in PA and hours spent at
work (per week), the investigator found out
that the difference in the average weekly hours
spent at work between those who engage in PA
and those who do not is 10 with a 95%
Confidence Interval of (0.9-23). Based on the
results; we would reject the null hypothesis
and conclude that there is a relation between
engaging in PA and hours spent at work .