I'm trying to estimate child work based on a lagged variable on children's school aspirations.
I'm deciding whether I should use glm or clogit to run my models (need fixed effect logits). When I run my glm, my coefficients are very different from my clogit.
model1 <- glm(chldwork~lag_aspgrade_binned+age+as.factor(childid), data=finaletdtlag, family='binomial')
GLM Output:
Call:
glm(formula = chldwork ~ lag_aspgrade_binned + age + as.factor(childid),
family = "binomial", data = finaletdtlag)
Deviance Residuals:
Min 1Q Median 3Q Max
-3.02350 0.00001 0.00002 0.17344 2.13769
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) 3.037e+01 1.933e+04 0.002 0.9987
lag_aspgrade_binneddid not complete elementary 2.339e+00 1.083e+00 2.161 0.0307 *
lag_aspgrade_binnedhs 1.252e+00 6.082e-01 2.059 0.0395 *
lag_aspgrade_binnedprimary some hs 1.206e+00 6.739e-01 1.789 0.0735 .
lag_aspgrade_binnedsome college 2.081e+00 4.800e-01 4.335 1.46e-05 ***
age -6.123e-01 3.995e-02 -15.326 < 2e-16 ***
Also, when I ran my clogit, I didn't get an intercept in my output (like this example shows: https://data.princeton.edu/wws509/r/fixedRandom3).
My clogit output:
> modela <- clogit(chldwork~lag_aspgrade_binned+age+strata(childid), data=finaletdtlag, method = 'exact')
> summary(modela)
Call:
coxph(formula = Surv(rep(1, 2770L), chldwork) ~ lag_aspgrade_binned +
age + strata(childid), data = finaletdtlag, method = "exact")
n= 2770, number of events= 2358
coef exp(coef) se(coef) z Pr(>|z|)
lag_aspgrade_binneddid not complete elementary 1.09351 2.98473 0.83332 1.312 0.18944
lag_aspgrade_binnedhs 0.53032 1.69948 0.45095 1.176 0.23959
lag_aspgrade_binnedprimary some hs 0.49815 1.64567 0.50075 0.995 0.31983
lag_aspgrade_binnedsome college 1.00269 2.72560 0.34619 2.896 0.00377 **
age -0.36846 0.69180 0.02905 -12.684 < 2e-16 ***
Do I have an error in my code? Do y'all prefer one to the other?