Good Night, I was looking at the method of selection of variables, found in this link:
Stepwise regression using p-values to drop variables with nonsignificant p-values
And I wanted to add some transformations before deleting the variable ... example (root, log, power, ...)
I tried to add in the linked code (Joris Meys) the following command:
while (T) {
trans <- I(dropvar[1])^2)
testF2 <-add1 (model, trans, test = "F")
}
if(verbose){
cat("-------------STEP ",counter,"-------------\n",
"The drop statistics : \n")
print(test)
}
if(pval[i]<sig) break # stops the loop if var to remove is significant
if(verbose){
cat("\n--------\nTerm added in step",counter,":",dropvar,"\n--------\n\n")
}
But the dropvar variable is as string. Can someone help me?