Re: [R] proportional odds logistic regression with non-negative constraint for several coefficients

2017-01-28 Thread Rune Haubo
Hi Zhao, This is not a direct answer to your question, but a suggestion for a different approach. The ordinal package was designed to cope with issues like this (parameter constraints in ordinal regression models) - try the following: > library(ordinal) > data(wine, package="ordinal") > ## Fit

Re: [R] Regression Overdispersion?

2015-02-01 Thread Rune Haubo
A third, and often preferable, way is to add an observation-level random effect: library(lme4) data1$obs - factor(seq_len(nrow(data1))) model - glmer(y ~ x1 + x2 + (1 | obs), family=poisson(link=log), data=data1) See http://glmm.wikidot.com/faq and search for individual-level random effects.

Re: [R] se.fit option to the predict.nls() function

2015-01-05 Thread Rune Haubo
On 5 January 2015 at 21:08, Ben Bolker bbol...@gmail.com wrote: Roger Coppock rcoppock at cox.net writes: When will R implement the se.fit option to the predict.nls() function? Is there some schedule? I think this is unlikely to happen, ever (sorry). The exact method for finding

Re: [R] Checking the proportional odds assumption holds in an ordinal logistic regression using polr function

2014-11-26 Thread Rune Haubo
Dear Charlie, I admit that I haven't read your email closely, but here is a way to test for non-proportional odds using the ordinal package (warning: self-promotion) using the wine data set also from the ordinal package. There is more information in the package vignettes Hope this is something

Re: [R] Checking the proportional odds assumption holds in an ordinal logistic regression using polr function

2014-11-26 Thread Rune Haubo
On 26 November 2014 at 17:55, Charlotte Whitham charlotte.whit...@gmail.com wrote: Dear Rune, Thank you for your prompt reply and it looks like the ordinal package could be the answer I was looking for! If you don't mind, I'd also like to know please what to do if the tests show the

Re: [R] Error clmm(){ordinal}

2014-06-04 Thread Rune Haubo
Aurore, I don't know if car::Anova is able/should be able to produce anova tables for clmm objects; I usually use drop1() (and sometimes add1) to test terms in CLMMS: library(ordinal) fm1 - clmm(rating ~ temp + contact + (1|judge), data=wine) drop1(fm1, test=Chi) Single term deletions Model:

Re: [R] Error clmm(){ordinal}

2014-06-02 Thread Rune Haubo
It's telling you that one or more of the grouping factors for the random-effect terms has less than three levels. From what you write, this seems to apply to Location: you may want to treat it as a fixed-effect instead. Hope this helps, Rune On 2 June 2014 14:00, adesgroux

Re: [R] Problems with clmm2 (ordinal data fit)

2014-03-16 Thread Rune Haubo
Dear Caroline, Yes, it seems you have complete separation for the 'Timepoint' variable. This means that the likelihood is unbounded for that parameter and the optimizer just terminates when it gets far enough out on an asymptote and improvements are below a threshold. This is also the reason the

Re: [R] Multilevel analysis for ordinal responses

2014-03-01 Thread Rune Haubo
Yes; see clm and clmm2 (mixed effects) in the ordinal package for fitting proportional odds models. See section 3 of http://cran.r-project.org/web/packages/ordinal/vignettes/clm_tutorial.pdf to see how to test the proportional odds assumption with clm - it is equivalent for clmm2 models. For an

Re: [R] Chi-square values in GLM model comparison

2013-09-11 Thread Rune Haubo
There is no argument 'test' to anova.clm hence the error message. The likelihood ratio statistic (or, alternatively, G^2 statistic or Deviance statistic) has an asymptotic chi-square distribution, so it is the size of that statistic your reviewers are asking for. It is printed in the anova output

Re: [R] p values of lmer

2013-06-19 Thread Rune Haubo
Try library(lmerTest) fm1 - lmer(Reaction ~ Days + (Days|Subject), sleepstudy) summary(fm1) Linear mixed model fit by REML Formula: Reaction ~ Days + (Days | Subject) Data: sleepstudy AIC BIC logLik deviance REMLdev 1756 1775 -871.8 17521744 Random effects: Groups Name

Re: [R] multilevel binary and ordered regression models

2013-06-13 Thread Rune Haubo
it says that I got to following the (1|factor) format. I would appreciate that if you could point me to the right direction. Also, I know I am dealing with a relatively large data set, but is there any way to speed up the estimation a bit. Thanks a lot! Jun On Fri, Jun 7, 2013 at 1:04 AM, Rune

Re: [R] multilevel binary and ordered regression models

2013-06-06 Thread Rune Haubo
On 6 June 2013 00:13, Xu Jun junx...@gmail.com wrote: Dear r-helpers, I have two questions on multilevel binary and ordered regression models, respectively: 1. Is there any r function (like lmer or glmer) to run multilevel ordered regression models? Yes, package ordinal will fit such

Re: [R] Optimisation and NaN Errors using clm() and clmm()

2013-04-20 Thread Rune Haubo
On 18 April 2013 18:38, Thomas Foxley thomasfox...@aol.com wrote: Rune, Thank you very much for your response. I don't actually have the models that failed to converge from the first (glmulti) part as they were not saved with the confidence set. glmulti generates thousands of models so it

Re: [R] Optimisation and NaN Errors using clm() and clmm()

