Making my first program assigment
This is my code in python:
#-- coding: utf-8 --
"""
Spyder Editor
This is a temporary script file.
"""
import pandas as pd
import numpy as np
data = pd.read_csv('nesarc_pds.csv', low_memory=False)
print(len(data))
print("counts for S2AQ1 usual quantity for drank at least 1 alcoholic drink in life by:"
"1=yes and 2=no")
c1=data['S2AQ1'].value_counts(sort=False, dropna=False)
print(c1)
print("percentages for S2AQ1 usual quantity for drank at least 1 alcoholic drink in life by:"
"1=yes and 2=no")
p1=data['S2AQ1'].value_counts(sort=False,dropna=False, normalize=True)
print(p1)
print("counts for S2AQ2 usual quantity for drank at least 12 alcoholic drink in last 12 months by:"
"1=yes, 2=no and 9=unknown")
c2=data['S2AQ2'].value_counts(sort=False, dropna=False)
print(c2)
print("percentage for S2AQ2 usual quantity for drank at least 12 alcoholic drink in last 12 months by:"
"1=yes, 2=no and 9=unknown")
p2=data['S2AQ2'].value_counts(sort=False, dropna=False, normalize=True)
print(p2)
print("counts for CONSUMER usual quatity the drinkins status categorizaded by:"
"1=Current drinker, 2=Ex-drinker and 3=Lifetime Abstainer")
c3=data['CONSUMER'].value_counts(sort=False, dropna=False)
print(c3)
print("percentages for CONSUMER usual quatity the drinkins status categorizaded by:"
"1=Current drinker, 2=Ex-drinker and 3=Lifetime Abstainer")
p3=data['CONSUMER'].value_counts(sort=False,normalize=True, dropna=False)
print(p3)
#As a subcollection I choose to work with people who are between 18 and 28 years old and they are currently drinkers
sub1=data[(data["AGE"]>=18) & (data["AGE"]<28) & (data["CONSUMER"]==1)]
sub2=sub1.copy()
#Now we can see if my sample its correctly
print("Counts for Age")
c4=sub2["AGE"].value_counts(sort=False)
print(c4)
print("Percentages for Age")
c5=sub2["AGE"].value_counts(sort=False, normalize=True)
print(c5)
print("Counts for CONSUMER")
c6=sub2["CONSUMER"].value_counts(sort=False)
print(c6)
print("Percentages for CONSUMER")
c7=sub2["CONSUMER"].value_counts(sort=False, normalize=True)
print("So we can see that just 5047 of the 43093 individuals are currently consumers and they are between 18 and 28 years old")
And his output is:
43093
counts for S2AQ1 usual quantity for drank at least 1 alcoholic drink in life by:1=yes and 2=no
S2AQ1
2 8266
1 34827
Name: count, dtype: int64
percentages for S2AQ1 usual quantity for drank at least 1 alcoholic drink in life by:1=yes and 2=no
S2AQ1
2 0.191818
1 0.808182
Name: proportion, dtype: float64
counts for S2AQ2 usual quantity for drank at least 12 alcoholic drink in last 12 months by:1=yes, 2=no and 9=unknown
S2AQ2
2 22225
1 20836
9 32
Name: count, dtype: int64
percentage for S2AQ2 usual quantity for drank at least 12 alcoholic drink in last 12 months by:1=yes, 2=no and 9=unknown
S2AQ2
2 0.515745
1 0.483512
9 0.000743
Name: proportion, dtype: float64
counts for CONSUMER usual quatity the drinkins status categorizaded by:1=Current drinker, 2=Ex-drinker and 3=Lifetime Abstainer
CONSUMER
3 8266
1 26946
2 7881
Name: count, dtype: int64
percentages for CONSUMER usual quatity the drinkins status categorizaded by:1=Current drinker, 2=Ex-drinker and 3=Lifetime Abstainer
CONSUMER
3 0.191818
1 0.625299
2 0.182884
Name: proportion, dtype: float64
Counts for Age
AGE
19 465
18 401
21 560
25 488
22 531
20 476
24 582
26 476
23 536
27 532
Name: count, dtype: int64
Percentages for Age
AGE
19 0.092134
18 0.079453
21 0.110957
25 0.096691
22 0.105211
20 0.094313
24 0.115316
26 0.094313
23 0.106202
27 0.105409
Name: proportion, dtype: float64
Counts for CONSUMER
CONSUMER
1 5047
Name: count, dtype: int64
Percentages for CONSUMER
So we can see that just 5047 of the 43093 individuals are currently consumers and they are between 18 and 28 years old
0 notes
My hypothesis
Based on what has been researched I think that people with high levels of stress or sadness and/or anxiety often turn to alcohol to distract themselves.
0 notes
Bibliographic review
Valarezo-Bravo, O. F., Erazo-Castro, R. F., & Muñoz-Vinces, Z. M. (2021). Síntomas de ansiedad y depresión asociados a los niveles de riesgo del consumo de alcohol y tabaco en adolescentes de la ciudad de Loja, Ecuador. Health & Addictions/Salud y Drogas, 21(1).
Higareda-Sánchez, J. J., Rivera, S., Reidl, L. M., Flores, M. M., & Romero, A. (2021). CONSUMO DE ALCOHOL Y RASGOS DE ANSIEDAD Y DEPRESIÓN EN ADOLESCENTES ESCOLARIZADOS. Health & Addictions/Salud y Drogas, 21(2).
Hervás, E. S. (1995). Depresión, ansiedad y consumo de drogas. Análisis y modificación de conducta, 21(79), 735-743.
Cordero García, J. D., & Pacheco Pacheco, D. H. (2010). Prevalencia de la Ansiedad, Depresión y Alcoholismo en estudiantes de Medicina (Bachelor's thesis, Universidad del Azuay).
In most of the studies carried out it was found that on the one hand, self-esteem establishes negative and significant correlations with the
variables depression, anxiety and stress, so that the students with higher levels of depression, anxiety and/or stress present, at the same time they have a lower level of self-esteem. On the other hand, the depression variable is related to the stress and anxiety variables in a way significant and positive, that is, the higher the level of depression, the higher the levels of anxiety and stress. In addition, the anxiety and stress variables also establish positive correlations and significant
0 notes
Selection of research topic
By reading the different code books available, I decided on the NESARC study code book since it contained some topics of my interest that at first glance are correlated.
On many times I heard from my friends that they want to go out for a few beers when they are going through a situation of stress or sadness.
So I decided to analysis the topics of alcohol consumption, Major depression and generalized anxiety to see if they are correlated, which would mean that people tend to consume alcohol when they are going through situations of sadness or anxiety.
My initial research question is: Is there a relationship between alcohol consumption and a person's anxiety levels?
As an additional question: is the level of alcohol consumption proportional to a person's levels of anxiety, stress or depression?
I selected the pages 30-40, 310-314, 320-326, 386, 393-398 from the NESARC study code to do my own code book with the questions that I think are useful to my analisys
0 notes