Tumgik
coolharitha-blog · 6 years
Text
My third week assignment
PYTHON PROGRAM:
Tumblr media Tumblr media
  OUTPUT:
Tumblr media Tumblr media Tumblr media
OBSERVATIONS:
A sample of 6505 adolescents were asked a question “During the past 12 months, did you ever think of committing suicide?” . Of the total number 86.3% of them chose 0 which is ‘no’ and about 12.6 % of them chose ‘yes’.
For the next question, ”How many times did you actually attempt to suicide?” , 87.3% of them chose a legitimate skip , 9% chose 0 times and 2% of them chose 1 time.
For the next question, “ Have any of your friends tried to kill themselves during the past 12 months?” , 81.34% of them chose a category 0 which is ‘no’ and 17.38% of the adolescents chose 1 which is ‘yes’.
For the next question, “Did any of your succeeded in attempting suicide?” , 82.6% of them chose 7 which is legitimate skip, 14.6% chose 0 which is ‘no’ and 2.75% of them chose 1 which is ‘yes’
So, finally, after combining all the above questions,and from the frequency distribution tables, it is observed that 25.3% of the adolescents who has attempted for committing suicide during the past 12 months, have their friends to have attempted suicide in past 12 months. This shows that friends have great influence on the adolescents in committing to suicide.
I have collapsed the responses into categories of age groups (10,13),(13,16),(16,19).So, from the analysis it is observed that 66% of the adolescents belong to (16,19) age group who committed suicide.
0 notes
coolharitha-blog · 6 years
Text
My second week assignment
MY RESEARCH QUESTION:
The relationship between friendship patterns and suicidality behaviour among adolescents
VARIABLES DESCRIPTION:
1.      AGE : For adolescents , we are considering the age between 10 and 19 years
2.      H1SU1 : During the past 12 months, did you ever seriously think about committing suicide?
Values:
0 - no
1 -yes
6 -refused
8 -don’t know
9 -not applicable
3.      H1SU2 : During the past 12 months, how many times did you actually attempt suicide?
Values:
0 -0 times
1 -1 time
2 -2 or 3 times
3 -4 or 5 times
4 -6 or more times
6-refused
7 -legitimate skip
8 -don’t know
4.      H1SU4 : Have any of your friends tried to kill themselves during the past 12 months?
Values:
0-no
1-yes
6-refused
8-don’t know
9-not applicable
5.      HISU5 : Have any of the friends succeeded?
Values:
0-no
1-yes
6-refused
7-legitimate skip
8-don’t know
PYTHON PROGRAM:
#import libraries needed
import pandas as pd
import numpy
 #Read in the data
data=pd.read_csv('addhealth_pds.csv',low_memory=False)
 #to convert all columns to upper case
data.columns=map(str.upper,data.columns)
 #Print some basic statistics
r1=str(len(data))             #Number of observations(rows)
c1=str(len(data.columns))     #Number of observations(columns)
print('Number of observations: '+ r1 +' (rows)')  
print('Number of observations: '+ c1 +' (columns)')
 # Change the data type for variables of interest
data['H1SU1']=pd.to_numeric(data['H1SU1'],errors='coerce')
data['H1SU2']=pd.to_numeric(data['H1SU2'],errors='coerce')
data['H1SU4']=pd.to_numeric(data['H1SU4'],errors='coerce')
data['H1SU5']=pd.to_numeric(data['H1SU5'],errors='coerce')
data['AGE']=pd.to_numeric(data['AGE'],errors='coerce')
 #to find any missing data
m1=data['H1SU1'].value_counts(sort=False,dropna=False).sort_index(ascending=True)
m2=data['H1SU2'].value_counts(sort=False,dropna=False).sort_index(ascending=True)
m3=data['H1SU4'].value_counts(sort=False,dropna=False).sort_index(ascending=True)
m4=data['H1SU5'].value_counts(sort=False,dropna=False).sort_index(ascending=True)
 print(m1)
print(m2)
print(m3)
print(m4)
 #to find the counts of values
b1=data['H1SU1'].value_counts().sort_index(ascending=True)
b2=data['H1SU2'].value_counts().sort_index(ascending=True)
b3=data['H1SU4'].value_counts().sort_index(ascending=True)
b4=data['H1SU5'].value_counts().sort_index(ascending=True)
 print('counts of students who thought of commiting suicide in past 12 months')
print(b1)
 print('counts of how many times did they attempt suicide')
print(b2)
 print('counts of students whose friends tried to suicide during past 12 months')
print(b3)
 print('counts of students whose friends succeeded in attempting suicide during past 12 months')
print(b4)
 #percentages(frequency distributions) of the counts
p1=data['H1SU1'].value_counts(sort=False,normalize=True).sort_index(ascending=True)
p2=data['H1SU2'].value_counts(sort=False,normalize=True).sort_index(ascending=True)
p3=data['H1SU4'].value_counts(sort=False,normalize=True).sort_index(ascending=True)
p4=data['H1SU5'].value_counts(sort=False,normalize=True).sort_index(ascending=True)
 print('percentages of students who thought of committing suicide in past 12 months')
print(p1)
 print('percentages of how many times did they attempt suicide')
print(p2)
 print('percentages of students whose friends tried to suicide duuring past 12 months')
print(p3)
 print('percentages of students whose friends succeeded in attempting suicide during past 12 months')
print(p4)
 #making the subset of data based on the requirements
