Hello I am trying to get the estimated value of logit(p), along with its standard error/conf interval from a logistic regression model (for the overall sample, and for individual treatment levels), where p is the proportion of "successes". I am having difficulty in finding how to tell R to give this information. Would anybody be able to help with this? Thanks Martin Pareja
Google search "Logistic Regression using R" There are loads of good links here. Basically you use a generalized linear model. Look up ?glm Regards Wayne -----Original Message----- From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org]On Behalf Of martin pareja Sent: 13 September 2007 16:33 To: r-help at r-project.org Subject: [R] Logistic regression Hello I am trying to get the estimated value of logit(p), along with its standard error/conf interval from a logistic regression model (for the overall sample, and for individual treatment levels), where p is the proportion of "successes". I am having difficulty in finding how to tell R to give this information. Would anybody be able to help with this? Thanks Martin Pareja ______________________________________________ R-help at 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.
You might want to look at the lrm function in the Design package as an alternative to the standard tools. On 9/14/07, Wayne.W.Jones at shell.com <Wayne.W.Jones at shell.com> wrote:> > Google search "Logistic Regression using R" > > There are loads of good links here. Basically you use a generalized linear model. > > Look up ?glm > > Regards > > Wayne > > -----Original Message----- > From: r-help-bounces at r-project.org > [mailto:r-help-bounces at r-project.org]On Behalf Of martin pareja > Sent: 13 September 2007 16:33 > To: r-help at r-project.org > Subject: [R] Logistic regression > > > Hello > I am trying to get the estimated value of logit(p), along with its > standard error/conf interval from a logistic regression model (for the > overall sample, and for individual treatment levels), where p is the > proportion of "successes". I am having difficulty in finding how to > tell R to give this information. > Would anybody be able to help with this? > > Thanks > Martin Pareja > > ______________________________________________ > R-help at 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. > > ______________________________________________ > R-help at 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. >-- ================================David Barron Said Business School University of Oxford Park End Street Oxford OX1 1HP
Dear list, I am interested in comparing two linear regression models to see if including one extra variable improves the model significantly. I have read that one possibility is doing an F test on the goodness-of-fit values for both models, and another option that is comparing the residuals of both models using a paired test. I also know about the anova() function that compares results for two models but am not sure what it actually does compare. Can you give me any suggestions? Does the same hold if the models were logistic instead of linear? I have read that the Akaike?s AIC is also a valid option. Thanks in advance for your comments David
I would suggest doing an F-test.A descrition is given here: http://www.graphpad.com/curvefit/2_models__1_dataset.htm. The method is valid becasue one of your models is a subset of another. Correct use of the anova function does indeed perform this test. For example: data(airquality) lm1<-lm(Ozone~.,airquality) # full model lm2<-lm(Ozone~Solar.R+Wind +Month+Day,airquality) # reduced model anova(lm2,lm1) -----Original Message----- From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org]On Behalf Of darteta001 at ikasle.ehu.es Sent: 14 September 2007 15:49 To: r-help at r-project.org Subject: [R] Comparing regression models Dear list, I am interested in comparing two linear regression models to see if including one extra variable improves the model significantly. I have read that one possibility is doing an F test on the goodness-of-fit values for both models, and another option that is comparing the residuals of both models using a paired test. I also know about the anova() function that compares results for two models but am not sure what it actually does compare. Can you give me any suggestions? Does the same hold if the models were logistic instead of linear? I have read that the Akaike?s AIC is also a valid option. Thanks in advance for your comments David ______________________________________________ R-help at 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.
The classic way to test for better fit with an additional variable is to use the anova() function. The model must have the suspect variable listed last into your model. The anova() function will give you the correct sequential decomposition of your model effects and their conditional (F or t) tests. Check a regression text for the details. (You should have done this already.) I have never heard of comparing residuals using the t-test. It makes no sense because the residuals have mean zero under either model. The AIC is also valid, but my reading between your lines would indicate the anova test would be better. JFL -----Original Message----- From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On Behalf Of darteta001 at ikasle.ehu.es Sent: Friday, September 14, 2007 9:49 AM To: r-help at r-project.org Subject: [R] Comparing regression models Dear list, I am interested in comparing two linear regression models to see if including one extra variable improves the model significantly. I have read that one possibility is doing an F test on the goodness-of-fit values for both models, and another option that is comparing the residuals of both models using a paired test. I also know about the anova() function that compares results for two models but am not sure what it actually does compare. Can you give me any suggestions? Does the same hold if the models were logistic instead of linear? I have read that the Akaike?s AIC is also a valid option. Thanks in advance for your comments David ______________________________________________ R-help at 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.