R中的MuMIn包中的标准化 [英] Standardisation in MuMIn package in R

查看:901
本文介绍了R中的MuMIn包中的标准化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在R中使用'MuMIn'包来选择模型并计算输入变量(雨,黑,白,发作,威德)的效应大小.为了使变量之间的效果大小可比,我使用了arm包中的standardize函数对它们进行了标准化.这是我要遵循的代码:

I am using the 'MuMIn' package in R to select models and calculate effect sizes of the input variables (rain, brk, onset, wid). To make my effect size comparable between variables, I standardised them using standardize function in arm package. Here is the code that I am following:

作为参考,请参阅本文的附录:

For reference, please refer to the appendix of this paper: http://onlinelibrary.wiley.com/doi/10.1111/j.1420-9101.2010.02210.x/full Grueber et al. 2011: Multimodel inference in ecology and evolution: challenges and solutions

data1<-read.csv("data.csv",header=TRUE)       #reads the data

global.model<-lmer(yld.res ~ rain + brk + onset + wid + (1|state),data=data1,REML="FALSE")               # prepares a global model

stdz.model <- standardize(global.model,standardize.y = FALSE)          # standardise the input varaibles 

model.set <- dredge(stdz.model)      ### generates the full submodel set

top.models <- get.models(model.set, subset= delta<2)   # selects models with delta AIC <2

model.avg(top.models)       # calculates the average effect size of input variables

这是model.avg(top.models)的结果,它给出了每个输入变量的平均效果大小

Here is the result of model.avg(top.models) which gives the average effect size of each input variable

Coefficients: 
         (Intercept)     brk         rain         wid        onset
subset -4.281975e-14   -106.0919   51.54688    39.82837    35.68766

我阅读了标准化函数的工作原理-减去均值并除以2SD.

I read around how the standardize function works- subtracts mean and divides by 2SD.

我的问题是:由于我已经标准化了输入变量,效果大小不应该在-1到1之间吗?还是输出显示的效果大小正确?

My question is this: Since I have standardised the input variables, should not the effect sizes be between -1 to 1? or the effect size which the output shows is correct?

请告知

非常感谢

推荐答案

与编程问题相比,这更像是一个统计问题,但是:您仅对预测变量进行了标准化,而不对响应变量进行了标准化(您指定了standardize.y=FALSE );因此,您的每个系数代表预测变量中每2 SD变化的响应预期变化(以响应单位!).如果响应范围很大(在您的示例中必须如此),则可能会有很大的变化.例如,如果我正在分析以毫克为单位的大象体重的变化,那么我可以期望响应中的变化非常大,而预测变量(例如性别,年龄,食物供应量)也会相对较小地变化.如果您想要真正的无量纲/无单位效果大小,则可能应该使用standardize.y=TRUE.甚至无量纲的影响也不一定要限制在-1和+1之间,但是它们如此之大会令人惊讶.

This is more of a statistical question than a programming question, but: you've only standardized the predictor variables, not the response variable (you specified standardize.y=FALSE); therefore, each of your coefficients represents the expected change of the response (in the response's units!) per 2 SD change in the predictor. If the range of the response is large (as it must be in your example), then there could be a very large change. For example, if I were analyzing the change in elephant weight measured in milligrams, I could expect very large changes in the response for reasonably small changes in the predictors (e.g. sex, age, food availability). You should probably use standardize.y=TRUE if you want truly nondimensional/unitless effect sizes. Even nondimensional effects aren't necessarily constrained to be between -1 and +1, but it would be surprising for them to be so large.

顺便说一句,我认为您的standardize函数来自arm包,而不是来自MuMIn(library("sos"); findFn("standardize",sortby="Function)).

By the way, I think your standardize function comes from the arm package, not from MuMIn (library("sos"); findFn("standardize",sortby="Function)).

这篇关于R中的MuMIn包中的标准化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