[R] MCMClogit: using weights

Prof Brian Ripley ripley at stats.ox.ac.uk
Sun Oct 19 07:39:54 CEST 2008


On Sat, 18 Oct 2008, reezwan you wrote:

> Hi everyone: I am just wondering how can I use weights with MCMClogit 
> function (in MCMCpack package). For example, in case of glm function as 
> given below, there is weights option in the arguments. Aparently there 
> is no option of using weights in MCMClogit.

They are case weights, so you can do this via replication (if the case 
numbers are integer).  There's an example at the top of

http://www2.warwick.ac.uk/fac/sci/statistics/apts/students/resources-2007-2008/cis-apts2-r.r

of doing this for a problem from MASS (the book).

> glm(formula, family = gaussian, data, weights, subset,
>    na.action, start = NULL, etastart, mustart,
>    offset, control = glm.control(...), model = TRUE,
>    method = "glm.fit", x = FALSE, y = TRUE, contrasts = NULL, ...)
>
>
> MCMClogit(formula, data = parent.frame(), burnin = 1000, mcmc = 10000,
>   thin=1, tune=1.1, verbose = 0, seed = NA,  beta.start = NA,
>   b0 = 0, B0 = 0, user.prior.density=NULL, logfun=TRUE,
>   marginal.likelihood=c("none", "Laplace"), ...)

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



More information about the R-help mailing list