From: Spencer Graves <spencer.graves_at_pdf.com>

Date: Mon 14 Mar 2005 - 03:40:08 EST

R-help@stat.math.ethz.ch mailing list

https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Mon Mar 14 12:46:59 2005

Date: Mon 14 Mar 2005 - 03:40:08 EST

I whole-heartedly endorse Prof. Ripley's suggestion to write down the log(likelihood) and use optim; I've done that many times with seemingly good results. For confidence intervals, the best procedure is to use 2*log(likelihood ratio) being approximately chi-square. If you are estimating two parameters, you can easily compute log(likelihood) for a grid of points about the maximum likelihood estimates (MLEs) and use "contour" to draw lines at the difference confidence levels. You can also use the argument "hessian = TRUE" to get the observed information matrix and therefore also the covariance matrix of the standard asymptotic normal approximation to the distribution of the MLEs; I've done both.

hope this helps. spencer graves

Prof Brian Ripley wrote:

> On Sat, 12 Mar 2005, Erin M Simpson wrote:

*>
**>> I am looking for code that allows for a more flexible negative binomial
**>> model (similar to Stata's "gnbreg").
**>
**>
**> Your subject line is not clear to me: Stata appears to fit a negative
**> binomial model, the point being that it is not a glm as fitted by
**> glm.nb. (So when Stata says
**>
**> `gnbreg is a generalized negative binomial regression'
**>
**> it is `regression' not `negative binomial' that is being generalized.)
**>
**>> In particular, I am looking to be able to model the ancillary
**>> shape parameter in terms of a series of covariates. So if,
**>>
**>> y[i] ~ poisson(mu[i])
**>>
**>> mu[i] = exp(x[i]beta + u[i])
**>>
**>> exp(u[i]) ~ Gamma(1/alpha, alpha)
**>>
**>> I am looking to parameterize alpha as exp(z[i]gamma).
**>>
**>> If you are familiar with a package that allows for this, I'd appreciate
**>> the heads up. Similar information that allows for first differences
**>> with
**>> such a model is also appreciated.
**>
**>
**> Just write down the log-likelihood (I am not sure what the free
**> parameters here are: are beta and gamma vectors?), and call optim() to
**> maximize it.
**>
*

R-help@stat.math.ethz.ch mailing list

https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Mon Mar 14 12:46:59 2005

*
This archive was generated by hypermail 2.1.8
: Fri 03 Mar 2006 - 03:30:47 EST
*