title: Why am I getting 'Error in weights * y : non-numeric argument to binary operator' in my logistic regression?
body: <p>I am willing to perform a logistic regression for my dataset. I use:</p>
  
  <p><code>glm.fit=glm(direccion~Profit, data=datos, family=binomial)</code></p>
  
  <pre><code>    Minute  ecopet  TASA10  direccion   Minute  cl1     Day         Profit  
  1   571     2160     5       1          571    51.85    2015-02-20  -0.03   
  2   572     2160     5       1          572    51.92    2015-02-20   0.04   
  3   573     2160     5       1          573    51.84    2015-02-20  -0.04   
  4   574     2160     5       1          574    51.77    2015-02-20  -0.11   
  5   575     2160     10      1          575    51.69    2015-02-20  -0.19   
  6   576     2165     5       1          576    51.69    2015-02-20  -0.16   
  7   577     2165    -5       0          577    51.64    2015-02-20  -0.28   
  8   578     2165    -10      0          578    51.47    2015-02-20  -0.37   
  9   579     2165    -10      0          579    51.41    2015-02-20  -0.36   
  10  580     2170    -15      0          580    51.44    2015-02-20  -0.25   
  11  581     2170    -30      0          581    51.48    2015-02-20  -0.21   
  12  582     2160    -20      0          582    51.52    2015-02-20  -0.12   
  13  583     2155    -5       0          583    51.56    2015-02-20   0.09   
  14  584     2155    -5       0          584    51.51    2015-02-20   0.10   
  15  585     2155    -5       0          585    51.44    2015-02-20   0.00   
  16  586     2140     10      1          586    51.30    2015-02-20  -0.18   
  17  587     2140     10      1          587    51.31    2015-02-20  -0.21   
  18  588     2150     0       0          588    51.31    2015-02-20  -0.25
  </code></pre>
  
  <p>As you can see, the variable 'direccion' is a binary variable and is the dependent variable in my logistic regression. It is 1 whenever the variable 'TASA10' is positive and 0 otherwise. The problem is that after I run the code, I get:</p>
  
  <p>'Error in weights * y : non-numeric argument to binary operator'</p>
  
  <p>would you know why is that?</p>
  
  <p>Thanks!!</p>