如何在r中实现刻度()函数所需的建议

发布于 2025-01-23 09:30:05 字数 8 浏览 6 评论 0原文

continue

Context

As part of my studies in ecology, I am trying to stick to a quantile regression method performed in Karlsson et. al (2022) (source: https://arxiv.org/pdf/2202.02206.pdf). As I am facing some unexpected challenges (more insights here if interested: https://stats.stackexchange.com/questions/572277/theory-understanding-behind-quantile-regression), I am trying to reproduce as much as I can their methodology, in order to find some solutions to my problems.

Here is how I assume that their dataset has been built (+ some covariates columns that I will not take into account):

individualyearjulian_day
1y(1)j(1)
.........
ny(n)j(n)

Basically, 1 row = 1 bird, the year it was recorded and the day it was recorded (julian day format).

I am trying to reproduce a sentence that I first ignored because I thought it was not as a matter of importance:

For all fitted models, year was centered around 2001.

It is the only information that they provide in the paper about centering the year column.

Question

The scale() function, by default, subtracts the mean from each individual observation and then divides by the standard deviation. By specifying scale=FALSE, we tell R not to divide by the standard deviation.

My question is straightforward: as nothing else is specified, what is the "common use" of the scale() function? Regarding the quoted sentence, what would you think that the scale argument should be: FALSE or TRUE; and why?

Thank you very much for your help.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

终难遇 2025-01-30 09:30:05

我认为您想在模型I(Year -2001)中使用。这将集中在2001年左右的一年中。scale()将围绕平均值,根据数据,这可能是2001年。如果scale = false仅完成了中心。如果scale = true,则将结果的中心变量除以其标准偏差。

I think you want to use in your model I(year - 2001). That will centre the year around 2001. scale() will centre around the mean, which may or may not be 2001 depending on the data. If scale=FALSE only centring is done. If scale=TRUE, then the resulting centred variable is divided by its standard deviation.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文