data-science-analytics-spat-blog
data-science-analytics-spat-blog
Data Science & Analytics
8 posts
Don't wanna be here? Send us removal request.
Text
Running a Chi-Square Test of Independence
Dataset: Adolescent Health - AddHealth
Null Hypothesis: There is no association between the level of paternal care received by an adolescent and level of physical fights the adolescents gets into.
Alternate Hypothesis: The higher the paternal care received by the adolescent, the lower the chances that the adolescent get into a physical fight.
Variables in use:
1. physicalViolence - Categorical variable; Answer to question:
 You got in a fight. [0 - Never, 1 - Once, 2- More than once]
2. paternalCare - Categorical variable; Answer to question:
How much do you think your father(fatherly figure if present) cares about you? [ 1- not at all, 2- very little,3- somewhat,4-quite a bit, 5- very much]
CODE:
Tumblr media
RESULTS:
Tumblr media Tumblr media Tumblr media
RESULTS INTERPRETATION:
Model Interpretation for post hoc Chi-Square Test results:
A Chi Square test of independence revealed that among adolescents (my sample), the level of paternal care received by an adolescent( collapsed in 5 ordered categories) and level of physical fights the adolescents gets into (collapsed into 3 ordered categories) were significantly associated, X2 =21.242, 4 df, p=0.0003.
Post hoc comparisons of levels of physical fights adolescents get into revealed that higher rates of paternal care were seen among those who never got in a fight. In comparison, prevalence of paternal care level was statistically similar among those groups who have engaged in one and more than one fight.
CONCLUSION:
The null hypothesis is rejected. There is an association between the paternal care received by an adolescent and whether they get into a fight or not.
0 notes
Text
Running Analysis of Variance
Dataset: Adolescent health - AddHealth
Variables in use:
1. H1FV13 - Is a quantitative measure ranging from 0 to 365 with the answers of respondents to the question :
During the past 12 months, how many times were you in a physical fight in which you were injured and had to be treated by a doctor or nurse?
2. physicalViolence - Is a categorical measure; answers of respondents to the question:
You got in a physical fight. [ 0 - No, 1 - Once, 2 - More than once; ]
3. paternalCare - Is a categorical measure; answers of respondents to the question:
How much do you think your father(fatherly figure if present) cares about you? [ 1- not at all, 2- very little,3- somewhat,4-quite a bit, 5- very much
CODE: 
LIBNAME mydata "/courses/d1406ae5ba27fe300" access=readonly; DATA new; set mydata.addhealth_pds; Keep H1FV5  H1WP14 H1FV13 physicalViolence paternalCare; LABEL physicalViolence='Involvement in a physical fight'      paternalInfluence='Relationship with father'      maternalInfluence='Relationship with mother'; /* data management for physical voilence */ if H1FV5 = 8 or H1FV5 = 9 or H1FV5 = 6 then physicalViolence =''; if H1FV5 = 0 then physicalViolence = '0'; /* Never */ if H1FV5 = 1 then physicalViolence = '1'; /* Once */ if H1FV5 = 2 then physicalViolence = '2'; /* More than once */ /*data management for satisfaction with relation with father */ if H1WP14 = 6 or H1WP14 = 7 or H1WP14 = 8 or H1WP14 = 9 then paternalCare =''; /*refused, legitimate skip, don't know, not applicable, refused - eliminated */ if H1WP14 = 1 then paternalCare = '1'; /* strongly agree, very much , always ( H1RM12/11 - 6 brings/takes me home from/to school )*/ if H1WP14 = 2 then paternalCare = '2'; /* agree, quite a bit, most of the time */ if H1WP14 = 3 then paternalCare = '3'; /* neither agree or disagree , somewhat, some of the time */ if H1WP14 = 4 then paternalCare = '4'; /* disagree, very little, almost never */ if H1WP14 = 5 then paternalCare = '5'; /* strongly disagree, not at all, never */ /*data management for H1FV13 */ if H1FV13 = 996 or H1FV13 = 997 or H1FV13 = 998 or H1FV13 = 999 or H1FV13 > 365 or H1FV13 < 0 then H1FV13 = 0; /*H1FV13 Quantitative- How many fights have you been involved in during last 12 months: Range 0 to 365 ANOVA : Explanatory - physicalViolence; Response - H1FV13 */ PROC ANOVA; CLASS physicalViolence; MODEL H1FV13=physicalViolence; MEANS physicalViolence/DUNCAN; RUN;
PROC ANOVA; CLASS paternalCare; MODEL H1FV13=paternalCare; MEANS paternalCare; RUN;
Tumblr media
RESULTS:
1. physicalViolence
Tumblr media Tumblr media
Model Interpretation for ANOVA results:
When examining the association between the number of physical fights leading to injury (quantitative response) and involvement in physical violence(categorical explanatory), an Analysis of Variance (ANOVA) revealed that among adolescents (my sample), those with more than once involvement in physical violence reported significantly more fights leading to serious injury (Mean=1.35, s.d. ±17.72) compared to those who didn’t engage in physical violence (Mean=0.32, s.d. ±8.04), F-value=4.77, p=0.0085<0.05.
Tumblr media
Model Interpretation for post hoc ANOVA results:
ANOVA revealed that among adolescents (my sample), the number of physical fights engaged in by the adolescent (collapsed into 3 categories, which is the categorical explanatory variable) and number of fights leading to serious injury (quantitative response variable) were significantly associated, p = 0.0085. Post hoc comparisons of mean number of physical fights leading to serious injury by pairs of physical fight engagement categories revealed that those individuals getting involved in more than one physical fight reported significantly more physical fights with serious injuries, compared to those not involved in any fight. All other comparisons were statistically similar.
2 - paternalCare
Tumblr media Tumblr media
Model Interpretation for ANOVA results:
When examining the association between the number of physical fights leading to injury (quantitative response) and the level of care from father/fatherly figure(categorical explanatory), an Analysis of Variance (ANOVA) revealed that among adolescents (my sample), those with fathers who cared more did not  report significantly more fights leading to serious injury (Mean=0.42, s.d. ±10.07) compared to those with fathers who cared less about them (Mean=1.0, s.d. ±3.07), F-value=0.56, p=0.6915.
0 notes
Text
Creating graphs for your data
CODE:
Tumblr media Tumblr media
RESULT:
Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media
Involvement in a physical fight Graph is left skewed, as is expected that the lesser number of adolescents get involved in one or more physical fights.
0 notes
Photo
Tumblr media
Updating variables for focus for final assignment. 
New variables with focused variables to answer research question, the new variables being: 
1. Involvement in a physical fight.
physicalVoilence frequencies indicative of the involvement in physical fights: 
     0 - Never involved, 1- Once , 2- More than once.
2. Relationship with father.
paternalInfluence frequencies indicative of the strength of relationship with father:
    1 - Really strong, 2 - Strong, 3 - Neutral, 4- Poor, 5- Really Poor.
3. Relationship with mother. 
maternalInfluence frequencies indicative of the strength of relationship with father:
   1 - Really strong, 2 - Strong, 3 - Neutral, 4- Poor, 5- Really Poor.
Tumblr media
0 notes
Text
Making Data Management Decisions
CODE : 
Tumblr media
RESULT:
Tumblr media
EXPLANATION:
I collapsed the responses by grouping similar frequencies to make new frequencies for better analysis. I also renamed the fields so it is more readable, example: physicalFight instead of H1FV5. The new frequencies represent the following:
i. You got into a physical fight.
The frequencies each are now indicative of the occurrences of physical fight recorded through the survey response: 
-1: Unknown and irrelevant data
0: Never in a fight
1: Been in a fight at least once
31.44% of the survey adolescent population has gotten in at least one physical fight, while 67.80% of them have never been in a physical fight and about 0.75% of the responses do not account for either. 
ii. You pulled a knife or gun on someone.
The frequencies each are now indicative of the occurrences of weapon revealing by adolescents on others, with the following key:
-1: Unknown and irrelevant data
0: Never pulled a knife or gun on someone
1: Revealed/Pulled a knife or gun on someone at least once.
4.84% of the survey adolescent population has admitted to being responsible for pulling a knife or gun on someone, while 94.45% of them have never done so and 0.71% of the responses do not account for either.
iii. You shot or stabbed someone.
The frequencies each are now indicative of the occurrences of gun shots or knife stabs, with the survey respondent owning responsibility, with the following key:
-1: Unknown and irrelevant data
0: Never shot or stabbed someone
1: Shot or stabbed someone at least once. 
1.88% of the survey adolescent population has admitted to being responsible for shooting or stabbing someone at least once, while 97.40% of them have never been in a physical fight and about 0.72% of the responses do not account for either.
0 notes
Text
Running your first program
For project information refer to prior post. (link)
1. CODE
LIBNAME mydata "/courses/d1406ae5ba27fe300 " access=readonly; DATA new; set mydata.addhealth_pds; LABEL H1FV5='You got into a physical fight.'      H1FV7='You pulled a knife or gun on someone.'      H1FV8='You shot or stabbed someone.'      H1PF36='You feel loved and wanted.'      H1PF25='Overall, you are satisfied with your relationship with your father.'      H1PF24='You are satisfied with the way your father and you communicate with each other.'      H1PF23='Most of the time, your father is warm and loving toward you.'      H1PF16='When making decisions, you usually go with your “gut feeling” without thinking too much about the consequences of each alternative.'      H1PF5='Overall, you are satisfied with your relationship with your mother'      H1PF4='You are satisfied with the way your mother and you communicate with each other.'      H1PF3='When you do something wrong that is important, your mother talks about it with you and helps you understand why it is wrong.'      H1PF1='Most of the time, your mother is warm and loving toward you.'      H1WP13='How close do you feel to your{FATHER/ADOPTIVE FATHER/STEPFATHER/FOSTER FATHER/etc.}?'      H1WP9='How close do you feel to your{MOTHER/ADOPTIVE MOTHER/ STEPMOTHER/ FOSTER MOTHER/etc.}?'      H1RF13='How often is he at home when you go to bed?'      H1RF12='How often is he at home when you return from school?'      H1RF11='How often is he at home when you leave for school?'      H1RM13='How often is she at home when you go to bed?'      H1RM12='How often is she at home when you return from school?'      H1RM11='How often is she at home when you leave for school?'; PROC SORT; by AID; PROC FREQ; TABLES H1FV5 H1FV7 H1FV8 H1RM11 H1RM12 H1RM13 H1RF11 H1RF12 H1RF13 H1WP9 H1WP13 H1PF1 H1PF3 H1PF4 H1PF5 H1PF16 H1PF23 H1PF24 H1PF25 H1PF36; RUN;
2. OUTPUT
Tumblr media
3. INFO
i. You got into a physical fight.
The frequencies each are indicative of how often the adolescent survey submitter has gotten in a physical fight, with the following key:
0 :- never, 1 :- once, 2 :- more than once, 6 :- refused, 8 :- don’t know, 9 :- not applicable. 
ii. You pulled a knife or gun on someone.
The frequencies each are indicative of how often the adolescent survey submitter has pulled a knife or gun on someone, with the following key:
0 :- never, 1 :- once, 2 :- more than once, 6 :- refused, 8 :- don’t know, 9 :- not applicable.
iii. You shot or stabbed someone.
The frequencies each are indicative of how often the adolescent survey submitter has shot or stabbed someone, with the following key:
0 :- never, 1 :- once, 2 :- more than once, 6 :- refused, 8 :- don’t know, 9 :- not applicable.
0 notes
Text
Data-driven relationship analysis of household environment and violence in adolescents.
Having looked through the codebook for The National Longitudinal Study of Adolescent Health (AddHealth), I have decided that my focus will be on violence in adolescents. 
Although as of now I am not aware of all the factors that I will be studying in my research, but my general focus is to understand how the household environment and the upbringing of adolescents ( some factors would be Relationships with Parents, Presence of a parent/guardian, Relationships with siblings), relates to violence in adolescents. 
The corresponding sections in the codebook that I have identified so far in my literature review that helps me with identifying these relations are
Section 14: Resident Mother
Section 15: Resident Father
Section 16: Relations with Parents
Section 17: Motivations to Engage in Risky Behaviors
Section 18: Personality and Family
Section 31: Fighting and Violence—Audio CASI.
Research questions:
1. How does a relations with parents affect occurrences of violence in adolescents?
2. Does having an absent parent increase the motivation for adolescents to engage in risky behaviors?
3. How does familial bonds and relationships affect the personality and occurrences of fighting and violence in adolescents?
Hypothesis:
I believe that a relationship with parents and family has direct correlation to violence in adolescents, that is a poor or absent relationship with parents and family leads to more violence in adolescents.
Sources:
1. Howe, D., Brandon, M., Hinings, D. and Schofield (1999). Attachment Theory, Child Maltreatment and Family Support. A Practice and Assessment Model. Palgrave: Houndmlls, Basingstoke, Hampshire and New York.
2.  Fuller, A. (2000) Raising Real People: Creating a Resilient Family. Melbourne: ACER
3. Lawrence, Steinberg (2003). We Know Some Things: Parent–Adolescent Relationships in Retrospect and Prospect. (link)
0 notes
Text
Data Analysis and Interpretation Specialization begins!
0 notes