Weighted Least Square

谁说我不能喝 提交于 2019-11-30 21:13:56

Here's an example of taking care of poisson count like data where the variation will be proportional to the mean (which it sounds like you have).

fit = lm (y ~ x, data=dat,weights=(1/dat$x^2))

You use the recipricol as the weight since you will be multiplying the values. You square it for taking care of Poisson count data because the variance has units squared. You can do something like:

fit = lm (y ~ x, data=dat,weights=(1/dat$x))

To simply scale it by the x value and see what works better.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!