using R defining logistic regression