问题
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