Tumgik
itstwinstarrr · 4 years
Text
DATA ANALYSIS TOOLS
HYPOTHESIS TESTING AND ANOVA
MY RESEARCH QUESTION:
Is major depression associated with CANNABIS joints smoking quantity among adult unemployed smokers?
Following is the code used to run an ANOVA:
import numpy import pandas import statsmodels.formula.api as smf import statsmodels.stats.multicomp as multi
data=pandas.read_csv('_c10361280c0613304594ab464c014f47_nesarc_pds.csv',low_memory=False)
sub1=data[(data['AGE']>=18) & (data['AGE']<=60) & ((data['S1Q7A6']==1)|(data['S1Q7A7']==1)|(data['S1Q7A8']==1)|(data['S1Q7A10']))]
sub2 = sub1.copy()
sub2['S3BD5Q2C']=pandas.to_numeric(sub2['S3BD5Q2C'],errors='coerce') sub2['S3BQ3']=pandas.to_numeric(sub2['S3BQ3'],errors='coerce')
sub2["S3BD5Q2C"]=sub2["S3BD5Q2C"].replace(99,numpy.nan) sub2['MAJORDEPLIFE']=pandas.to_numeric(sub2['MAJORDEPLIFE'],errors='coerce')
sub2.loc[(sub2['S3BQ1A5']!=9)&(sub2['S3BD5Q2C'].isnull()),'S3BD5Q2C']=11
recode11 = {1: 365, 2: 300, 3: 182, 4: 78, 5: 30, 6: 12,7: 9,8: 4.5,9: 2,10: 1,11:11} sub2['USFREQCNB']= sub2['S3BD5Q2C'].map(recode11)
sub2['NUMCNB_JSY']=sub2['USFREQCNB']*sub2["S3BQ3"]
sub2['NUMCNB_JSY']=pandas.to_numeric(sub2['NUMCNB_JSY'],errors='coerce')
sub2['Jointspermonth']=sub2['NUMCNB_JSY']/12
ct1 = sub2.groupby('Jointspermonth').size() print (ct1)
### using ols function for calculating the F-statistic and associated p value
model1 = smf.ols(formula='Jointspermonth ~ C(MAJORDEPLIFE)', data=sub2)
results1 = model1.fit()
print (results1.summary())
sub3 = sub2[['Jointspermonth', 'MAJORDEPLIFE']].dropna()
print ('means for Jointspermonth by major depression status') m1= sub3.groupby('MAJORDEPLIFE').mean() print (m1)
print ('standard deviations for jointspermonth by major depression status') sd1 = sub3.groupby('MAJORDEPLIFE').std() print (sd1)
###Using Ethnicity variable with more than two levels
sub4 = sub2[['Jointspermonth', 'ETHRACE2A']].dropna()
model2 = smf.ols(formula='Jointspermonth ~ C(ETHRACE2A)', data=sub4).fit() print (model2.summary())
print ('means for Jointspermonth by ethnicity status') m2= sub4.groupby('ETHRACE2A').mean() print (m2)
print ('standard deviations for Jointspermonth by ethnicity status') sd2 = sub4.groupby('ETHRACE2A').std() print (sd2)
###Post hoc test
mc1 = multi.MultiComparison(sub4['Jointspermonth'], sub4['ETHRACE2A']) res1 = mc1.tukeyhsd() print(res1.summary())
OUTPUT OF THE ABOVE CODE:
Output of F statistics and p value for jointspermonth and major depression:
Tumblr media
Output of F statistics and p value for jointspermonth and ethnicity:
Tumblr media
Output of the TUKEY Post Hoc Test:
Tumblr media
SUMMARY:
Model Interpretation for ANOVA:
When examining the association between current number of CANNABIS joints smoked (quantitative response) and lifetime major depression (categorical explanatory), an Analysis of Variance (ANOVA) revealed that among adult, unemployed smokers (my sample), those with major depression reported smoking more cigarettes per month (Mean=57.22, s.d. ±262.40) compared to those without major depression (Mean=50.26, s.d. ±236.26), F(1, 1600)=0.2913, p>0.05. Since, p value is greater than 0.05, we can confidently accept the null hypothesis and conclude that there is no association between major depression and CANNABIS joints smoked per year.
Model Interpretation for ANOVA: Explanatory variables with more than 2 levels:
We check the association between CANNABIS joints smoking quantity and ethnicty, this is a variable with 5 levels. As per the output obtained, the American Indian, Alaskan Native ethnic group smokes maximum number of joints in a month i.e. 121.08 and the white ethnic group smokes least number of joints in a month i.e. 38.18. The F-statistics value is F(4,1597)=3.949 and p-value=0.00341.Since, p value is less than 0.05, we can confidently reject the null hypothesis and accept the alternate hypothesis and conclude that there is a relation between the quantity of CANNABIS joints smoked per month and the ethnicity of the person.
Post hoc comparisons of mean number of CANNABIS joints smoked per month by pairs of the ethnicity groups revealed that those individuals who belong to the WHITE ethnic group reported smoking significantly less number of CANNABIS joints per month compared to the BLACK ethnic group and as a result for this comparison the null hypothesis can be rejected.  All other comparisons were statistically similar.
3 notes · View notes
itstwinstarrr · 4 years
Text
Creating Graphs for your Data
UNIVARIATE GRAPHS FOR EACH OF THE SELECTED VARIABLES
INPUT CODE:
Tumblr media Tumblr media
OUTPUT GRAPHS:
Tumblr media Tumblr media Tumblr media
BIVARIATE GRAPHS OF THE SELECTED VARIABLES
INPUT CODE:
Tumblr media
OUTPUT GRAPH:
Tumblr media
INPUT CODE:
Tumblr media
OUTPUT GRAPHS:
Tumblr media
INPUT CODE:
Tumblr media
OUTPUT GRAPH:
Tumblr media
INPUT CODE:
Tumblr media
OUTPUT GRAPH:
Tumblr media
SUMMARY OBTAINED FROM THE UNI VARIATE AND BI VARIATE GRAPHS
Around 3050 people have suffered from major depression in the last 12 months.Most people on an average smoke around 500 CANNABIS joints in a year.The regularity of smoking joints is quite high.Around 40% of the people who suffer from major depression have smoked CANNABIS joint at least once. The usage of CANNABIS among the depressed people is much higher as compared to the ones who are not depressed. The people who suffer from depression on an average smoke 380 joints in a year.A negative relationship can be observed between Age and the Number of cannabis joints smoked in a year i.e. as people get older their smoking of joints reduces.
P.S: 
MY VARIABLES WERE SUCH THAT A QUANTITATIVE TO QUANTITATIVE SCATTER PLOT WAS NOT REQUIRED TO ANSWER MY RESEARCH QUESTIONS.
0 notes
itstwinstarrr · 4 years
Text
Making Data Management Decisions
INPUT CODE FOR SETTING ASIDE MISSING DATA
Tumblr media Tumblr media
INPUT CODE FOR CODING VALID DATA USING DUMMY VALUE AND INPUT CODE FOR MAKING DATA MORE INFORMATIVE
Tumblr media
In the above picture, 365 shows that on 365 days in a year CANNABIS was used, 300 shows that on approximately 300 days in a year CANNABIS was used and so on..
INPUT CODE FOR CREATING SECONDARY VARIABLE 
Tumblr media
OUTPUT OF THE ABOVE CODE
Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media
INPUT CODE FOR CREATING VARIABLES OF ETHNICITY
Tumblr media Tumblr media Tumblr media
OUTPUT OF THE ABOVE CODE
Tumblr media Tumblr media Tumblr media Tumblr media
INPUT CODE FOR GROUPING THE AGE VARIABLE
Tumblr media
OUTPUT OF THE ABOVE CODE
Tumblr media Tumblr media Tumblr media Tumblr media
SUMMARY
All six of my variables had missing data,so they had to be set to NAN/ missing. To make the survey questions appropriate and to create a skip pattern, a value of 11 was assigned to all those who had initially answered that they don’t use cannabis or that they don’t use opioids, so that the data for them in the further questions of the survey could be easily found. To make the data more informative, the variable values were coded such that the people who used more Cannabis/ Opioids were denoted with a larger number. This made the data more logical and easier to interpret. A secondary variable denoting, the number of CANNABIS joints smoked in a year, was created using two primary variables.Another secondary variable, ETHNICITY, denoting the ethnicity of the subset considered was made. From this variable’s frequency distribution it can be concluded that 53% of the people, considered in the subset, are White, 21.6% are of Hispanic or Latino Origin, 19.3% are Black or African American, 2% and 3% are from American Indian and Asian origin respectively and the rest are Native Hawaiian or other Pacific Islander. The Age variable was grouped into 4 bins from 18-30,31-40,41-50,51-60. It can be observed that maximum people are from the age group of 18-30 years and minimum are from the age group of 50-60 years. 
0 notes
itstwinstarrr · 4 years
Text
Running your First Program(Assignment 2)
SOME POSTS RELATED TO THE FIRST ASSIGNMENT ARE COMING IN THE MIDDLE SO PLEASE SCROLL DOWN FOR REST OF THE POSTS RELATED TO MY ASSIGNMENT 2!!!!!
Original Research Question:-
Are major depression and medicine use associated? (Time Period-Last 12 Months)
Refined Research Question:-
Are major depression and medicine use associated among young unemployed adults? (Time Period-Last 12 Months)
Input program for loading the data set, obtaining the frequency distribution of my chosen variables and selecting the relevant columns for my refined question.
Tumblr media Tumblr media Tumblr media
0 notes
itstwinstarrr · 4 years
Text
Code for obtaining the Frequency Tables
Tumblr media
0 notes
itstwinstarrr · 4 years
Text
Output Tables Of the Frequency Distribution
Tumblr media Tumblr media
0 notes
itstwinstarrr · 4 years
Text
Summary Of Frequency Distribution
It can be observed from the value that around 8 percent of the population surveyed suffers from depression.1 percent of the population comes under the age of 18 to 35 and  839 of them are unemployed.0.144 percent of the population consumes sedatives.130 people are victims of Opioid abuse and/or dependence. 97 denizens are victims of Cocain abuse and/or dependence. Only 7 people in the surveyed population consume Heroin. Only 2 people consume drugs other than the ones mentioned above.
0 notes
itstwinstarrr · 4 years
Text
Introduction
The world is being besieged by the continuous spread of the COVID-19 virus. Governments all over the world have implemented lockdowns and people are being forced to stay at home and this has created financial and emotional stress. As a consequence, people have started feeling depressed. There is a very high probability that longer it takes for the world to deal with the virus, more people will succumb to depression and as a ramification, to cope with this they may start consuming harmful medicines.
Keeping in mind the pertinent scenario I have chosen the U.S. National Epidemiological Survey on Alcohol and Related Conditions (NESARC) data book. I have decided to study major depression and medicine use i.e. whether major depression is associated with medicine use?
1 note · View note
itstwinstarrr · 4 years
Text
My Hypothesis
Depression is marked by a constant sense of hopelessness and despair. With major depression, it may be difficult to work, study, sleep, eat, and enjoy friends and activities. Symptoms of depression can be feeling exhausted almost every day, lack of sleep or excessive sleeping, recurring thoughts of death and suicide, feeling worthless almost every day and a lot more. It can be very difficult to deal with these feelings independently. We live in a society that even now finds the topics of mental health and depression to be abstruse, which makes it arduous for depressed people to seek help. As a ramification of this, out of desperation, people may turn to medicine and drug use to make themselves feel better.
I think that people with major depression may be more likely to seek medicine or drug treatment than those without such comorbidities. The people suffering from depression are vulnerable and there is a relation between depression and substance use disorder.
0 notes
itstwinstarrr · 4 years
Text
Literature Review
Major depression and irregular sleeping habits
Sleep disorders are frequently associated with a wide range of psychiatrics illnesses and are regarded as a characteristic feature of depressive disorder. Depressed patients often report inadequate or non-restorative sleep, as well as difficulty in falling asleep, frequent nocturnal and early morning awakening, decreased total sleep and disturbing dreams.
Here is a link which elaborates about the study done one
Sleep disorders and suicidal ideation in patients with depressive disorder
https://orbi.uliege.be/bitstream/2268/171520/1/Chellappa_Pyschiatry%20Res_2007.pdf
 Here is another link about
