I have data $y$ which is the rate of success in $n$ trials. I also have covariates $X$ that I want to regress against $y$ to understand the relationship between them. I tried 2 different approaches. The first is to take the log of $y$ and apply OLS regression. The second is to apply logistic regression to $y$ directly.
I noticed that one theoretically important coefficient, call it $x_0$, is highly significant in both models but in OLS it is estimated as a strong negative effect and in logistic regression it is a small but positive effect.
How is this possible? The variable is binary and I am comparing the standardized coefficients from both models. My assumption is that $x_0$ either increases the rate or not and it should be of the same sign in both models.
When my only regressor is $x_0$ this doesn't happen, it's only when I add the other covariates (of which there is about $200$). I have pasted the output of the full models below, excluding the estimates of the other covariates.
Call: lm(formula = fx, data = fit_data, weights = weights) Weighted Residuals: Min 1Q Median 3Q Max -5.044177447 -0.616615480 0.070124542 0.692928438 4.539252302 Coefficients Estimate Std. Error t value Pr(>|t|) (Intercept) -1.33734283e+04 4.75932218e+03 -2.80994 0.00495879 ** x0 -1.06636833e-01 2.63420263e-02 -4.04816 5.1773e-05 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 1.01868241 on 25500 degrees of freedom Multiple R-squared: 0.59443022, Adjusted R-squared: 0.591090233 F-statistic: 177.973843 on 210 and 25500 DF, p-value: < 2.220446e-16
Call: glm(formula = fx, family = "binomial", data = fit_data, weights = weights) Deviance Residuals: Min 1Q Median 3Q Max -103.51742894 -3.06309844 -0.24575206 2.27364818 165.10350046 Coefficients: Estimate Std. Error z value Pr(>|z|) (Intercept) 2.83201590e+03 1.31990079e+03 2.14563 0.03190268 * x0 1.77428670e-02 1.90814767e-03 9.29848 < 2.22e-16 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 (Dispersion parameter for binomial family taken to be 1) Null deviance: 9542439.111 on 25710 degrees of freedom Residual deviance: 2224838.019 on 25500 degrees of freedom AIC: 2340850.46 Number of Fisher Scoring iterations: 8 ```