dataanalystintraining
dataanalystintraining
Data Analyst In Training
3 posts
Don't wanna be here? Send us removal request.
dataanalystintraining · 3 days ago
Text
Making Data Management Decisions
Code:
Tumblr media
Ouput:
Tumblr media
For assignment 3, I created code to:
-set responses that were "refused" "don't know" and "not applicable" to treat them as NaN, (by removing responses 6,8, and 9 from those data sets)
-recode the values for variables H1PF16 and H1PF20, so that the scales between them and the other variables follows the same logic (lower="worse", higher="better"), to make future analysis easier (using .map functions)
-experiment with creating a subset of the data to zoom in on the responses of one input variable and answer, in preparation for deeper understandings of the data.
Analysis:
As an entire data set (table 1), the most common response was "Very much" when asked how much ones mother cares about them, with ~84.6% of all of the responses to that question. That compares to ~57.7% of the same response when considering ones Father, which is the highest rate for that variable.
When looking at decision making methods of individuals, whether one relies on "gut feeling" responses had very similar response rates between "Disagree" "Neither Agree nor Disagree" and "Agree", with values of ~33.5%, ~20.15%, and ~29.15%, respectively. When looking at the responses of the singular dataset(those who felt they were not close to their mother), the results were pushed away from the center with corresponding response values of 36%, 8%, and 24%, and larger percentages at the more extreme values.
0 notes
dataanalystintraining · 6 days ago
Text
Running My First Program
Code:
"""
Code for Peer-graded assignment: Running Your First Program
Course: Data Management and Visualization, Lesson 2
"""
import pandas
data=pandas.read_csv('addhealth_pds.csv', low_memory=(False))
#setting working variables to numeric
data['H1WP9']=pandas.to_numeric(data['H1WP9'])
data['H1WP10']=pandas.to_numeric(data['H1WP10'])
data['H1WP13']=pandas.to_numeric(data['H1WP13'])
data['H1WP14']=pandas.to_numeric(data['H1WP14'])
#define percentages (frequency analysis) for each variable, and print
print('Frequency Analysis (as Percentage)')
pt1= data.groupby('H1WP9').size() * 100 / len(data)
print(pt1)
print('Frequency Analysis (as Percentage)')
pt2= data.groupby('H1WP10').size() * 100 / len(data)
print(pt2)
print('Frequency Analysis (as Percentage)')
pt3= data.groupby('H1WP13').size() * 100 / len(data)
print(pt3)
print('Frequency Analysis (as Percentage)')
pt4= data.groupby('H1WP14').size() * 100 / len(data)
print(pt4)
print('Frequency Analysis (as Percentage)')
#define scales to be able to print them, and to understand the data
scale1 = [
    "Not At all",
    "Very Little",
    "Somewhat",
    "Quite a bit",
    "Very Much",
    "Refused",
    "Legitimate skip",
    "Don't know",
    "Not Applicable",
]
#combining data using the same scale into data frames for clearer printing
Dataframe1=pandas.DataFrame({
    'Explanation':scale1,
    'H1WP9':pt1,
    'H1WP10':pt2,
    'H1WP13':pt3,
    'H1WP14':pt4,   
    })
print('<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>') #indicate start of a data table
print('Table 1: Frequency Analysis of responses (as Percentages)')
print(Dataframe1)
print('---------------') #for improved readability in console
print('Variable definition:')
print('H1PF9 - How close do you feel to Mother')
print('H1PF10 - How much do you think she cares about you?')
print('H1PF13 - How close do you feel to Father?')
print('H1PF14 - How much do you think he cares about you?')
Results (Individual Frequency Plots):
Tumblr media
Results (Combined, and with more explanations to make it more readable):
Tumblr media
Analysis:
The data I selected to look at were about the respondent's feeling toward their parents, which are the "inputs" planned for future data analysis.  Values were a subjective scale:
    "Not At all"
    "Very Little"
    "Somewhat"
    "Quite a bit"
    "Very Much"
    "Refused"
    "Legitimate skip"
    "Don't know"
    "Not Applicable"
The data from these variables is mostly on the positive side ("quite a bit" or "Very much") for all of the variables evaluated for this exercise, ranging from approximately 55% to 90%. 
Something I noticed was that the "legitimate skip" answers (30%) for variables H1WP13 and H1WP14, which closely align with the differences in the "very much" answers in the comparable data sets. (37% vs 65%, and 57% vs. 84%). 
Also, in this data there are some other data points which may be viewed as missing or unable to be used in further data analysis: "refused" (0.015% to 0.062%), "don't know" (0.015% to 0.046%), and "Not applicable" (0% to 0.015%).
0 notes
dataanalystintraining · 13 days ago
Text
Introduction to Data Management and Visualization
What I'm going to look into
Pursuing an online training course for data analysis through Wesleyan University, I am curious and investigating: Does one's relationships with their parent(s) and friends relate to their decision-making abilities and views of themselves?
The datasets that I will use are the results of the AddHealth surveys, sections 14, 15, 16, 18, and 20, primarily. However, after reviewing previous published work on this topic, by searching: "parental relationship and decision making" and "parental relationship and view of self", more relevant criteria may be needed (e.g. section 35), to account for additional cultural factors that may provide context otherwise missing from the data.  
My goal is to expand my understanding of the conclusions that parent-adolescent relationship are closely related to self-esteem, by looking at the data from a retrospective view after adolescence, as opposed to the previous studies which specifically focus on the evaluation of adolescent groups with certain categories of health conditions (diabetes and psychiatric issues) [1] or evaluations of young adults and different family pattern types [2].  My hypothesis is that those grew up with more stable and safe social structures will have more positive views of themselves, and also, that the interactions with the same-gender parent have a larger impact on one's self-perception later.
[1] Isberg, R.S., Hauser, S.T., Jacobson, A.M. et al. Parental contexts of adolescent self-esteem: A developmental perspective. J Youth Adolescence 18, 1–23 (1988). https://doi.org/10.1007/BF02139243 [2]Jacobvitz, D. B., & Bush, N. F. (1996). Reconstructions of family relationships: Parent–child alliances, personal distress, and self-esteem. Developmental Psychology, 32(4), 732–743. https://doi.org/10.1037/0012-1649.32.4.732
1 note · View note