[R-sig-ME] Setting start values for log binomial model in glmmPQL
Ben Bolker
bbolker at gmail.com
Mon May 2 20:33:29 CEST 2016
This is a perfectly reasonable question, but it would be easier to
answer with a reproducible example. See e.g
http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example
On Sun, May 1, 2016 at 5:20 PM, Jennifer Yourkavitch via
R-sig-mixed-models <r-sig-mixed-models at r-project.org> wrote:
> 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]]
>
> _______________________________________________
> R-sig-mixed-models at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
More information about the R-sig-mixed-models
mailing list