On Jun 22, 2009, at 12:35 PM, francogrex wrote:


Hello, I have this generalized linear formula:
log(x[i]/n[i])=log(sum(x)/sum(n)) + beta[i]
where the the x[i] and the n[i] are known.
Is there a way to program the GLM procedure to input the formula above and get the beta[i] estimates? If not the GLM is there another procedure to do that? The aim also afterwards is to estimate the profile-likelihood CIs for
the beta parameters.

Not as stated. That would be expecting R to have symbolic algebraic capabilities. Maybe next year^Wdecade?

That model is equivalent to:

log(x[i]/n[i])=log(sum(x)) - log(sum(n)) + beta[i]

So you could use a no-intercept model with log link in glm() and an offset term for the first two terms of the r.h.s.

probi <- (x[i]/n[i])
glm(probi ~ 0 + offset(log(sum(x)) - log(sum(n) ), family=poisson)
--

David Winsemius, MD
Heritage Laboratories
West Hartford, CT

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to