Polynomial Model in R – Study Case: Exercises

June 7, 2018

(This article was first published on R-exercises, and kindly contributed to R-bloggers)

It is pretty rare to find something that represents linearity in the environmental system. The Y/X response may not be a straight line, but humped, asymptotic, sigmoidal or polynomial are possibly, truly non-linear. In this exercise, we will try to take a closer look at how polynomial regression works and practice with a study case. There are three types of common patterns of data exploration, including concave (power and exponential), S-shaped (sigmoidal and logistic), and Peaks and valleys (polynomials.) There are others patterns, but at this time, we will stick to those three. Polynomials are incorporation’s of predictor variables where the variable is represented by multiple instances of itself in successively higher orders.

Here, we use ecological data (Peake and Quinn, 1993) to investigate the abundance effects for invertebrates living in mussel beds in intertidal areas. Possible variable configuration:
Response variable = number of invertebrates (INDIV)
Explanatory variable = the area of each clump (AREA)
Additional possible response variables = Species richness of invertebrates (SPECIES)

Download the data-set here.
Answers to these exercises are available here. If you obtained a different (correct) answer than those listed on the solutions page, please feel free to post your answer as a comment on that page.

Exercise 1
Load the data-set and try to look at its structure, particularly the normality. What’s the best guess based on the scatter-plot?

Exercise 2
Assess its linearity using the car package.

Exercise 3
Add in polynomial terms for the distance variable up to the 3rd order.

Exercise 4
Validate the model for each order of polynomial models.

Exercise 5
Create the predictive model and generate the regression equation. Which one is the best model?

To leave a comment for the author, please follow the link and comment on their blog: R-exercises.

R-bloggers.com offers daily e-mail updates about R news and tutorials on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...

If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Comments are closed.

Search R-bloggers


Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)