Assignment 4: Chi-square Test including a moderator
In order to determine if the parental alcoholic behaviour background moderate the number of years of dependence onset on individuals starting drinking before 21 years old, a chi-square test has been conducted.
Here is the code performing the testing:
Chi-Square Test :
When examining the association between the age at which the individuals started drinking (grouped age - categorical response) and the number of years of alcohol dependence onset (grouped number of years - categorical explanatory), the average number of years of dependence onset is around 12 years for the individuals who started drinking before 12 years old and around 7 years for those who started drinking between 12 and 21 years old.
The Chi Square test of independence revealed that among individuals who started drinking alcohol before 21 years old, the starting age of drinking and the number of years of dependence onset are significantly associated (X2 =182.60, p=2.93e-35).
When considering the parental alcoholic behaviour (moderator):
For individuals who do not have alcoholic parents: the Chi Square test of independence revealed that the starting age of drinking and the number of years of dependence onset are significantly associated (X2 =83.00, p=1.21e-14).
For individuals who have alcoholic parents: the Chi Square test of independence revealed that the starting age of drinking and the number of years of dependence onset are significantly associated (X2 =85.75, p=3.39e-15).
Conclusion: The parental alcoholic behaviour background does not moderate the relationship between the starting age of drinking and the alcohol dependence onset.










