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
Setting start values for log binomial model in glmmPQL
4 messages · Ben Bolker, Thierry Onkelinx, Jennifer Yourkavitch
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
Dear Jennifer, Are you sure that the result of c(coefini,1, 0) is a vector of length 16? The output of c() could be something else than a vector. Best regards, ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest team Biometrie & Kwaliteitszorg / team Biometrics & Quality Assurance Kliniekstraat 25 1070 Anderlecht Belgium To call in the statistician after the experiment is done may be no more than asking him to perform a post-mortem examination: he may be able to say what the experiment died of. ~ Sir Ronald Aylmer Fisher The plural of anecdote is not data. ~ Roger Brinner The combination of some data and an aching desire for an answer does not ensure that a reasonable answer can be extracted from a given body of data. ~ John Tukey 2016-05-01 23:20 GMT+02:00 Jennifer Yourkavitch via R-sig-mixed-models < r-sig-mixed-models at r-project.org>:
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
Yes, I think you're right. A friend pointed out that I need to specify the coefficients for the fixed effects only. Thanks, Jennifer
On May 2, 2016, at 2:40 PM, Thierry Onkelinx <thierry.onkelinx at inbo.be> wrote: Dear Jennifer, Are you sure that the result of c(coefini,1, 0) is a vector of length 16? The output of c() could be something else than a vector. Best regards, ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest team Biometrie & Kwaliteitszorg / team Biometrics & Quality Assurance Kliniekstraat 25 1070 Anderlecht Belgium To call in the statistician after the experiment is done may be no more than asking him to perform a post-mortem examination: he may be able to say what the experiment died of. ~ Sir Ronald Aylmer Fisher The plural of anecdote is not data. ~ Roger Brinner The combination of some data and an aching desire for an answer does not ensure that a reasonable answer can be extracted from a given body of data. ~ John Tukey 2016-05-01 23:20 GMT+02:00 Jennifer Yourkavitch via R-sig-mixed-models <r-sig-mixed-models at r-project.org>:
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