Behavioural Research Methods
2020
All Lecture Examples of STATA
BakedToast
EINDHOVEN UNIVERSITY OF TECHNOLOGY
,EXAMPLE LECTURE 3:
Example 1: Is there a relation between gender and transportation
Observed – Expected
Gives:
1.1 DOING A CHI2 TEST:
For calculating a probability, we need a test statistic: Chi2.
This
… is X2 and X2 is a measure for how (un) likely it is to find these data under H0.
- We would not expect this number to be zero, that would mean that all cell frequencies are exactly
equal to what we would expect
- It cannot be negative, as we squared all differences
- The larger the table, the larger this number, by definition
- Following the reasoning of hypothesis testing
o If H0 would be true (so in example case: no relation) what would be the probability of getting
X^2 = 8.9153 (or even larger).
o To calculate the answer for that question, we need to know the distribution of X^2
Option 1.1.1: When P > 0.05:
We get this, so the P-value is 0.063, so given that there is no relation (H0), the probability of finding
this result (or more extreme) is 0.063. So, the effect is not significant, because p = 0.063 and 0.063 >
, 0.05, we do not reject H0. In other words, there is no evidence for a relation between gender and
means of transportation according to this example.
From the Chi2 value to the p-value: We have 4 (look at the chi2(4)) degrees of freedom (k), so follow
the blue line in the graph and then apparently there is 6.3% of the probability density right of 8.9153
→ p-value!!!
Option 1.1.2: When P < 0.05
Is there a difference in the use of bike vs train across boys and girls?
• Type tab female travel12tue if travel12tue == 2 | travel12tue ==4, chi2
o ! Check the double =-sign !
o Now you perform a test on
selected means of
transportation
• Results →
• P<0.05, we reject H0, we found
evidence that girls are more likely
to take the bike over the train
compared to boys.
1.2: FISHER’S EXACT PROCEDURE
1. The list with all possibilities:
GIVEN DATA
2. Which of these are further away from H0 than the actual data
3. Calculate the probability that you get this exact result plus the more extreme results
The sum of probabilities is the p-value.