I'm trying to calculate my logit regression from the OLS. So in the first step I used the lm() function, then I calculated yhat and the probability. Then comes the error message that NaNs are produced. What did I do wrong?
start<-lm(invest~profit+gender,data=data)
summary(start)
data$yhat<-intercept+b1*data$profit+b2*data$gender
data$w<-sqrt(1/(data$yhat*(1-data$yhat)))
logit_2<-lm(w~profit+gender,data=data)
summary(logit_2)
Thank you for your help!