sub1=data[(data.H1SU1==1) & (data.H1SU2>=1) & (data.H1SU4==1) & (data.AGE>=10) & (data.AGE<=19)]
 sub2=sub1.copy()
 print('counts of friends of adolescents who have succeeded in attempting suicide')
c5 = sub2['H1SU5'].value_counts(sort=False)
print(c5)
 print('percentages of friends of adolescents who have succeeded in attempting suicide')
p5 = sub2['H1SU5'].value_counts(sort=False, normalize=True)
print (p5)
   OUTPUT:
Number of observations: 6504 (rows)
Number of observations: 2829 (columns)
H1SU1--no missing data
0    5614
1     821
6      46
8      22
9       1
Name: H1SU1, dtype: int64
H1SU2--no missing data
0     587
1     131
2      64
3      10
4      25
6       3
7    5683
8       1
Name: H1SU2, dtype: int64
H1SU4--no missing data
0    5291
1    1131
6      39
8      42
9       1
Name: H1SU4, dtype: int64
H1SU5--no missing data
0     950
1     179
6       1
7    5373
8       1
Name: H1SU5, dtype: int64
counts of students who thought of committing suicide in past 12 months
0    5614
1     821
6      46
8      22
9       1
Name: H1SU1, dtype: int64
counts of how many times did they attempt suicide
0     587
1     131
2      64
3      10
4      25
6       3
7    5683
8       1
Name: H1SU2, dtype: int64
counts of students whose friends tried to suicide during past 12 months
0    5291
1    1131
6      39
8      42
9       1
Name: H1SU4, dtype: int64
counts of students whose friends succeeded in attempting suicide during past 12 months
0     950
1     179
6       1
7    5373
8       1
Name: H1SU5, dtype: int64
percentages of students who thought of committing suicide in past 12 months
0    0.863161
1    0.126230
6    0.007073
8    0.003383
9    0.000154
Name: H1SU1, dtype: float64
percentages of how many times did they attempt suicide
0    0.090252
1    0.020141
2    0.009840
3    0.001538
4    0.003844
6    0.000461
7    0.873770
8    0.000154
Name: H1SU2, dtype: float64
percentages of students whose friends tried to suicide during past 12 months
0    0.813499
1    0.173893
6    0.005996
8    0.006458
9    0.000154
Name: H1SU4, dtype: float64
percentages of students whose friends succeeded in attempting suicide during past 12 months
0    0.146064
1    0.027522
6    0.000154
7    0.826107
8    0.000154
Name: H1SU5, dtype: float64
counts of friends of adolescents who have succeeded in attempting suicide
0    62
1    21
Name: H1SU5, dtype: int64
percentages of friends of adolescents who have succeeded in attempting suicide
0    0.746988
1    0.253012
Name: H1SU5, dtype: float64
OBSERVATIONS:
A sample of 6505 adolescents were asked a question “During the past 12 months, did you ever think of committing suicide?” . Of the total number 86.3% of them chose 0 which is ‘no’ and about 12.6 % of them chose ‘yes’.
For the next question, ”How many times did you actually attempt to suicide?” , 87.3% of them chose a legitimate skip , 9% chose 0 times and 2% of them chose 1 time.
For the next question, “ Have any of your friends tried to kill themselves during the past 12 months?” , 81.34% of them chose a category 0 which is ‘no’ and 17.38% of the adolescents chose 1 which is ‘yes’.
For the next question, “Did any of your succeeded in attempting suicide?” , 82.6% of them chose 7 which is legitimate skip, 14.6% chose 0 which is ‘no’ and 2.75% of them chose 1 which is ‘yes’
So, finally, after combining all the above questions,and from the frequency distribution tables, it is observed that 25.3% of the adolescents who has attempted for committing suicide during the past 12 months, have their friends to have attempted suicide in past 12 months. This shows that friends have great influence on the adolescents in committing to suicide.
1 note · View note
coolharitha-blog · 6 years
Text
My first week assignment
Dataset:
The dataset that I have selected for my research project is ADDHEALTH.
Research topic:
As per the records, the suicide rate among adolescents is significant in recent years. Suicide is now the third leading cause of death among adolescents and young adults aged between 15 to 24 years. So there is a need to assess the potential role that friendship patterns play in descending adolescent suicidality. Hence , I chose my research topic to be:
The relationship between friendship patterns and suicidality behaviour among adolescents.
Literature review:
Peter S. Bearman, PhD, and James Moody, PhD : Suicide and Friendships Among American Adolescents
Jeffrey A. Bridge, Tina R. Goldstein, and David A. Brent : Adolescent suicide and suicidal behavior
Resnick MD, Bearman P, Blum RW, et al. Protecting adolescents from harm: findings from the National Longitudinal Study on Adolescent Health. JAMA. 1997;278:823–832.
Hazell P, Lewin T. Friends of adolescent suicide attempters and completers. J Am Acad Child Adolesc Psychiatry. 1993;32(11):76–81.
Associated variables:
After referring the ADDHEALTH codebook , I noticed some sections to be relevant for my research topic. They are:
General information like age, ethnicity
General health
Family and household
Relation with parents
Relationship with friends
School and community factors
Parental economic status
Fighting and violence
Suicidal ideations in the past year and attempts
Religious beliefs
Hypothesis:
My inference from the literature review is friends have a great influence on suicidal behavior among adolescent boys and girls in either ways. Having a friend who committed suicide may increase the suicidal thoughts in adolescents and also friends with social grooming helps to reduce suicidality. Suicidal thoughts are significantly increased by social isolation and friendship patterns in which friends were not friends with each other.
0 notes