Associations between sleep quality, suicidality, and depressive symptoms in patients with major depression and healthy controls
In the current study, the authors investigated the possible effects of sleep quality and chronotype on the severity of depressive symptoms and suicide risk in patients with depressive disorder and healthy controls. 
Results are as follows: (a) logistic regression analyses revealed that poor sleep quality and depression symptom severity significantly predicted onset of major depression; (c) sleep variables of chronotype and sleep quality did not significantly predict suicide ideation after controlling for depressive symptoms in the major depression group; and (d) suicide ideation and poor sleep quality were antecedents of depression symptom severity in patients with major depression, and in healthy controls.
https://www.tandfonline.com/doi/abs/10.3109/07420528.2010.516380#.XwobZVtGMCw.link
0 notes
itstwinstarrr · 4 years
Text
Depression and medicine/drug use.
The role of drug and alcohol abuse in recent increases in depression in the US
Concurrent with the increase in rates of depression, there have been increases in rates of drug and alcohol abuse and dependence. This study sought to determine if the recent increase in rates of depression could be attributed to co-morbid alcohol and drug abuse. The data derived from two studies: (1) a sample of relatives of probands with affective disorder; and (2) a community survey of the US population. The piecewise exponential statistical model was applied to evaluate the association of gender, age, period and birth cohort with rates of major depressive disorder (MDD) separately for those with, and without, diagnoses of alcohol or drug abuse.
https://doi.org/10.1017/S0033291700034735
  This is a study on
