similar to: Setting contrasts for polr() to get same result of SAS

Displaying 20 results from an estimated 10000 matches similar to: "Setting contrasts for polr() to get same result of SAS"

2011 Mar 01
1
How to understand output from R's polr function (ordered logistic regression)?
I am new to R, ordered logistic regression, and polr. The "Examples" section at the bottom of the help page for polr<http://stat.ethz.ch/R-manual/R-patched/library/MASS/html/polr.html>(that fits a logistic or probit regression model to an ordered factor response) shows options(contrasts = c("contr.treatment", "contr.poly")) house.plr <- polr(Sat ~ Infl +
2008 Sep 30
2
weird behavior of drop1() for polr models (MASS)
I would like to do a SS type III analysis on a proportional odds logistic regression model. I use drop1(), but dropterm() shows the same behaviour. It works as expected for regular main effects models, however when the model includes an interaction effect it seems to have problems with matching the parameters to the predictor terms. An example: library("MASS"); options(contrasts =
2000 Mar 11
1
polr question
Dear friends. Do Polr in Mass change the sign of the coefficients ? Example (McCullagh 1980) options(contrasts=c("contr.treatment","contr.poly")) library(Mass) freq <- c(19,29,24,497,560,269) yy <- ordered(gl(3,1,6)) z4 <- polr(yy~x,weights=freq) > z4 Call: polr(formula = yy ~ x, weights = freq) Coefficients: x2 -0.6026492 Intercepts: 1|2
2006 Aug 15
1
coefficients' order in polr()?
Hi all, I am using polr(). The resulting coefficients of first levels are always 0. What to do if I wnat to get the coefficients of the last level 0. For example, suppose x has 3 levels, 1, 2, 3 probit <- plor(y ~ x, data1, method='probit') will get coefficients of level 2, 3 of x, but I want coefficients of level 1, 2 Thank you, Tian [[alternative HTML version deleted]]
2009 Jan 13
1
deviance in polr method
Dear all, I've replicated the cheese tasting example on p175 of GLM's by McCullagh and Nelder. This is a 4 treatment (rows) by 9 ordinal response (cols) table. Here's my simple code: #### cheese library(MASS) options(contrasts = c("contr.treatment", "contr.poly")) y = c(0,0, 1, 7, 8,8,19, 8,1, 6,9,12,11, 7,6, 1, 0,0, 1,1, 6, 8,23,7,
2007 Jun 04
2
How to obtain coefficient standard error from the result of polr?
Hi - I am using polr. I can get a result from polr fit by calling result.plr <- polr(formula, data=mydata, method="probit"); However, from the 'result.plr', how can I access standard error of the estimated coefficients as well as the t statistics for each one of them? What I would like to do ultimately is to see which coefficients are not significant and try to refit the
2004 Nov 11
1
polr probit versus stata oprobit
Dear All, I have been struggling to understand why for the housing data in MASS library R and stata give coef. estimates that are really different. I also tried to come up with many many examples myself (see below, of course I did not have the set.seed command included) and all of my `random' examples seem to give verry similar output. For the housing data, I have changed the data into numeric
2008 Mar 15
1
again with polr
hello everybody solved the problem with summary, now I have another one eg I estimate > try.op <- polr( > as.ordered(sod.sit.ec.fam) ~ > log(y) + > log(1 + nfiglimin) + > log(1 + nfiglimagg) + > log(ncomp - nfiglitot) + > eta + > I(eta^2) + >
2011 Feb 16
1
error in optim, within polr(): "initial value in 'vmmin' is not finite"
Hi all. I'm just starting to explore ordinal multinomial regression. My dataset is 300,000 rows, with an outcome (ordinal factor from 1 to 9) and five independent variables (all continuous). My first stab at it was this: pomod <- polr(Npf ~ o_stddev + o_skewness + o_kurtosis + o_acl_1e + dispersal, rlc, Hess=TRUE) And that worked; I got a good model fit. However, a variety of other
2008 Sep 27
1
retrieving weights from a polr object
Dear list members, The polr() function in the MASS package takes an optional weights argument for case weights. Is there any way to retrieve the case weights from the fitted "polr" object? Examining both the object and the code, I don't see how this can be done, but perhaps I've missed something. Any help would be appreciated. John ------------------------------ John Fox,
2006 Aug 15
1
help: cannot allocate vector of length 828310236
Hi all, I was trying a probit regression using polr() and got this message, Error in model.matrix.default(Terms, m, contrasts) : cannot allocate vector of length 828310236 The data is about 20M (a few days ago I asked a question about large file, thank you for responses, then I use MS Access to select those columns I would use). R is 2.3.1, Windows XP, 512M Ram. I am going to read
2013 Oct 18
1
No P.values in polr summary
Hi everyone, If I compute a "Ordered Logistic or Probit Regression" with the polr function from MASS package. the summary give me : coefficients, Standard error and Tvalue.. but not directly the p.value. I can compute "manualy" the Pvalue, but Is there a way to directly obtain the pa.value, and I wonder why the p.valeu is not directly calculated, is there a reason? exemple
2005 Apr 13
2
multinom and contrasts
Hi, I found that using different contrasts (e.g. contr.helmert vs. contr.treatment) will generate different fitted probabilities from multinomial logistic regression using multinom(); while the fitted probabilities from binary logistic regression seem to be the same. Why is that? and for multinomial logisitc regression, what contrast should be used? I guess it's helmert? here is an example
2010 Apr 21
5
Bugs? when dealing with contrasts
R version 2.10.1 (2009-12-14) Copyright (C) 2009 The R Foundation for Statistical Computing ISBN 3-900051-07-0 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. Natural language support but running in an English locale R is a collaborative project with
2011 May 11
1
Help with contrasts
Hi, I need to build a function to generate one column for each level of a factor in the model matrix created on an arbitrary formula (instead of using the available contrasts options such as contr.treatment, contr.SAS, etc). My approach to this was first to use the built-in function for contr.treatment but changing the default value of the contrasts argument to FALSE (I named this function
2010 Dec 22
1
tests on polr object
Using ordered probit model, I get errors from dwt and bptest. dwt: Error in durbinWatsonTest.default(...) : requires vector of residuals bptest: Error in storage.mode(y) <- "double" : invalid to change the storage mode of a factor I imagine I have to restate as an individual probit model for each category, but is there an easier way? thanks, bp [[alternative HTML version
2008 Aug 26
2
options("contrasts")
Code: > options("contrasts") $contrasts factor ordered "contr.treatment" "contr.poly" I want to change the first entry ONLY, without retyping "contr.poly". How do I do it? I have tried various possibilities and cannot get anything to work. I found out that the response to options("contrasts") has class
2004 Mar 03
1
Confusion about coxph and Helmert contrasts
Hi, perhaps this is a stupid question, but i need some help about Helmert contrasts in the Cox model. I have a survival data frame with an unordered factor `group' with levels 0 ... 5. Calculating the Cox model with Helmert contrasts, i expected that the first coefficient would be the same as if i had used treatment contrasts, but this is not true. I this a error in reasoning, or is it
2004 Dec 03
3
multinomial probit
Hello All, I'm trying to run a multinomial probit on a dataset with 28 data points and five levels (0,1,2,3,4) in the latent choice involving response variable. I downloaded the latest mnp package to run the regression. It starts the calculation and then crashes the rpogram. I wish I could give the error message but it literally shuts down R without a warning. I'm using the R
2004 Mar 24
2
Ordered logit/probit
Hello everyone I am trying to fit an ordered probit/logit model for bank rating prediction. Besides polr() in MASS package which is not written especially for this as far as I know, do you know how else I can do this? I already found the modified polr () version on the Valentin STANESCU Enrst and Young Tel. 402 4000 ---------------------------------------------------------- The information