leffgh
MASS包里有个 boxcox转化的函数
可以算出lambda的值,
我的问题:
boxcox转化只是将一列数据转化,为什么 boxcox的对象是回归的式子,
比如,我只想转化y ,自变量对y 的lambda的取值有什么意义吗?
我这样问其实只是担心boxcox提供的值不是针对y的转化,而是针对整个矩阵的.
那本practical regression and anova using R里面有讲到boxcox ,但是没有在上面找到我想要的答案,我想发邮件给那本书的作者,但是也找不到他的邮箱地址
大家有任何建议么?
无论是boxcox还是作者邮箱地址都可以
leffgh
怎么还没有人回答?
yihui
leffgh
dear Julian Faraway:
I have read part of your book:"pratical regression and anova using R". And I have some quesitons about box cox transforamtion using R. The "boxcox" function in the "MASS" package requires "lm" or "aov" objects. Your book has provided an example using the "boxcox" function to transform the response variable. The "boxcox" function can tell one which lambda is best for transformation . And for each "lm" object there is only one "lambda",how can I know the lambda is for the response variable ?
Perhaps you are confused by what I say .
if I want to transform the independent variables , how can I obtain the lambda for them using the "boxcox" function ?
for example:
tree<-lm(a~b+c+d,data=e)
boxcox(tree)
then I can get a lambda whose likelihood is maximized. But I don't know which variable the lambda is for,since the there are four variables( a,b ,c,d) in "tree" . Is the "lambda" for all the variables in "tree" or just for the response variable (a)? If the latter one is correct and I want to box-cox transform the other variables (b,c,d), what can I do ?
Thank you very much . I am looking forward to your reply.
Lily
leffgh
Dear Lily,
The standard implementation of the Box-Cox works only one the response, that is variable "a" in your example.
It is possible to apply Box-Cox transformations to the predictors but this is not available in the boxcox() function. It is recommended to use other methods to select transformations on the predictors.
Regards
leffgh
Faraway回复得真快!