What R function can be used instead of box.tidewell() when a lot of predictors need to be transformed?

◇◆丶佛笑我妖孽 提交于 2019-12-11 04:57:18

问题


I am doing a multiple regression on a data set containing one dependent variables and 13 independent variables.

The box.tidewell() method only works for the first 6 predictors after which it reaches the maximum number of iterations.

I tried changing the number of max.inter in the argument, but the following error is displayed: Error in lm.fit(cbind(1, x1.p, x2), y, ...) : NA/NaN/Inf dans 'x'.

By the way, I tried the following:

boxTidwell(df$density~df$age+df$weight+df$height+df$neck+df$chest+df$abdomen+df$hip+df$thigh+df$knee+df$ankle+df$biceps+df$forearm+df$wrist,data=df)

and

boxTidwell(df$density~.,data=df)

but nothing works.

Thank you for your help.

Best regards, Louis de Vitry


回答1:


I had a calculated variable (var_c=var_a/var_b) that was causing this error: error in lm.fit(cbind(1, x.log.x, x1.p, x2), y, ...) : NA/NaN/Inf in 'x'

I rounded that variable to get rid of any repeating decimals and this took care of the issue. Ex: NNdata$REPEAT_PRPRTN <- round(NNdata$REPEAT_PRPRTN, digits=2)

I'm not exactly sure why this works but it may be a lead.



来源:https://stackoverflow.com/questions/42533582/what-r-function-can-be-used-instead-of-box-tidewell-when-a-lot-of-predictors-n

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