Data Analysis with R statistical Software: A Guidebook for Scientists by and the Guidebook Development Team & Thomas Rob

Data Analysis with R statistical Software: A Guidebook for Scientists by and the Guidebook Development Team & Thomas Rob

Author:and the Guidebook Development Team & Thomas, Rob [and the Guidebook Development Team]
Language: eng
Format: epub
Publisher: Eco-Explore CIC
Published: 2015-08-30T16:00:00+00:00


Polynomial regression (parametric non-linear regression)

To fit a curved line to your data, there are two main options: (i) polynomial regression , which uses the square, cube, etc. of your independent variables, or (ii) generalised additive models (GAMs) . The main difference between these two approaches is that polynomial regression uses standard parametric terms to model the data, whereas GAMs use non-parametric “smoothers” to model the data.

To run a polynomial regression, for example with a linear term (x), a quadratic term (x 2 ) and a cubic term (x 3 )

model1 <- lm (y ~ x + I(x^2) + I(x^3))

Note that the letter “I ” (meaning “as is”) is used to prevent R reading what follows as a formula.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.