Don't wanna be here? Send us removal request.
Text
Data Tools Week 4 - Testing Potential Moderators
In Week 2, a chi-square test of independence revealed that among adults above 18 years old, depression rates are significantly lower in the married group (26%) vs all other marital groups (30-41%).
Next, we want to find out if gender and income affect the strength and direction of the relationship between marriage and depression.
Gender:
Chi-square tests were carried out on data grouped into 2 subsets - male and female.
While prevalence of depression is significantly lower for married men (19%) vs men in all other marital groups (26%-35%), prevalence of depression is only significantly lower for married women (33%) vs divorced & separated women (34-45%).
Prevalence of depression for married women is statistically similar with cohabiting, widowed and single women (33-36%).
Prevalence of depression is significantly correlated to marriage only in the male population.
Male Results summary: MARITAL 1 2 3 4 5 6 S4AQ1 0.0 0.811552 0.730703 0.686352 0.65122 0.689218 0.74042 1.0 0.188448 0.269297 0.313648 0.34878 0.310782 0.25958 MALE chi-square value, p value, expected counts (323.5040810183464, 8.82350162116948e-68, 5, array([[7356.21332744, 445.53006128, 582.32230994, 1566.6151383 , 361.46778557, 3529.85137746], [2269.78667256, 137.46993872, 179.67769006, 483.3848617 , 111.53221443, 1089.14862254]]))
Female Results summary: MARITAL 1 2 3 4 5 6 S4AQ1 0.0 0.674709 0.64194 0.650924 0.550617 0.57839 0.65836 1.0 0.325291 0.35806 0.349076 0.449383 0.42161 0.34164 FEMALE chi-square value, p value, expected counts (190.5951028148258, 2.9147643823925576e-39, 5, array([[6994.33460644, 453.2287446 , 2204.07530721, 2094.80903354, 610.33942212, 3217.21288608], [3823.66539356, 247.7712554 , 1204.92469279, 1145.19096646, 333.66057788, 1758.78711392]]))
===================================================
Income:
Chi-square tests were also carried out on data grouped into 3 subsets - low, middle & high income. Income groups are defined by personal annual income as follows. Low income: <$25K Middle income: $25K-69K High income: >$70K
While prevalence of depression is significantly lower for the married middle income group (23%) vs all other marital status (29%-40%), prevalence of depression is only significantly lower for the married low income group (29%) vs the previously married (widowed, divorced & separated) (33-42%), and significantly lower for the married high income group (21%) vs the previously married & single group (31-43%).
Prevalence of depression for the married low income group is statistically similar with the never married group (co-habiting & single) (29-31%).
Prevalence of depression for the married high income group is statistically similar with the cohabiting group (29% & 37%).
Prevalence of depression is significantly correlated to marriage only in the middle & high income groups, and not for the low income group.
Low Income MARITAL 1 2 3 4 5 6 S4AQ1 0.0 0.708439 0.685049 0.672796 0.575124 0.599334 0.695047 1.0 0.291561 0.314951 0.327204 0.424876 0.400666 0.304953 LOW INCOME chi-square value, p value, expected counts (207.0136871304949, 8.966950277597749e-43, 5, array([[7240.9192981 , 555.89332461, 2148.6366983 , 1790.98474313, 613.79887925, 4304.76705661], [3388.0807019 , 260.10667539, 1005.3633017 , 838.01525687, 287.20112075, 2014.23294339]]))
Middle Income MARITAL 1 2 3 4 5 6 S4AQ1 0.0 0.767771 0.682578 0.608553 0.60393 0.651064 0.705128 1.0 0.232229 0.317422 0.391447 0.39607 0.348936 0.294872 MIDDLE INCOME chi-square value, p value, expected counts (309.1578298727028, 1.0752930685080564e-64, 5, array([[5607.82356512, 299.32204762, 651.50765495, 1635.91286167, 335.75504148, 2061.67882916], [2242.17643488, 119.67795238, 260.49234505, 654.08713833, 134.24495852, 824.32117084]]))
High Income MARITAL 1 2 3 4 5 6 S4AQ1 0.0 0.79084 0.632653 0.619048 0.603774 0.565217 0.689744 1.0 0.20916 0.367347 0.380952 0.396226 0.434783 0.310256 HIGH INCOME chi-square value, p value, expected counts (85.77444560561398, 5.179295262571744e-17, 5, array([[1456.62508544, 36.32296651, 77.83492823, 275.01674641, 34.09911141, 289.101162 ], [ 508.37491456, 12.67703349, 27.16507177, 95.98325359, 11.90088859, 100.898838 ]]))
** See Post Hoc Chi-Square Test results for gender subsets @ https://www.dropbox.com/s/c5n40oxadokff4p/wk4-results-gender.txt?dl=0
** See Post Hoc Chi-Square Test results for income subsets @ https://www.dropbox.com/s/adwmo4eiy1mp18e/wk4-results-inc.txt?dl=0
**See Python file @ https://www.dropbox.com/s/bhbu9yome8y6qj1/datatools-week4.py?dl=0
0 notes
Text
Data Tools Week 3 - Pearson Correlation
Hypothesis 1: The number of episodes experienced by a depressed respondent is associated with the age of onset of the first episode.
Result: There is a significant negative association between age of onset and no. of episodes as the Pearson correlation coefficient r = -0.34 and P-value << 0.05. Since r2 = 0.12, we can predict 12% of the variability in the number of episodes experienced from the age of onset.
As the number of episodes are mostly within 12, plt.ylim(0, 12) was used to truncate the y-axis to show the linear relationship more clearly.
Hypothesis 2: The number of episodes experienced by a depressed respondent is associated with their annual personal incomes.
Result: We are not able to reject the null hypothesis that there is no association between annual personal income and no. of episodes as the Pearson correlation coefficient r = -0.067 and P-value =0.33, more than the significance level of 0.05 for the confidence level of 95%.
**See Python file @ https://www.dropbox.com/s/qwkc0yot2xt6h4y/datatools-week3.py?dl=0
0 notes
Text
Data Tools Week 2 - Chi Sq Tests
When examining the association between prevalence of depression (categorical response) and marital status (categorical explanatory), a chi-square test of independence revealed that among adults above 18 years old, depression rates are significantly different amongst different marital groups, X2 =537.9, 5 df, p<000.1.
Results for Chi-Square Tests:
MARITAL 1 2 3 4 5 6 S4AQ1 0.0 15111 876 2742 3119 872 6696 1.0 5333 408 1429 2171 545 2899 MARITAL 1 2 3 4 5 6 S4AQ1 0.0 0.739141 0.682243 0.657396 0.589603 0.615385 0.697863 1.0 0.260859 0.317757 0.342604 0.410397 0.384615 0.302137 chi-square value, p value, expected counts (537.8937401042978, 5.261891492820993e-114, 5, array([[14250.38989597, 895.00590033, 2907.3750859 , 3687.36854577, 987.7128978 , 6688.14767423], [ 6193.61010403, 388.99409967, 1263.6249141 , 1602.63145423, 429.2871022 , 2906.85232577]]))
To find out which groups are significantly different/similar, a post hoc Chi-Square Test was carried out.
Using the Bonferonni adjustment for 15 paired comparisons (6 types of marital status), the adjusted p value is 0.0033.
Bar plot (above) is from Week 4 of the Data Visualisation & Management Course. The prevalence of depression is plotted for each marital group.
Post hoc comparisons of prevalence of depression by marital status revealed that depression rates were significantly lower for the married group (26%) vs all other marital groups (30-41%).
In comparison, prevalence of depression is statistically similar among groups which are cohabiting & single (30-32%), cohabiting & widowed (32-34%), as well as separated & widowed (34-38%), and separated & divorced (38-41%).
**See Post Hoc Chi-Square Test results @ https://www.dropbox.com/s/4volavdeg7c91qe/chisq%20post%20hoc%20results.txt?dl=0
**See Python file @ https://www.dropbox.com/s/xw1davtgertxfpc/datatools-week2.py?dl=0
0 notes
Text
Data Tools Week 1 - ANOVA Tests
When examining the association between age of onset of depression (quantitative response) and marital status (categorical explanatory), an Analysis of Variance (ANOVA) revealed that the age of onset is different amongst different marital groups, F(5, 8701) = 538.8, p<0.001.
OLS Regression Results ===================================================
Dep. Variable: S4AQ6A R-squared: 0.236 Model: OLS Adj. R-squared: 0.236 Method: Least Squares F-statistic: 538.8 Date: Sat, 25 May 2019 Prob (F-statistic): 0.00 Time: 15:26:04 Log-Likelihood: -34988. No. Observations: 8707 AIC: 6.999e+04 Df Residuals: 8701 BIC: 7.003e+04 Df Model: 5 Covariance Type: nonrobust ==================================================== coef std err t P>|t| [0.025 0.975] -------------------------------------------------------------------------------------------- Intercept 31.4052 0.226 138.885 0.000 30.962 31.848 C(M)[T.Cohabiting] -7.1963 0.820 -8.780 0.000 -8.803 -5.590 C(M)[T.Widowed] 19.4415 0.521 37.306 0.000 18.420 20.463 C(M)[T.Divorced] 0.6863 0.407 1.687 0.092 -0.111 1.484 C(M)[T.Separated] -0.4389 0.698 -0.628 0.530 -1.808 0.930 C(M)[T.Single] -8.9159 0.374 -23.869 0.000 -9.648 -8.184 ====================================================
Omnibus: 489.041 Durbin-Watson: 1.983 Prob(Omnibus): 0.000 Jarque-Bera (JB): 628.033 Skew: 0.545 Prob(JB): 4.21e-137 Kurtosis: 3.736 Cond. No. 6.22
====================================================
Box plot (above) is from Week 4 of the Data Visualisation & Management Course. The median ages of depression (first episode) are shown for each marital group.
Post hoc comparisons of mean age of depression by marital status revealed that the never married group (i.e. cohabiting/single) has their first episode of depression at a significantly lower age (Mean = 22.5-24.2) compared to the married/ previously married group (Mean = 31.4-50.8).
In addition, the widowed group has their first episode of depression at a significantly higher age (Mean = 50.8, s.d. ± 19.1) than all the other groups.
====================================================
Mean Age of Depression (Onset of First Episode)
-Married 31.405192 -Cohabiting 24.208904 -Widowed 50.846715 -Divorced 32.091540 -Separated 30.966265 -Single 22.489268
Standard Deviations for Age of Onset
-Married 13.763518 -Cohabiting 10.669714 -Widowed 19.087040 -Divorced 13.267493 -Separated 12.547256 -Single 10.583011
Multiple Comparison of Means - Tukey HSD,FWER=0.05 ==================================================== group1 group2 meandiff lower upper reject ----------------------------------------------------- Cohabiting Divorced 7.8826 5.439 10.3262 True Cohabiting Married 7.1963 4.8602 9.5323 True Cohabiting Separated 6.7574 3.8266 9.6881 True Cohabiting Single -1.7196 -4.1196 0.6803 False Cohabiting Widowed 26.6378 24.0239 29.2518 True Divorced Married -0.6863 -1.846 0.4733 False Divorced Separated -1.1253 -3.2411 0.9906 False Divorced Single -9.6023 -10.8858 -8.3187 True Divorced Widowed 18.7552 17.1058 20.4045 True Married Separated -0.4389 -2.4296 1.5518 False Married Single -8.9159 -9.9806 -7.8512 True Married Widowed 19.4415 17.9561 20.9269 True Separated Single -8.477 -10.5423 -6.4117 True Separated Widowed 19.8805 17.5699 22.191 True Single Widowed 28.3574 26.7734 29.9415 True -----------------------------------------------------
**See Python file @ https://www.dropbox.com/s/50bgn8rv14lfw15/datatools-week1.py?dl=0
0 notes
Text
Data Visualisation & Management (Week 4)
A univariate plot showing the distribution of depressed respondents by their marital status. Although the highest proportion of depressed respondents is married based on the univariate plot (above), a graph showing the percentage of depressed respondents within each marital group (below) provides more insight on the association between marriage and depression.
Currently married respondents have the lowest incidence of depression while previously married respondents (widowed, separated and divorced) have the highest incidence of depression.
Age of onset is the earliest for the never-married group (median age 20-22 yrs) and the highest for the widowed group (52 yrs).
Number of episodes seem to be related to the age of onset. While the previously married group has the highest incidence of depression, number of episodes tend to be fewer. The median number of episodes is 1 for the currently married group while the median number of episodes is 2 for the never married group.
Personal annual income is highest for both the currently married and divorced groups, and lowest for the widowed group.
Depression seems to be inversely related to personal annual income.
However, while the currently married and divorced groups have the highest income range, the divorced group has the highest incidence of depression and the currently married group has the lowest incidence of depression (see second graph above).
Interestingly, it is the high income group in the never married group that is likely to have the highest number of depression episodes. The high income group in the previously married group is likely to have the fewest number of episodes.
This is a figure showing the distribution of depressed respondents by age group and marital status. Generally, the never married group have their first episodes of depression in their youth before the expected age of marriage and the previously married group at an older age after marriage.
**See Python file @ https://www.dropbox.com/s/93rsyuyrnz1r85x/week4.py?dl=0
0 notes
Text
Data Management & Visualisation (Week 3)
To get a deeper understanding of how depression is related to marriage, next I look at when depression occurs in relation to marriage, as well as the general distribution in each age group.
In summary, the median age of depression for the never married group is the lowest (20 yrs old) while the previously married group (ie currently widowed, divorced or separated) is the highest (35 yrs old). For the currently married group, the median age is 29 yrs old.
The median age of marriage for the whole sample population is 22 yrs old. It appears that depression occurs more frequently before the 'expected' age of marriage for the group which never married (median -2 years), while for the married group, it mostly occurred after marriage.
While the incidence of depression is the lowest for the currently married group (25.7% from week 1), it is interesting to observe that about 2/3 of the episodes happens after marriage (median 7 years after marriage) and about 2/3 of the respondents are females. For the previously married group, 4/5 of the episodes happened after marriage (median 13 years after marriage) and about 3/4 of them are females.
However, in terms of severity (number of episodes), the group which never married has the highest percentage of respondents having recurrent episodes (> 3 times) - 18.1% as compared to 12.3% & 14% in the other groups. This could possibly be related to the earlier age of onset for the never married group.
In terms of income, the group which never married/depressed has a slightly higher proportion of respondents in the low income group(<$25K annual income) while the group which is currently married/depressed has a slightly higher proportion of respondents in the high income group (>$70K).
**See Python file @ https://www.dropbox.com/s/78ehj91xqad3zc4/week3.py?dl=0
0 notes
Text
Data Management & Visualisation (Week 2)
NESARC is a cross-sectional survey on Alcohol & related conditions based on a nationally representative sample of the civilian noninstitutionalized population of the United States aged 18 years and older.
A random sample of 43,093 adults were asked if they ever had a 2 week period when they felt sad, blue, depressed, or down most of the time. Of the total number, about 29.7% chose category 1 (yes) and 68.2% chose category 2 (No). 2.1% did not respond
Of the total sample, 48.2% were married, 3% were cohabiting, 9.9% were widowed, 12.5% were divorced, 3.4% were separated, and 23% never married.
Of the sample who responded that they had experienced depression symptoms, 41.7% were married, 3.2% were cohabiting, 11.2% were widowed, 17% were divorced, 4.2% were separated, and 22.7% never married.
As compared to the total sample population, a higher proportion of the depressed population were widowed/divorced/separated. While there was a slightly lower percentage of married respondents, the percentage of respondents who were never married was also slightly lower.
While only 25.7% of the married respondents experienced depression symptoms (slightly lower than those who never married - 29.3%), 40.2%, 37.7% and 33.5% of the divorced, separated and widowed respondents experienced depression symptoms respectively.
Frequency tables for S4AQ6A (Age at onset of First Episode) and S1Q4A (Age at First Marriage) were also generated but the results are too lengthy. These results will be grouped and analysed in Week 3. To see the output for these variables, you can run the program below in python.
**See Python file @ https://www.dropbox.com/s/twry4peig7i4q3a/week2.py?dl=0
0 notes
Text
Data management & visualisation (Week 1)
After looking through the codebook for the NESARC study, I decided to study if depression is related to marriage.
The relevant variables I’ve chosen are listed below:
×S4AQ1 - EVER HAD 2-WEEK PERIOD WHEN FELT SAD, BLUE, DEPRESSED, OR DOWN MOST OF TIME
×S4AQ6A - AGE AT ONSET OF FIRST EPISODE
xS4AQ7 - NUMBER OF EPISODES (> 2wks)
×S1Q4A - AGE AT FIRST MARRIAGE
×MARITAL - CURRENT MARITAL STATUS (Married, Cohabiting, Widowed, Divorced, Separated, Never Married)
xS1Q10B - TOTAL PERSONAL INCOME IN LAST 12 MONTHS: CATEGORY
xSEX - MALE/ FEMALE
Literature Review:
Studies have consistently found that transitions into marriage are associated with reductions in depressive symptoms, while transitions out of marriage are associated with increases in them (1).
Kessler et.al (2) found that married people have lower depression rates because they are emotionally less damaged by stressful experiences than are un-married people.
Accordng to Ross et al (3), research on the social patterns of depression in the community finds consistently that high levels of education and income, being male, and being married are associated with lower levels of depression.
Frech et. al. (4) found that those who were depressed prior to marrying report larger psychological gains from marriage than those who were not depressed. What appear to be strong average benefits of marriage are actually highly dependent on a range of individual, interpersonal, and structural characteristics. Mirowsky et al. supports this argument by nothing that depression reaches its highers level in adults 80 years old or older, because physical dysfunction and low personal control add to personal and status losses.
Uecker et al. (5) found that married young adults—especially those who first married at age 22–26—report higher life satisfaction than those in other types of relationships or no relationship at all, as well as those who married at younger ages.
References
1. Robert G. Wood, Brian Goesling, Sarah Avellar (2007) The Effects of Marriage on Health: A Synthesis of Recent Research Evidence. Mathematica Policy Reserch, Inc.
2. Ronald C. Kessler, Marilyn Essex; Marital Status and Depression: The Importance of Coping Resources, Social Forces, Volume 61, Issue 2, 1 December 1982, Pages 484–507, https://doi.org/10.1093/sf/61.2.484
3. Ross, C., & Mirowsky, J. (1989). Explaining the Social Patterns of Depression: Control and Problem Solving--or Support and Talking? Journal of Health and Social Behavior, 30(2), 206-219. Retrieved from http://www.jstor.org/stable/2137014
4. Frech, A., & Williams, K. (2007). Depression and the Psychological Benefits of Entering Marriage. Journal of Health and Social Behavior, 48(2), 149–163. https://doi.org/10.1177/002214650704800204
5. Uecker, J. E. (2012). Marriage and Mental Health among Young Adults. Journal of Health and Social Behavior, 53(1), 67–83. https://doi.org/10.1177/0022146511419206 (https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3390929/)
Hypothesis: Marriage leads to a reduction in depression, but it could also be influenced by levels of income, age and gender.
1 note
·
View note