Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
所以我有这样的情节:
x 和 y 轴都是对数,我该如何拟合最小二乘回归线?这是我用来绘制图表的内容: plot(log(counts),log="x",type="p")
counts 包含每个 x 的观察次数...
log(x) 上 log(counts) 的最小二乘回归很简单:
lm(log(counts) ~ log(x))
如果你想绘制它:
plot(log(counts) ~ log(x)) abline(reg=lm(log(counts) ~ log(x)))
这可能不是您的数据在统计上最合适的模型,但这是另一个站点的问题......