0% found this document useful (0 votes)
50 views

SUI 252 - Week 8 (2022)

This document introduces hypothesis testing for bivariate statistics. It discusses using a t-test to compare means when there is one interval dependent variable and one nominal independent variable. It also discusses using a chi-square test with contingency tables when both variables are categorical. The document provides an example to test the hypothesis that men earn more than women on average using sample income data. It calculates relevant statistics like means, standard deviations, and z-scores to determine if the observed difference is statistically significant evidence to reject the null hypothesis that women actually earn the same or more on average.

Uploaded by

Atalay Arslan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
50 views

SUI 252 - Week 8 (2022)

This document introduces hypothesis testing for bivariate statistics. It discusses using a t-test to compare means when there is one interval dependent variable and one nominal independent variable. It also discusses using a chi-square test with contingency tables when both variables are categorical. The document provides an example to test the hypothesis that men earn more than women on average using sample income data. It calculates relevant statistics like means, standard deviations, and z-scores to determine if the observed difference is statistically significant evidence to reject the null hypothesis that women actually earn the same or more on average.

Uploaded by

Atalay Arslan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 39

INTRODUCTION TO HYPOTHESIS TESTING: BIVARIATE

STATISTICS

SUI 252 – WEEK 8


TOBB ETU FALL 2022
K. AYDIN GÜNDÜZ, PH.D.
When it comes to causal inferences, we are mostly in the realm of bivariate
or multivariate statistics for hypothesis-testing because we are interested in
assessing the causal linkages between two (or more) variables.
This week, we are going to learn two simple tools of bivariate statistics:
Means comparison (with a t-test): We can use it when we have an interval
dependent variable and some nominal (dichotomous) independent variable.
Contingency table (i.e., cross tabulation) (with a chi-square test): We can
use it when both the dependent and independent variables are categorical
variables.
“Males have a higher income than females.”
Why do we have that expectation? Is it theoretically supported? (Remember
Step 2 in hypothesis-testing from Week 6. We do not test everything. Our
expectations should have some theoretical basis.)
Feminist theory- Patriarchy! – “Gender wage gap”
What are the IV and DV here?
To test hypothesis or such “expectation” ve have to have observations for
the variables of interest (records of the values for as many observations as
possible – Remember, we prefer large samples for relatively more precise
statistical estimations after we make sure that they are representative of the
population – “law of large numbers”. Besides, we have to ensure that the
sample is representative of the population  accuracy).
Where μ stands for average income for males, and μ stands for average
M F

income in females, we can summarize our expectation for gender wage gap
in this example as follows:
H : μ > μ , in other words: μ − μ > 0
1 M F M F

This is what we expect to see in the population!


EXERCISE
Suppose we have a sample data and there, average income of 400 men is
32800 liras per year (with a standard deviation of 4000 liras), whereas
average income of 300 women is 32000 liras per year (with a standard
deviation of 3000 liras).
Based on that data, let’s test the gender gap hypothesis “Men (males) earn
more than women (females) in average”
In the sample statistics, we clearly see that 32800 > 32000, i.e., x̄ > x̄
M F.

And, this overlaps with the gender wage gap hypothesis. BUT IT TAKES
MORE THAN THAT TO TEST A HYPOTHESIS!
In the sample statistics, we clearly see that 32800 > 32000, i.e., x̄ > x̄
M F.

And, this overlaps with the gender wage gap hypothesis. BUT IT TAKES
MORE THAN THAT TO TEST A HYPOTHESIS!
Is μM > μF ? This, is what I want to know, indeed.
HYPOTHESIS- Do you remember what we did when we were assessing whether
city X will be qualified for the subsidized loan program, in the last
TESTING lecture of Week 6?
REQUIRES US TO We assessed whether the opposite of what we observe and expect
(city X having a mean business income lower than 100,000 liras)
SHOW THAT can still be true. We call that null hypothesis.
THAT Here in this example our hypothesis dictates:
DIFFERENCE IN H: μ > μ
1 M F

OUR SAMPLE In the sample data WE ALREADY OBSERVED THAT: x̄ > x̄


M F

DATA IS To make a general inference, I have to make sure that this


observed difference that supports the gender wage gap hypothesis
STATISTICALLY is not by chance (in other words, statistically significant).
SIGNIFICANT (= How much my sample statistics diverge from the null hypothesis
“NOT BY for gender wage gap then can be formulated as:

CHANCE”) H: μ = μ
0 M F

