Re: [R] Likelihood ratio test in porl (MASS)

2016-07-27 Thread Faradj Koliev
elp-boun...@r-project.org] On Behalf Of Faradj Koliev >> Sent: July 27, 2016 4:50 AM >> To: r-help@r-project.org >> Subject: [R] Likelihood ratio test in porl (MASS) >> >> Dear all, >> >> A quick question: Let’s say I have a full and a restricted

Re: [R] Likelihood ratio test in porl (MASS)

2016-07-27 Thread Fox, John
lps, John - John Fox, Professor McMaster University Hamilton, Ontario Canada L8S 4M4 Web: socserv.mcmaster.ca/jfox > -Original Message- > From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Faradj Koliev > Sent: July 27, 2016 4:50 AM > To: r-help@r-project.org >

Re: [R] Likelihood ratio test in porl (MASS)

2016-07-27 Thread Achim Zeileis
On Wed, 27 Jul 2016, Faradj Koliev wrote: Dear all, A quick question: Let?s say I have a full and a restricted model that looks something like this: Full<- polr(Y ~ X1+X2+X3+X4, data=data, Hess = TRUE, method="logistic?) # ordered logistic regression Restricted<- polr(Y ~ X1+X2+X3,

[R] Likelihood ratio test in porl (MASS)

2016-07-27 Thread Faradj Koliev
Dear all, A quick question: Let’s say I have a full and a restricted model that looks something like this: Full<- polr(Y ~ X1+X2+X3+X4, data=data, Hess = TRUE, method="logistic”) # ordered logistic regression Restricted<- polr(Y ~ X1+X2+X3, data=data, Hess = TRUE, method="logistic”) #

[R] likelihood ratio test for mean difference assuming unequal variance

2014-01-13 Thread Amanda Li
Hello, I am so sorry, but I have been struggling with the code for the entire day. I have a very simple dataset that looks like this: response=c(45,47,24,35,47,56,29) sub=c(A,A,B,B,C,C,C£© time=c(1,2,1,2,1,2,3) gdata=cbind(response,sub,time) Namely, for three subjects, each has 2 or 3

Re: [R] likelihood ratio test for mean difference assuming unequal variance

2014-01-13 Thread Ben Bolker
Amanda Li amandali at uchicago.edu writes: Hello, I am so sorry, but I have been struggling with the code for the entire day. I have a very simple dataset that looks like this: response=c(45,47,24,35,47,56,29) sub=c(A,A,B,B,C,C,C£© time=c(1,2,1,2,1,2,3)

[R] Likelihood ratio test for comparing non-nested cox models

2013-05-01 Thread Hans-Ulrich Klein
Dear All, I fitted two non-nested proportional hazards models using the coxph() function from package survival. Now, I would like to apply a model selection test like, e.g., the likelihood ratio test proposed by Vuong. I found an implementation of Vuong's test in the package 'pscl', but that

[R] Likelihood ratio test

2011-06-12 Thread Diviya Smith
Hello there, I want to perform a likelihood ratio test to check if a single exponential or a sum of 2 exponentials provides the best fit to my data. I am new to R programming and I am not sure if there is a direct function for doing this and whats the best way to go about it? #data x - c(1 ,10,

Re: [R] Likelihood ratio test

2011-06-12 Thread Jorge Ivan Velez
Hi Diviya, Take a look at the lrtest function in the lmtest package: install.packages('lmtest) require(lmtest) ?lrtest HTH, Jorge On Sun, Jun 12, 2011 at 1:16 PM, Diviya Smith wrote: Hello there, I want to perform a likelihood ratio test to check if a single exponential or a sum of 2

Re: [R] Likelihood ratio test

2011-06-12 Thread Achim Zeileis
On Sun, 12 Jun 2011, Jorge Ivan Velez wrote: Hi Diviya, Take a look at the lrtest function in the lmtest package: install.packages('lmtest) require(lmtest) ?lrtest Yes, when you have to nls() fits, say m1 and m2, you can do lrtest(m1, m2) However, I don't think that both m1 and m2 can be

[R] likelihood ratio test

2011-05-26 Thread karuna m
Dear R-help, Can anybody tell me which R package has Lo-Mendell Rubin LR test and Bootstrap LR test to compare the model fit between k class and k+1 class model for Latent class analysis? Thanks in advance,  warn regards,Ms.Karunambigai M PhD Scholar Dept. of Biostatistics NIMHANS Bangalore

Re: [R] likelihood ratio test

2011-05-26 Thread Ben Bolker
karuna m m_karuna2002 at yahoo.com writes: Can anybody tell me which R package has Lo-Mendell Rubin LR test and Bootstrap LR test to compare the model fit between k class and k+1 class model for Latent class analysis? I don't know, but library(sos) findFn(Lo-Mendell) findFn({latent

[R] likelihood ratio test between glmer and glm

2010-03-14 Thread Davnah Urbach
I am currently running a generalized linear mixed effect model using glmer and I want to estimate how much of the variance is explained by my random factor. summary(glmer(cbind(female,male)~date+(1|dam),family=binomial,data= liz3)) Generalized linear mixed model fit by the Laplace

Re: [R] likelihood ratio test between glmer and glm

2010-03-14 Thread hadley wickham
Based on a discussion found on the R mailing list but dating back to 2008, I have compared the log-likelihoods of the glm model and of the glmer model as follows: lrt - function (obj1, obj2){ L0 - logLik(obj1) L1 - logLik(obj2) L01 - as.vector(- 2 * (L0 - L1)) df - attr(L1, df) -

Re: [R] likelihood ratio test between glmer and glm

2010-03-14 Thread Davnah Urbach
Thanks for this answer but does that mean that working with the deviances is better? Or how else could I evaluate the importance of my random terms? Many thanks, Davnah On Mar 14, 2010, at 8:12 PM, hadley wickham wrote: Based on a discussion found on the R mailing list but dating back

Re: [R] likelihood ratio test between glmer and glm

2010-03-14 Thread Ben Bolker
Davnah Urbach Davnah.Urbach at dartmouth.edu writes: Thanks for this answer but does that mean that working with the deviances is better? Or how else could I evaluate the importance of my random terms? You should probably (a) search the archives of the r-sig-mixed-models mailing list and

[R] Likelihood ratio test using R

2008-11-04 Thread Maithili Shiva
Hi! I am working on the Logistic Regression using R. My R script is as follows ONS - read.csv(ONS.csv,header = TRUE) ONS.glm - glm(Y ~ Age1+Age2+Sex+Education+Profession+TimeInJob+

[R] Likelihood ratio test using R

2008-11-04 Thread Maithili Shiva
Hi! I am working on the Logistic Regression using R. My R script is as follows ONS - read.csv(ONS.csv,header = TRUE) ONS.glm - glm(Y ~ Age1+Age2+Sex+Education+Profession+TimeInJob+

Re: [R] Likelihood ratio test using R

2008-11-04 Thread C.H.
For the third one: ?anova.glm test=Chisq will be LRT. For the first two, you can have the answer from ordinary stat book. On Wed, Nov 5, 2008 at 1:11 PM, Maithili Shiva [EMAIL PROTECTED] wrote: Hi! I am working on the Logistic Regression using R. My R script is as follows ONS -

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

2008-07-19 Thread Göran Broström
This particular case with a random intercept model can be handled by glmmML, by bootstrapping the p-value. Best, Göran On Thu, Jul 17, 2008 at 1:29 PM, Douglas Bates [EMAIL PROTECTED] wrote: On Thu, Jul 17, 2008 at 2:50 AM, Rune Haubo [EMAIL PROTECTED] wrote: 2008/7/16 Dimitris Rizopoulos

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

2008-07-17 Thread Rune Haubo
2008/7/16 Dimitris Rizopoulos [EMAIL PROTECTED]: well, for computing the p-value you need to use pchisq() and dchisq() (check ?dchisq for more info). For model fits with a logLik method you can directly use the following simple function: lrt - function (obj1, obj2) { L0 - logLik(obj1)

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

2008-07-17 Thread Douglas Bates
On Thu, Jul 17, 2008 at 2:50 AM, Rune Haubo [EMAIL PROTECTED] wrote: 2008/7/16 Dimitris Rizopoulos [EMAIL PROTECTED]: well, for computing the p-value you need to use pchisq() and dchisq() (check ?dchisq for more info). For model fits with a logLik method you can directly use the following

[R] Likelihood ratio test between glm and glmer fits

2008-07-16 Thread COREY SPARKS
Dear list, I am fitting a logistic multi-level regression model and need to test the difference between the ordinary logistic regression from a glm() fit and the mixed effects fit from glmer(), basically I want to do a likelihood ratio test between the two fits. The data are like this: My

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

2008-07-16 Thread Dimitris Rizopoulos
well, for computing the p-value you need to use pchisq() and dchisq() (check ?dchisq for more info). For model fits with a logLik method you can directly use the following simple function: lrt - function (obj1, obj2) { L0 - logLik(obj1) L1 - logLik(obj2) L01 - as.vector(- 2 * (L0

[R] Likelihood ratio test for competing risks regression

2008-02-03 Thread Brant Inman
R-helpers: I have a question regarding the crr function of the cmprsk package for performing competing risks regression. Specifically, I was wondering if the standard likelihood ratio test for a categorical covariate applies. For example: # Make up a fake

[R] Likelihood ratio test for proportional odds logistic regression

2008-01-05 Thread xinyi lin
Hi, I want to do a global likelihood ratio test for the proportional odds logistic regression model and am unsure how to go about it. I am using the polr() function in library(MASS). 1. Is the p-value from the likelihood ratio test obtained by anova(fit1,fit2), where fit1 is the polr model with

Re: [R] Likelihood ratio test for proportional odds logistic regression

2008-01-05 Thread Prof Brian Ripley
On Sat, 5 Jan 2008, xinyi lin wrote: Hi, I want to do a global likelihood ratio test for the proportional odds logistic regression model and am unsure how to go about it. I am using the polr() function in library(MASS). 1. Is the p-value from the likelihood ratio test obtained by