Adolescent depression, alcohol and drug abuse.
 Results show that…
Subjects who met DSM III criteria for abuse of any prescription drug were classified as drug abusers, irrespective of what drug they used. Marijuana was the drug most frequently abused. Report of heroin and cocaine abuse was rare and tended to be part of poly drug abuse. Like alcohol, drug abuse is strongly associated with a lifetime prevalence of MDD (Table 2). Overall, subjects who qualified as drug abusers were 3.3 times as likely as nonabusers to have history of MDD.
https://ajp.psychiatryonline.org/doi/pdf/10.1176/ajp.2006.163.12.2141
0 notes
itstwinstarrr · 4 years
Text
The variables related to major depression that I have considered for my research are as follows
1.    EVER HAD 2-WEEK PERIOD WHEN FELT SAD, BLUE, DEPRESSED, OR DOWN MOST OF TIME
2.    EVER HAD 2-WEEK PERIOD WHEN DIDN'T CARE ABOUT THINGS USUALLY CARED ABOUT
3.    HAD TROUBLE FALLING ASLEEP NEARLY EVERY DAY FOR 2+ WEEKS
4.    WOKE UP TOO EARLY NEARLY EVERY DAY FOR 2+ WEEKS
5.    SLEPT MORE THAN USUAL NEARLY EVERY DAY FOR 2+ WEEKS
6.    FELT TIRED/EASILY TIRED NEARLY EVERY DAY FOR 2+ WEEKS, WHEN NOT DOING MORE THAN USUAL
7.    FELT WORTHLESS MOST OF THE TIME FOR 2+ WEEKS
8.    ATTEMPTED SUICIDE
9.    THOUGHT ABOUT COMMITTING SUICIDE
10.  FELT LIKE WANTED TO DIE
11.  THOUGHT A LOT ABOUT OWN DEATH
0 notes
itstwinstarrr · 4 years
Text
The variables related to medicine use that I have considered for my research are as follows
1.      EVER USED SEDATIVES
2.      EVER USED TRANQUILIZERS
3.      EVER USED OPIOIDS
4.      EVER USED COCAINE OR CRAC
5.      EVER USED HEROIN
6.      EVER USED OTHER DRUGS
7.      DRUG USE STATUS
8.      TIME FRAME FOR ANY DRUG USE
1 note · View note