Using the 𝑚 𝑡 𝑐 𝑎 𝑟 𝑠 dataset in RStudio, calculate the correlation between 𝑚 𝑝 𝑔 and ℎ 𝑝 , and then perform a linear regression with 𝑚 𝑝 𝑔 as the dependent variable and ℎ 𝑝 as the independent variable. What is the correlation and the slope of the regression line?   Hint: Use the following code. cor(mtcars$mpg, mtcars$hp) lm(mtcars$mpg ~ mtcars$hp)$coefficients[2] lm(mpg ~ hp, data=mtcars)$coefficient[2] # another method单项选择题

登录即可查看完整答案

我们收录了全球超50000道真实原题与详细解析,现在登录,立即获得答案。

类似问题

更多留学生实用工具

加入我们,立即解锁 海量真题独家解析,让复习快人一步!