openintro (version 1.7.1)

acs12: American Community Survey, 2012

Description

Results from the US Census American Community Survey, 2012.

Usage

data("acs12")

Arguments

Format

A data frame with 2000 observations on the following 13 variables.

income

Annual income.

employment

Employment status.

hrs_work

Hours worked per week.

race

Race.

age

Age, in years.

gender

Gender.

citizen

Whether the person is a U.S. citizen.

time_to_work

Travel time to work, in minutes.

lang

Language spoken at home.

married

Whether the person is married.

edu

Education level.

disability

Whether the person is disabled.

birth_qrtr

The quarter of the year that the person was born, e.g. Jan thru Mar.

Examples

Run this code
# NOT RUN {
data(acs12)
d <- subset(acs12, 30 <= age & age <= 60)
d <- subset(d, employment == "employed" & income > 0)
d <- na.omit(d[c("age", "income")])

par(mfrow = c(2, 1), mar = c(5, 5, 1, 1))
plot(d$age, d$income)
m <- lm(income ~ age, data = d)
abline(m)
summary(m)

plot(d$age, log(d$income))
ml <- lm(log(income) ~ age, data = d)
abline(ml)
summary(ml)
# }

Run the code above in your browser using DataCamp Workspace