2013-04-16 Thread Rune Haubo
On 15 April 2013 13:18, Thomas thomasfox...@aol.com wrote: Dear List, I am using both the clm() and clmm() functions from the R package 'ordinal'. I am fitting an ordinal dependent variable with 5 categories to 9 continuous predictors, all of which have been normalised (mean subtracted

Re: [R] Test of Parallel Regression Assumption in R

2013-03-12 Thread Rune Haubo
with the VGAM package, but I am not as well versed in that package. Hope this helps, Rune Rune Haubo Bojesen Christensen Postdoc DTU Compute - Section for Statistics --- Technical University of Denmark Department of Applied Mathematics and Computer

Re: [R] Ordered probit using clm2

2012-11-06 Thread Rune Haubo
Hi Alice, A factor is a fairly basic R concept that you can read about in http://cran.r-project.org/doc/manuals/R-intro.pdf on page 16. Now to fit the CLM, you need to turn your response variable into a factor with something like datareg$Newpercentagecash - factor(datareg$Newpercentagecash,

Re: [R] Find correlation in Clmm?

2012-09-11 Thread Rune Haubo
Den 11/09/2012 16.36 skrev Anera Salucci a.salu...@yahoo.com: Hi all, I am trying to fit a random effect model to categorical response variable using package ordinal /clmm. How can I find the correlation between random effects (random intercept and random slope) You cannot, as such models

Re: [R] Package 'MASS' (polr): Error in svd(X) : infinite or missing values in 'x'

2012-07-10 Thread Rune Haubo
-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Rune Haubo Bojesen Christensen Ph.D. Student, M.Sc. Eng. Phone: (+45) 45 25 33 63 Mobile: (+45) 30 26 45 54 DTU Informatics, Section

Re: [R] significance level (p) for t-value in package zelig

2012-06-26 Thread Rune Haubo
...@stats.ox.ac.uk wrote: On 25/06/2012 09:32, Rune Haubo wrote: According to standard likelihood theory these are actually not t-values, but z-values, i.e., they asymptotically follow a standard normal distribution under the null hypothesis. This means that you Whose 'standard'? It is conventional

Re: [R] significance level (p) for t-value in package zelig

2012-06-25 Thread Rune Haubo
://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. -- Rune Haubo Bojesen Christensen PhD Student, M.Sc. Eng. Phone: (+45) 45 25 33 63 Mobile: (+45) 30 26 45 54

Re: [R] Ordinal logistic regression p-values

2011-08-30 Thread Rune Haubo
/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. -- Rune Haubo Bojesen Christensen Ph.D. Student, M.Sc. Eng. Phone: (+45) 45 25 33 63 Mobile: (+45) 30 26 45 54 DTU Informatics, Section

Re: [R] Testing the proportional odds assumption of an ordinal generalized estimating equations (GEE) regression model

2011-06-30 Thread Rune Haubo
the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Rune Haubo Bojesen Christensen Ph.D. Student, M.Sc. Eng. Phone: (+45) 45 25 33 63 Mobile: (+45) 30 26 45 54 DTU Informatics, Section for Statistics Technical

Re: [R] Longitudinal categorical response data

2011-03-26 Thread Rune Haubo
lmer is not designed for ordered categorical data as yours are. You could take a look at the ordinal package which is designed for this type of data including mixed models (function clmm) which you probably want to use. Best, Rune Den 24/03/2011 21.03 skrev Rasanga Ruwanthi

[R] [R-pkgs] New package: ordinal

2010-03-16 Thread Rune Haubo
. - helpful package vignettes. - implementation of core functions in C. Comments, critique, suggestions, wishes and contributions are always highly appreciated. Kind regards Rune -- Rune Haubo Bojesen Christensen PhD student, M.Sc. Eng. Phone: (+45) 45 25 33 63 Mail: rhbc at imm.dtu.dk

Re: [R] Likelihood ratio test between glm and glmer fits

2008-07-17 Thread Rune Haubo
__ 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. -- Rune Haubo Bojesen Christensen

Re: [R] difference between MASS::polr() and Design::lrm()

2008-06-30 Thread Rune Haubo
Dear Vito No, you are not wrong, but you should center score prior to model estimation: summary(fm1 - polr(factor(grade)~I(score - mean(score which gives the same standard errors as do lrm. Now the intercepts refer the median score rather than some potential unrealistic score of 0. You can

Re: [R] difference between MASS::polr() and Design::lrm()

2008-06-30 Thread Rune Haubo
. Of course profile-Lik based CI may be very usefuls at this aim..but this is another story.. I agree, but the topic is closely related to standard errors ;-) Best Rune many thanks again, vito Rune Haubo ha scritto: Dear Vito No, you are not wrong, but you should center score prior

Re: [R] ANOVA between linear models.

2008-05-16 Thread Rune Haubo
Hi Richard You are trying to compare two models, that are not nested. This means that all usual asymptotics of the test statistics break down, hence the (second) test you are attempting is not meaningful. Usually one decides on the form of the response on other grounds such as residual analysis

Re: [R] Mixed model Nested ANOVA

2008-02-22 Thread Rune Haubo
Hi Stephen On 22/02/2008, Stephen Cole [EMAIL PROTECTED] wrote: hello R help I am trying to analyze a data set that has been collected from a hierarchical sampling design. The model should be a mixed model nested ANOVA. The purpose of my study is to analyze the variability at each