or H : μ
0 M ≤ μF
IS THE MEAN
DIFFERENCE THAT WE
SEE IN THE SAMPLE
DATA” FAR AWAY”
FROM THE
HYPOTHETICAL
SCENARIO WHERE
WOMEN HAVE AT
LEAST THE SAME
AVERAGE INCOME
WITH THE MEN IN THE
POPULATION?…
TWO FORMULA WHICH WE ARE GOING TO USE HERE…
STANDARD ERROR OF THE MEAN DIFFERENCES AND Z-SCORE FORMULA FOR SAMPLE MEAN DIFFERENCES LET’S COMPUTE
THEM ON THE BOARD FOR OUR EXAMPLE
WE HAVE TO FIND
SOME CRITICAL VALUE
ACCORING TO WHICH
WE ARE GOING TO
MAKE AN ASSESSMENT
TO REJECT (OR NOT
REJECT) THE NULL
HYPOTHESIS. LET’S
FIND IT AND DECIDE
WHAT WE ARE GOING
TO DO…
REMEMBER, WE TAKE 95% CONFIDENCE LEVEL AS THE
DEFAULT LEVEL OF CONFIDENCE (SO WE ARE GOING TO
CALCULATE ALPHA FOR IT)
FOR H0: μM = μF
IS IT, ONE-TAILED OR TWO-TAILED?
OUR NULL HYPOTHESIS WAS “WOMEN HAVE AT LEAST THE
SAME AVERAGE INCOME WITH MEN”
 H0: μM ≤ μF
SO, THIS TIME THIS IS A ONE-TAILED TEST.
HOWEVER, IN BOTH SCENARIOS WE CAN REJECT THE NULL
HYPOTHESIS, GIVEN Z-SCORE FOR SAMPLE MEANS
DIFFERENCE (3.02) IS GREATER THAN ALL CRITICAL VALUES!
SO, THIS IS A STATISTICALLY SIGNIFICANT DIFFERENCE. I
AM NOT ONLY 95% BUT ALSO 99% CONFIDENT THAT THERE
IS A GENDER WAGE GAP!
Eğer bulduğum Z score, T-test sonucundan büyükse (%) olarak, bu durumda
Hipotez 0’ın gerçekleşme olasılığı yok yani gender gap olmaması ya da tersi
durum yok.
Aynı durum City X örneğindende bulunuyor. Orada da bir şehrin 102.000
ortalama ve 20.000 sapma ile ödenek alması için 100.000 den az geliri
olması gerekiyor. Hipotez 1 diyor ki şehrin ortalaması 100.000 den az olmalı
ama biz hipotez 0 daki duruma bakıyoruz eğer fazla olursa da alabilir mi,
%95 oranında alamıyor. 2 zaten SE of mean değeri 2 birim aralıktayken
population’a uyumlanır olması için %90 aralık veriliyor daha fazla
confidence sunamıyoruz her şekilde alması imkansız.
EXERCISE
 For several decades, the ANES group has conducted extensive surveys of the voting age population for
each biannual election cycle. One of the survey items asks respondents to place a candidate, other
political figure, organization, or group on a scale ranging from 0 to 100. On this “feeling
thermometer,” a “0” represents the least positive, or cold placement; 100 represents the most positive,
or hot placement; and 50 represents neutrality.
 Using this information, address the following statement:
“In 2000, men were more supportive of George Bush than were women.”
Feeling Thermometer Ratings
Men Women
X̄ = 58.15 X̄ = 55.74
s = 24.55 s = 25.12
N = 781 N =980
“Men were more supportive of George Bush than
were women.”…
MY Z-SCORE VALUE IS 2.02.
THEREFORE, I AM 95% CONFIDENT THAT
MEN ARE MORE LIKELY TO BE MORE
SUPPORTIVE OF BUSH.
WHAT ABOUT 99%?

For 99 percent, the table value is bigger than the Z


score of mean so, H0 shows that there were some
peculiarity for women had no better option than
Bush. We could not be 99 percent sure the Men has
predominance on the research to have weighed
supportiveness.
WHAT IF I AM DEALING WITH CATEGORICAL
PROPERTIES IN MY DEPENDENT VARIABLE?

So far, we dealt with some dependent variables which we operationalized as


