Lab 4.1

Group B

Katlyn Collins, Gabriela Chajon, Misha Cox, Robin Chavez

Information of Data

# A tibble: 6 × 32
   year    id ballot   age childs sibs  degree race  sex   region income16 relig
  <dbl> <dbl> <labe> <dbl>  <dbl> <lab> <fct>  <fct> <fct> <fct>  <fct>    <fct>
1  2016     1 1         47      3 2     Bache… White Male  New E… $170000… None 
2  2016     2 2         61      0 3     High … White Male  New E… $50000 … None 
3  2016     3 3         72      2 3     Bache… White Male  New E… $75000 … Cath…
4  2016     4 1         43      4 3     High … White Fema… New E… $170000… Cath…
5  2016     5 3         55      2 2     Gradu… White Fema… New E… $170000… None 
6  2016     6 2         53      2 2     Junio… White Fema… New E… $60000 … None 
# ℹ 20 more variables: marital <fct>, padeg <fct>, madeg <fct>, partyid <fct>,
#   polviews <fct>, happy <fct>, partners <fct>, grass <fct>, zodiac <fct>,
#   pres12 <labelled>, wtssall <dbl>, income_rc <fct>, agegrp <fct>,
#   ageq <fct>, siblings <fct>, kids <fct>, religion <fct>, bigregion <fct>,
#   partners_rc <fct>, obama <dbl>

Creating the Initial Plot

Variables x = Age and y = Number of Children

Interpretation of the Data

The data shows that, in general, people have more children as they get older. However, there are also some differences between groups. For example, white women tend to have more children than black women. Additionally, the lines start to level off at around age 40, which suggests that most people have finished having children by that age.

Formula facet grid in sex by race=sex ~ race

Formula facet grid in sex + race=~sex + race

Facet wrap sex by race=~sex + race

Findings

Women tend to have more children than men. This is true for all three racial groups shown in the graph.

White women tend to have more children than black women. This is true at almost all ages.

People tend to have more children as they get older, up to a certain point. The lines on the graph start to level off at around age 40, which suggests that most people have finished having children by that age.

Subset for Happy and Marital.

Final Version v1 Happy by happy ~ marital

Final Version v2 = ~ happy + marital

Key findings

There is a positive correlation between age and number of children for all marital statuses and happiness levels. This means that, on average, people tend to have more children as they get older.


Married couples tend to have more children than never-married, divorced, separated, or widowed individuals. This is true for both happy and not-too-happy individuals.

Happy people tend to have more children than not-too-happy people. This is true for all marital statuses.

The relationship between age and number of children appears to be stronger for married couples than for other marital statuses. This means that the increase in the number of children with age is steeper for married couples than for other groups.