title: Error when running glm
body: <p>I'm running a glm in R with the car package and got the following error message:</p>
  
  <pre><code>&gt; dlmod = glm(dlstatus ~ dlour_bid, data=dlmydat, family=binomial(link="logit"))
  Error in eval(expr, envir, enclos) : y values must be 0 &lt;= y &lt;= 1
  </code></pre>
  
  <p>My response variable is coded 1/2 and not 0/1.
  I'm just not sure how to change this.</p>
  
  <pre><code>tat &lt;- dldat$status
  dlstatus &lt;- NA
  dlstatus[stat %in% levels(stat)[1:2]] &lt;- "Won"
  dlstatus[stat %in% levels(stat)[3]] &lt;- "Lost"
  dlstatus &lt;- factor(status)
  levels(dlstatus)
  dlstatus = as.numeric(dlstatus)
  dlstatus
  </code></pre>
  
  <p>Can anyone help with changing the labels from 1/2 to 0/1 so that I can run a glm in R.R</p>
  
  <p>EDIT:</p>
  
  <p>Works fine when I factor dlstatus in the flm command.</p>
  
  <p>Thanks and apologies for the kinda stupid question.</p>
  
  <p>Feel free to close.</p>