[R] regression in R
1) Packages to be used- For smaller datasets use these 1. CAR Package http://cran.r-project.org/web/packages/car/index.html 2. GVLMA Package http://cran.r-project.org/web/packages/gvlma/index.html 3. ROCR Package http://rocr.bioinf.mpi-sb.mpg.de/ 4. Relaimpo Package 5. DAAG package 6. MASS package 7. Bootstrap package 8. Leaps package Also see http://cran.r-project.org/web/packages/rms/index.html or RMS package rms works with almost any regression model, but it was especially written to work with binary or ordinal logistic regression, Cox regression, accelerated failure time models, ordinary linear models, the Buckley-James model, generalized least squares for serially or spatially correlated observations, generalized linear models, and quantile regression. For bigger datasets also see Biglm http://cran.r-project.org/web/packages/biglm/index.html and RevoScaleR packages. http://www.revolutionanalytics.com/products/enterprise-big-data.php 2) Syntax 1. outp=lm(y~x1+x2+xn,data=dataset) Model Eq 2. summary(outp) Model Summary 3. par(mfrow=c(2,2)) + plot(outp) Model Graphs 4. vif(outp) MultiCollinearity 5. gvlma(outp) Heteroscedasticity using GVLMA package 6. outlierTest (outp) for Outliers 7. predicted(outp) Scoring dataset with scores 8. anova(outp) 9. predict(lm.result,data.frame(conc = newconc), level = 0.9, interval = âconfidenceâ) For a Reference Card -Cheat Sheet see http://cran.r-project.org/doc/contrib/Ricci-refcard-regression.pdf 3) Also read- http://cran.r-project.org/web/views/Econometrics.html from the blog post at- http://www.decisionstats.com/building-a-regression-model-in-r-use-rstats/ additional hint- please use google to search (packages for regression in R) before sending multiple emails on the r help list best regards ajay [[alternative HTML version deleted]] __ 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.
Re: [R] Regression using R
On 16.04.2010 08:24, Dieter Menne wrote: Samuel Bravo wrote: I'm working on a very large project in which we do many calculations which include many types of regression such as, Liner, Quadratic, Cubic, Exponential, Sinusoidal, and Logarithmic. Students are often looking at the wrong place. It's not intuitive that quadratic, cubic can be found under lm, because these are often termed non-linear in basic university courses. Dieter, unfortunately, you are so right. And that's wrong with those basic university courses: We need to teach people that trying to make appropriate transformations to make things linear is the way to go. Best, Uwe Dieter __ 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.
Re: [R] Regression using R
Samuel Bravo wrote: I'm working on a very large project in which we do many calculations which include many types of regression such as, Liner, Quadratic, Cubic, Exponential, Sinusoidal, and Logarithmic. Students are often looking at the wrong place. It's not intuitive that quadratic, cubic can be found under lm, because these are often termed non-linear in basic university courses. Dieter -- View this message in context: http://n4.nabble.com/Regression-using-R-tp1934475p1951658.html Sent from the R help mailing list archive at Nabble.com. __ 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.
[R] Regression using R
Hello, I'm working on a very large project in which we do many calculations which include many types of regression such as, Liner, Quadratic, Cubic, Exponential, Sinusoidal, and Logarithmic. Im well aware that its easy enough to do Linear regression in R but what about the other types? I've been searching on google for such functions but to no avail. Thank you, -- Samuel Bravo Department of Computer Science The University of Texas at El Paso El Paso, TX 79968 [[alternative HTML version deleted]] __ 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.
Re: [R] Regression using R
I think this requires you to just pick up a manual / introductory book on R/regression in R, of which there are many on the internet / in the bookstores, respectively. Every manual I have seen has at least examples for quadratics. And extensions to other functional forms are straightforward. Daniel - cuncta stricte discussurus - -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Samuel Bravo Sent: Thursday, April 15, 2010 7:47 PM To: r-help@r-project.org Subject: [R] Regression using R Hello, I'm working on a very large project in which we do many calculations which include many types of regression such as, Liner, Quadratic, Cubic, Exponential, Sinusoidal, and Logarithmic. Im well aware that its easy enough to do Linear regression in R but what about the other types? I've been searching on google for such functions but to no avail. Thank you, -- Samuel Bravo Department of Computer Science The University of Texas at El Paso El Paso, TX 79968 [[alternative HTML version deleted]] __ 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. __ 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.