Assuming I have the following datatable murder

Crime      Race      Age     Income    Gender     Education    Urban   
  1        White      55      3000       M         College       1
  0        Asian      18        5        F         GED           0
  0        White      40      9000       M         Doctorate     1
  1        Hawaiian   30       500       F         GED           0

I want to club the demographics into one vector called demog.

I want to use as.vector, but do not know how to specifically choose Race, Age, and Gender as my variables.

Then, I want to run lm() as:

answer <- lm(crime ~ Income + Education + Urban + demog, data = "murder")

0 Answers