title: Box Tidwell - errors coming up
body: <p>I'm using:</p>
  
  <pre><code>library(car)
  boxTidwell(y, ...)
  
  mydata = my data frame 
  </code></pre>
  
  <p>When I try:</p>
  
  <pre><code>boxTidwell(response~variable1+variable2+...varibalen, ~categoricalvariable, data=mydata)
  </code></pre>
  
  <p>it comes up with this error:</p>
  
  <pre><code>Error in lm.fit(cbind(1, x1.p, x2), y, ...) : NA/NaN/Inf in 'x'
  </code></pre>
  
  <p>I run <code>boxTidwell(y,x3,x2=NULL)</code> and get the following error: </p>
  
  <pre><code>Error in model.frame.default(formula = y ~ cbind(x1, x2), drop.unused.levels = TRUE) : 
    invalid type (NULL) for variable 'y'
  </code></pre>
  
  <p>where:</p>
  
  <pre><code>y = mydata$response 
  x1 = mydata[,-response] then x3 = x1[,-categoricalvariable] (i used head(x1) and head(x3) to check this worked)
  x2 = mydata$categoricalvariable (i only have one so this can be done)
  </code></pre>
  
  <p>the categorical variable or the response is not included in x1. </p>
  
  <p>I have read the help file but am really not sure whats wrong. I also tried converting the above to matrix form (model.matrix) instead of data frames (i checked using class) but that threw up the same errors as above.</p>
  
  <p>Any ideas on why this isn't working and how I can fix it? </p>