title: backward elimination in logistic regression using R
body: <p>I am running a logistic regression in R and doing "backward elimination" inorder to get my final model:</p>
  
  <pre><code>FulMod2 &lt;- glm(surv~as.factor(tdate)+as.factor(tdate)+as.factor(sline)+as.factor(pgf)
                                      +as.factor(weight5)+as.factor(backfat5)+as.factor(srect2)
                                      +as.factor(bcs)+as.factor(loco3)+as.factor(fear3)
                                      +as.factor(teats)+as.factor(preudder)+as.factor(postudder)
                                      +as.factor(colos)+as.factor(tb5) +as.factor(respon3)
                                      +as.factor(feed5)+as.factor(bwt5)+as.factor(sex)
                                      +as.factor(fos2)+as.factor(gest3)+as.factor(int3),
                                      family=binomial(link="logit"),data=sof)
  </code></pre>
  
  <p>When trying to run the backward elimination script:</p>
  
  <pre><code>step(FulMod2,direction="backward",trace=FALSE)
  </code></pre>
  
  <p>I got this error message:</p>
  
  <pre><code>Error in step(FulMod2, direction = "backward", trace = FALSE) : 
    number of rows in use has changed: remove missing values?
  </code></pre>
  
  <p>This is the second model that I am running using the backward elimination function. The first model was fine when I did backward elimination to get my final model.</p>
  
  <p>Any help would be very much appreciated!</p>
  
  <p>Baz</p>