Results from the US Census American Community Survey, 2012.
A data frame with 2000 observations on the following 13 variables.
Hours worked per week.
Age, in years.
Whether the person is a U.S. citizen.
Travel time to work, in minutes.
Language spoken at home.
Whether the person is married.
Whether the person is disabled.
The quarter of the year that the person was born,
Jan thru Mar.
library(dplyr) library(ggplot2) library(broom) # employed only acs12_emp <- acs12 %>% filter( age >= 30, age <= 60, employment == "employed", income > 0 ) # linear model ggplot(acs12_emp, mapping = aes(x = age, y = income)) + geom_point() + geom_smooth(method = "lm") lm(income ~ age, data = acs12_emp) %>% tidy() # log-transormed model ggplot(acs12_emp, mapping = aes(x = age, y = log(income))) + geom_point() + geom_smooth(method = "lm") lm(log(income) ~ age, data = acs12_emp) %>% tidy()