technicallyjovialfestival
technicallyjovialfestival
Alcohol Impact - Research
2 posts
Don't wanna be here? Send us removal request.
technicallyjovialfestival · 3 years ago
Text
Alcohol Impact - Research -Python script and output
Following is the overview of what was consider for writing the below mentioned python script for Alcohol impact research.
Frequency distribution variables considered in below script:
VarAlcoholDependentCount - List the count of people who require more Alcohol consumption every time and who does not.
VarAlcoholDependentPercent - List the Percentage of people who require more Alcohol consumption every time and who doe not.
VarYoungGroupList - Age wise count of people (between age 15 to 25) who show tendency of having increase in alcohol consumption then last time and they have developed alcohol dependence.
VarMiddleAgeGroupList - Age wise count of people (between age 26 to 40) who show tendency of having increase in alcohol consumption then last time and they have developed alcohol dependence.
VarOldAgeGroupList - Age wise count of people (between age 26 to 40) who show tendency of having increase in alcohol consumption then last time and they have developed alcohol dependence.
The missing data in this research is Blank data & data assign against value 2 & 9. Where data for value 2& 9 are people who are not showing increase in alcohol consumption or who have reported not applicable.
As per analysis we found that people with age 18 have more tendency to increase consumption of alcohol and have alcohol dependence.
#-------Python Script Start -------------------
# -*- coding: utf-8 -*- """ Created on Fri Jan 28 10:50:43 2022
@author: Renal R """
import pandas import numpy # any additional libraries would be imported here
data = pandas.read_csv('nesarc_pds.csv', low_memory=False)
#Conversion to numeric is failing as there are around 19% blank records. #data['S2BQ1A4'] = pandas.to_numeric(data['S2BQ1A4']) #data['S2BQ2D'] = pandas.to_numeric(data['S2BQ2D'])
#counts and percentages (i.e. frequency distributions) for each variable print("Count of the people who do and donot show the increase in Alcohol dependency /n") VarAlcoholDependentCount = data['S2BQ1A4'].value_counts(sort=False) print (VarAlcoholDependentCount) print("Percent of the people who do and donot show the increase in Alcohol dependency /n") VarAlcoholDependentPercent = data['S2BQ1A4'].value_counts(sort=False, normalize=True) print (VarAlcoholDependentPercent)
#As per this project we have 3 groups. Let us identify the subset of each group and print it. print("The list of young group (age 15 to 25) of people who show gradual increase in alcohol consumption and show alcohol dependence ") YoungGroupList = data[(data['S2BQ2D']>=str(15)) & (data['S2BQ2D']<=str(25)) & (data['S2BQ1A4']==str(1))] YoungGroupList2 = YoungGroupList.copy() VarYoungGroupList = YoungGroupList2['S2BQ2D'].value_counts(sort=False) print (VarYoungGroupList)
print("The list of middle age group (age 26 to 40) of people who show gradual increase in alcohol consumption and show alcohol dependence ") MiddleAgeGroupList = data[(data['S2BQ2D']>=str(26)) & (data['S2BQ2D']<=str(40)) & (data['S2BQ1A4']==str(1))] MiddleAgeGroupList2 = MiddleAgeGroupList.copy() VarMiddleAgeGroupList = MiddleAgeGroupList2['S2BQ2D'].value_counts(sort=False) print (VarMiddleAgeGroupList)
print("The list of old group (age 41 to 80) of people who show gradual increase in alcohol consumption and show alcohol dependence ") OldAgeGroupList = data[(data['S2BQ2D']>=str(41)) & (data['S2BQ2D']<=str(80)) & (data['S2BQ1A4']==str(1))] OldAgeGroupList2 = OldAgeGroupList.copy() VarOldAgeGroupList = OldAgeGroupList2['S2BQ2D'].value_counts(sort=False) print (VarOldAgeGroupList)
# bug fix for display formats to avoid run time errors - put after code for loading data above pandas.set_option('display.float_format', lambda x:'%f'%x)
#-------Python Script End --------------------
#-------Python Script Output - Start --------------------
In [11]: runfile('C:/Users/rerodrig/.spyder-py3/temp.py', wdir='C:/Users/rerodrig/.spyder-py3')
Count of the people who do and donot show the increase in Alcohol dependency /n
     8266
2    31467
1     3048
9      312
Name: S2BQ1A4, dtype: int64
Percent of the people who do and donot show the increase in Alcohol dependency /n
   0.191818
2   0.730211
1   0.070731
9   0.007240
Name: S2BQ1A4, dtype: float64
The list of young group (age 15 to 25) of people who show gradual increase in alcohol consumption and show alcohol dependence
18    269
20    172
16     99
21    158
23     77
24     49
15     58
25    109
22    116
17    134
19    193
Name: S2BQ2D, dtype: int64
The list of middle age group (age 26 to 40) of people who show gradual increase in alcohol consumption and show alcohol dependence
37    13
34    20
27    30
40    33
30    69
28    39
33    16
39    12
31    16
36    16
29    22
26    31
35    41
38    22
32    27
Name: S2BQ2D, dtype: int64
The list of old group (age 41 to 80) of people who show gradual increase in alcohol consumption and show alcohol dependence
42     8
57     2
48    10
58     1
51     1
43     8
44     9
65     2
41     9
56     7
50     7
45    22
49     4
47     3
6      1
53     2
70     1
80     1
46     8
64     1
67     1
52     1
8      2
66     1
55     2
59     2
60     1
63     1
Name: S2BQ2D, dtype: int64
In [12]:
#-------Python Script Output - End --------------------
0 notes
technicallyjovialfestival · 3 years ago
Text
Alcohol Impact
With this data analysis I would like to research if someone starts consuming liquor, is there a tendency of gradual increase in the quantity of liquor consumption. We will further compare and identify which age group have developed the alcohol dependence. Thus confirming the hypothesis of the risk of small start of liquor consumption could lead to gradual increase in quantity of consumption and alcohol dependence.
The results will be divided in following age groups:
Young (15 to 25), Middle age (26 to 40), Older (40 to 90).
For research of data I have come up with below mentioned question referring to codebook for the NESARC study. 
“At what age group people increase drinking Liquor as formal quantity of consumption no longer gave desire effect?”
Codebook reference: S2BQ1A4, S2BQ2D.
Following is my codebook:
S2BQ1A4 - Increase drinking because amount formerly consumed no longer gave desired effect 1 - Increase drinking 2 - No effect 9 - Unknown BL - Not applicable
S2BQ2D - Age at alcohol dependence 6 to 80 - Age of alcohol dependence 99 - Unknown BL - Not applicable
1 note · View note