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 mo

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 wrote: > Roger Coppock 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 confidence inte

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 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 proportional odds assumpti

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 yo

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 M

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 wrote: > Dear all, > >

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 v

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 int

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 NameV

Re: [R] multilevel binary and ordered regression models

2013-06-13 Thread Rune Haubo
rmat. 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 Haubo wrote:

Re: [R] multilevel binary and ordered regression models

2013-06-06 Thread Rune Haubo
On 6 June 2013 00:13, Xu Jun 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 models. Cheers,

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

2013-04-20 Thread Rune Haubo
On 18 April 2013 18:38, Thomas Foxley 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 seems reasonabl

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

2013-04-15 Thread Rune Haubo
On 15 April 2013 13:18, Thomas 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 then divided > b

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

2013-03-11 Thread Rune Haubo
ou can also make similar tests 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

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, orde

Re: [R] Find correlation in Clmm?

2012-09-11 Thread Rune Haubo
Den 11/09/2012 16.36 skrev "Anera Salucci" : > > 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 are not

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

2012-07-10 Thread Rune Haubo
ddress this error, I would very much > appreciate your response. > > Thank you in advance. > > Jeremy > > Date File Attachment (200 rows): > http://r.789695.n4.nabble.com/file/n4635829/20120709_JLittle_data_file.txt > 20120709_JLittle_data_file.txt > > > -- > View this message in context

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

2012-06-26 Thread Rune Haubo
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 'st

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

2012-06-25 Thread Rune Haubo
t; Website: > http://pharmadevelopment.roche.com/index/pdb/pdb-functional-groups/pdb-biostatistics/pdb-ncb-home.htm > >        [[alternative HTML version deleted]] > > > __ > R-help@r-project.org mailing list > https://stat.ethz.ch/mail

Re: [R] Ordinal logistic regression p-values

2011-08-29 Thread Rune Haubo
lt University > -- > View this message in context: > http://r.789695.n4.nabble.com/Ordinal-logistic-regression-p-values-tp3777674p368.html > Sent from the R help mailing list archive at Nabble.com. > > ______ > R-help@r-project.org ma

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

2011-06-30 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 Ph.D. Student, M.Sc. Eng. Phone: (+45) 45 25 33 63 Mobile:

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" : > > Dear List, > >

[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
lihood, so they should be, I think. >> Any help would be appreciated. >> >> Corey >> >> Corey S. Sparks, Ph.D. >> >> Assistant Professor >> Department of Demography and Organization Studies >> University of Texas San Antonio >> One UTSA Circle >&g

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

2008-06-30 Thread Rune Haubo
el: summary(glm(grade > 3 ~ score, family = binomial)) as well as by lrm in package Design. > > 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 tha

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] 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 or

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