November 2016
Beginner to intermediate
959 pages
43h 46m
English
Linear regression is a method to assess the association between dependent and independent variables. In this recipe, we will cover how to conduct linear regression for multivariate analysis.
Ensure that mtcars has already been loaded into a data frame within an R session.
Perform the following steps:
lm function:> lmfit = lm(mtcars$mpg ~ mtcars$cyl) > lmfit Call: lm(formula = mtcars$mpg ~ mtcars$cyl) Coefficients: (Intercept) mtcars$cyl 37.885 -2.876
summary function:> summary(lmfit) Call: lm(formula = mtcars$mpg ~ mtcars$cyl) Residuals: Min 1Q ...
Read now
Unlock full access