interval data (thermometer ratings, income…etc.) Some research questions
in political science require us to work with categorical data…
Can we have means comparison if we have a categorical DV?
WE CANNOT.
However, there are alternative ways / strategies… We are going to address
these one by one, let’s start from relatively easier computations.
INFERENTIAL STATISTICS FOR DICHOTOMOUS
VARIABLES…

dichotomous variable is a variable for which only two categories exist. (male – female,
war – peace, Trump – Biden, yes –no, leave - remain…etc.)
For voting behavior scholars, dealing with dichotomous dependent variables in
inferential statistics is almost inevitable.
Party preference in two-party systems, referenda... etc.
Suppose, we have some survey data, so we know percent of the respondents will vote for
the incumbent president in the upcoming elections. How are we going to interpret that
sample statistic for the population?
Exercise 1
Suppose that the Gallup Organization’s latest poll sampled 1,000 people from the United
States, and the results show that 52% will vote for the incumbent president, compared to
48% who will not.
How are we going to interpret that survey data? (In other words, what can we expect to
see in the entire population?)

In statistics, p stands for the sample proportion, whereas Π stands for the population
proportion
We have p and we will infer Π (as we inferred μ based on x̄ for the averages in interval
variables )
We will calculate the margin of error!
I HAVE TO
CALCULATE
THE MARGIN
OF ERROR
(MOE) FOR
PROPORTIONS

HERE IS THE
FORMULA
Exercise 2
“KONDA, 15-16 Haziran 2019 tarihlerinde İstanbul Büyükşehir Belediyesi sınırları
içindeki 157 mahallede 3498 kişiyle hanelerinde yüz yüze görüşülme ile gerçekleştirilen
24 Haziran İstanbul seçimi anketinin sonuçlarını açıkladı. KONDA anketinde Ekrem
İmamoğlu yüzde 49 gösterilirken Binali Yıldırım ise 40.9 olarak araştırmaya yansıdı.
Kararsız seçmenler orantılı bir şekilde dağıtıldığında ise Ekrem İmamoğlu’nun yüzde
54, Binali Yıldırım’ın yüzde 45 oy oranına ulaşacakları hesaplandı.”
Based on these findings reported in that news story, what would be the estimated
population statistics for Imamoglu’s vote share?
a) Compute the 95% confidence interval,
b) Compute the 99% confidence interval
c) Neden margin error ?
INTRODUCTION TO HYPOTHESIS TESTING FOR
CATEGORICAL VARIABLES…
Suppose that we are interested in testing some claims of political underrepresentation.
Such as “Religious groups are not represented proportionally in the Congress.”
To assess such claims statistically, we use chi-square distribution.
It tests the possibility that the proportions we observe in a sample –such as the U.S.
Congress- could have been randomly drawn from a population (U.S. as a whole) with
different expected proportions. So, thanks to that, we can compute underrepresentation
or overrepresentation!
Warning: We assessed the diversity in the Congress by computing the IQV (i.e.,
categorical variability) in Week 4.. This time we are going to make some judgment about
whether the Congress is representative of the population with regards to religious
diversity!
WAS 107TH CONGRESS REPRESENTATIVE OF THE U.S.
POPULATION WITH REGARDS TO RELIGIOUS DIVERSITY?
What else do we need to assess,
whether this distribution is
representative of the population?
Relative frequency of these
religious denominations in the
population!
Here are some figures that I took
from a PEW Research study:
58% Protestant, 26% Catholic,
2% Jewish,14% Other.
HERE IS THE CHI SQUARE FORMULA…
IT IS EASIER TO COMPUTE THAT WITH A TABLE (AS WE DID FOR
THE STANDARD DEVIATION COMPUTATION). SO WATCH ME
CAREFULLY AS I PREPARE IT ON THE TABLE AND TAKE NOTES.
WHAT ARE WE GOING fe
TO DO WITH THAT?? share in the (=what (fo- (fo-
Categories fo population if...) fe) (fo-fe)² fe)²/fe
Protestant 258 0.58 247 11 121 0.49
Catholic 128 0.26 111 17 289 2.60
Jewish 27 0.02 8 19 361 45.13
Other 13 0.14 60 -47 2209 36.82
Chi-
Total 426 square 85.04
We will assess it with the chi-square distribution!!!
This is a univariate chi-square test for measuring representativeness of a sample
and df = k – 1 (number of categories – 1)
(In t-table df = number of observations – 1, do not get confused)
For a 95% confidence level I take 7.8147 as my benchmark. 85.04>7.8147. SO, I
AM 95% CONFIDENT THAT THE US CONGRESS IS REPRESENTATIVE OF
THE POPULATION WITH REGARDS TO THE RELIGIOUS DIVERSITY!
Because our the null hypothesis says that there is a relationship between different
than religion. Our Chi-Square value is bigger than the table value so Null is
Rejected.
HYPOTHESIS-TESTING WITH CATEGORICAL
VARIABLES
If we have categorical (nominal or ordinal) variables in our hypotheses…
Such as
“Democracies are less likely to go to war with each other.”
“Kurds are more likely to vote for HDP.”
“Support for the welfare state is higher among Democrats than among
Republicans.”
The most basic tool testing such hypothesis is crosstabulation (i.e.
contingency table) which is a frequency table that represents the distribution
of data simultaneously on two or more variables.
A GENERIC CONTINGENCY TABLE…
A TENTATIVE CONTINGENCY TABLE…
Let’s say we are interested to see whether voters’ sex plays a role in
support for President Erdogan…
 Remember, first step of a hypothesis test in data analysis is about deciding whether what we observe
