【发布时间】:2020-10-07 18:40:10
【问题描述】:
这些是数据和代码的一部分,我想用 R 中的 ggplot2 绘制回归。 结果不理想,请问我犯了哪些错误?
age purchase_freq
<dbl> <chr>
1 81 30
2 61 89
3 54 67
4 33 43
5 55 35
6 58 25
7 31 71
8 20 10
9 77 18
10 45 23
# … with 900 more rows```
ggplot(test1, aes(x = age, y = purchase_freq)) +
geom_point() +
geom_smooth(method = "lm")
【问题讨论】:
-
嗨詹姆斯。您能否帮助我们澄清一下结果是不受欢迎的?
-
代码没有错误,可能是型号不对?
-
对不起,我没有成功上传结果,我已经上传了@JasonPunyon
标签: r ggplot2 statistics regression