[R-sig-ME] Setting start values for log binomial model in glmmPQL
Jennifer Yourkavitch
jenyourkavitch at yahoo.com
Sun May 1 23:20:19 CEST 2016
Hello,
I'm having trouble setting starting values and I think there is a problem with my syntax for the “start” command.
First, I’m trying to use the coefficients from a logit model as start values for the log binomial model I want to run:
coefini=coef(glmmPQL(anybf~n_dis +mage_r+mage_sq+married+parity_r+nhblack+hisp+nhasian+mom_lths+mom_sclg+mom_ba+mwork+medicaid+nodad+mom_foreign,
random=~1|grptr0010,family = binomial))
summary(coefini)
#coefini model looks good and runs
fit2<-glmmPQL(anybf~n_dis +mage_r+mage_sq+married+parity_r+nhblack+hisp+nhasian+mom_lths+mom_sclg+mom_ba+mwork+medicaid+nodad+mom_foreign,
random=~1|grptr0010,family = binomial(log),start=c(coefini,1, 0))
summary(fit2)
I get this error:
Error in glm.fit(x = c(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, :
length of 'start' should equal 16 and correspond to initial coefs for c("(Intercept)", "n_dis", "mage_r", "mage_sq", "married", "parity_r", , "nhblack", "hisp", "nhasian", "mom_lths", "mom_sclg", "mom_ba", , "mwork", "medicaid", "nodad", "mom_foreign")
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
So then I tried typing in the coefficients from the logit model directly:
fit2<-glmmPQL(anybf~n_dis +mage_r+mage_sq+married+parity_r+nhblack+hisp+nhasian+mom_lths+mom_sclg+mom_ba+mwork+medicaid+nodad+mom_foreign,
random=~1|grptr0010,family = binomial(log),start=c(0.0675, -0.127, 0.008, -0.0002, 0.369, -0.111, -0.0795, 0.363, 0.1387, -0.121, 0.415, 0.861, 0.023, -0.033, -0.307, 0.915))
summary(fit2)
And I get this error:
Error: cannot find valid starting values: please specify some
Can you see the problem?
Thanks!
Jennifer
[[alternative HTML version deleted]]
More information about the R-sig-mixed-models
mailing list