in the sample data matches up with our expectation.
 Is there a relevant percentage difference in the way we expected?
relevant percentage difference is the difference in the percentages of cases between dependent
variable categories for one or more independent variable categories.
Relevant percentage difference is a descriptive measurement. BUT a complete
hypothesis test requires us to demonstrate that there is a statistically significant
relationship (i.e., a statistically significant association) between these variables, in
addition to the mere existence of some relevant percentage difference.
CHI-SQUARE TEST, AGAIN!…
A BIVARIATE CHI-SQUARE TEST is an inferential measure of association that compares
the observed frequencies within a contingency table against a certain frequency
expectation, usually one that matches statistical independence (= hypothetical scenario
where there is no relationship between these variables.).
HERE IS THE CHI SQUARE FORMULA…
IT IS EASIER TO COMPUTE THAT WITH A TABLE (AS WE DID FOR THE STANDARD DEVIATION
COMPUTATION). SO WATCH ME CAREFULLY AS I PREPARE IT ON THE TABLE AND TAKE NOTES.
To compute fe I need…
# observation fe (=what
Outcomes based on “Sex in the IV Partisan divide if sex had (fo-fe)
& Party” fo categories in "Total" no effect?) (fo-fe)² (fo-fe)²/fe
Male & Democratic 232 533 0.47 250.51 -18.51 342.6201 1.3676903
Male & Republican 301 533 0.53 282.49 18.51 342.6201 1.2128574
Female & Democratic 331 662 0.47 311.14 19.86 394.4196 1.2676596
Female & Republican 331 662 0.53 350.86 -19.86 394.4196 1.1241509
chi-square 4.9723583

SO, WHAT ARE WE GOING TO DO


WITH THIS 4.97?
We are going to use the chi-square table again, but we are going to
interpret it for bivariate statistics this time and the way we are going
to determine the row which corresponds to our degrees of freedom is
now different.
In univariate statistics –where we computed the representativeness
of a sample (such as the congresses and councils in our previous
examples) for the categories of interest in the real population- we used
number of categories. (df = k – 1)
Here, in bivariate statistics, we are going to refer to number of
categories for both variables (IV and DV).
IV is sex, DV is party preference.
How many categories do I have for each?
They were both dichotomous variables so 2 for both. So, I had two
rows and 2 columns in my contingency table.
Here is the formula of df in Chi-square for bivariate statistics:
(rows – 1) x (columns – 1)= (2 – 1) x (2 – 1) = 1
So, I will refer to the very first row…
As it was the case for the univariate interpretation of the chi-square
table, I will be in the second column for 95% confidence level.
Therefore, my critical value is 3.84.
Is my chi-square greater or smaller than that?
4.97 > 3.84
Therefore, I can reject the null hypothesis.
My conclusion, then, is:
“I am 95% confident that sex and party preference has some
statistically significant relationship, in this case where I observed that
men tend to vote for the Republican candidate more than women do.”
What if I want to make an assessment for 99% confidence level?
4.97 < 6.63 (I FAIL TO REJECT THE NULL HYPOTHESIS)
My p-value is somewhere between .05 and .025!

You might also like