Search This Blog

Sunday, March 10, 2019

Curvilinear regression in R: a parabolic-model example

Simple linear regression (SLR) and multiple linear regression (MLR) analysis is frequently applied when modeling data. If your visual or statistical analysis during model building suggests
a relationship that is non-linear, you may want to try curvilinear modeling (polynomial modeling).
R programming for SLRMLR and curvilinear regression (CLR) analysis is very similar. CLR model building in R is done in four basis steps:
  1. Structure your data in a data frame, for example, via import from a CSV file.
  2. Calculate the desired powers for the independent variable(s) and add them to the data frame. 
  3. Derive the curvilinear model by using the lm() function.
  4. Review the results displayed with the summary() function.
In the case of a parabolic model (quadratic model), only square values need to be calculated and included in the data frame at step 2.

The derived model—if found to satisfactorily fit the data—can then be applied to estimate new values for the dependent variable (response values) by calling the predict() function, which needs to receive a data frame object with new values for the independent variables.

Find the tutorial-style documents and associated CSV files with example data for SLR, MLR and CLR modeling (parabolic modeling) with R in the following.

SLR modeling

Document: www.axeleratio.com/math/comp/linreg/linregways.pdf   
Data: www.axeleratio.com/math/comp/linreg/csv/woodward71.csv
 

MLR modeling

Document: www.axeleratio.com/math/comp/linreg/multilinreg.pdf   
Data: www.axeleratio.com/math/comp/linreg/csv/woodward82.csv

CLR modeling (parabolic modeling example)

Document: www.axeleratio.com/math/comp/linreg/curvilinreg.pdf   
Data:www.axeleratio.com/math/comp/linreg/csv/woodward83.csv



Example of curvilinear model building in R: details are given in my document “How to perform curvilinear regression analysis with R


Keywords: statictical analysis, linear modeling, non-linear modeling, machine learning, testing relationships, model building, R programming.

No comments:

Post a Comment