Skip to content

Ch3 Ex9c #99

@actuarialcat

Description

@actuarialcat

The question requires the use of multiple linear regression.
The predictor "origin" is stored as a num, but it is a qualitative data.
Shouldn't it be change to factor using the following code before doing the regression?

origin_fac = factor(Auto$origin, levels = c("American","European","Japanese"))
new_data = subset(Auto, select = -c(name,origin))
new_data = new_data.frame(new_data, origin_fac)
lm.fix =  lm(mpg~. ,data= new_data)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions