[R] MCMC for sampling from ordinal logistic regression
reezwan you
reez88 at yahoo.com
Thu Oct 23 17:48:37 CEST 2008
Your example uses ordinal probit model. I am actually looking for ordinal logit model.
reez
--- On Thu, 10/23/08, Dieter Menne <dieter.menne at menne-biomed.de> wrote:
> From: Dieter Menne <dieter.menne at menne-biomed.de>
> Subject: Re: [R] MCMC for sampling from ordinal logistic regression
> To: r-help at stat.math.ethz.ch
> Date: Thursday, October 23, 2008, 11:36 AM
> reezwan you <reez88 <at> yahoo.com> writes:
>
> > Is there a R-function that can generate samples from
> the posterior
> distribution of an ordered logistic regression model (just
> like
> MCMCoprobit from MCMCpack in R).
> >>
>
> I am confused. What's missing in the output of
> MCMCpack?
>
> library(MCMCpack)
> x1 <- rnorm(100); x2 <- rnorm(100);
> z <- 1.0 + x1*0.1 - x2*0.5 + rnorm(100);
> y <- z; y[z < 0] <- 0; y[z >= 0 & z <
> 1] <- 1;
> y[z >= 1 & z < 1.5] <- 2; y[z >= 1.5]
> <- 3;
> out1 <- MCMCoprobit(y ~ x1 + x2, tune=0.3)
>
> str(out)
> plot(out1)
>
>
> Dieter
>
> ______________________________________________
> R-help at 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.
More information about the R-help
mailing list