Hi all,
I am trying to do a ordered probit regression using polr(), replicating a
result from SAS.
>polr(y ~ x, dat, method='probit')
suppose the model is y ~ x, where y is a factor with 3 levels and x is a
factor with 5 levels,
To get coefficients, SAS by default use the last level as reference, R by
default use the first level (correct me if I was wrong),
The result I got is a mixture, using first and last for different variables.
I tried relevel, reorder, contrasts, but no success. I found what really
matters is
>options(contrasts = c("contr.treatment", "contr.poly"))
or
>options(contrasts = c("contr.SAS", "contr.poly"))
so I guess I can set "contrasts= a list of contrasts" for each variables in
polr(), but I cannot successfuly set the contrasts, what is the syntax?
Is there a better way to do this?
Thank you very much,
Tian
[[alternative HTML version deleted]]
______________________________________________
[email protected] 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.