1. Learn
  2. /
  3. 课程
  4. /
  5. R 中的回归入门

Connected

道练习

使用 lm() 做线性回归

虽然 ggplot 可以用 geom_smooth() 显示线性回归的趋势线,但它不会把截距和斜率作为变量提供,也无法让您把模型结果当作变量来操作。这意味着有时您需要自己运行线性回归。

现在来运行您的第一个模型吧!

taiwan_real_estate 已可使用。TWD 是新台币(Taiwan dollars)的缩写。

说明 1 / 共 3 个

undefined XP
    1
    2
    3
  • 以 price_twd_msq 为响应变量、n_convenience 为解释变量、taiwan_real_estate 为数据集,运行一次线性回归。