Question: # Create separate data frames for males and females with a suffix males < - cef _ fvm % > % filter ( gender =

# Create separate data frames for males and females with a suffix
males <- cef_fvm %>%
filter(gender == "male")%>%
rename(earnings_male = earnings)%>%
select(-earnings)
females <- cef_fvm %>%
filter(gender == "female")%>%
rename(earnings_female = earnings)%>%
select(-earnings)
# Join male & female data frames on 'age' & calc. the ratio
df_ratio <- inner_join(males, females, by = "age")%>%
mutate(ratio = earnings_male / earnings_female )
# Display the table you created
df_ratio

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!