polyfitGC | R Documentation |
Regression analysis (one numerical predictor variable) with simplified output.
Wrapper function for lm
in package stats
.
polyfitGC(form,data=parent.frame(),degree=2,graph=TRUE,check=FALSE)
form |
formula of form y~x, both variables numeric |
data |
dataframe supplying y and x above. If one or more of the variables is not in data, then they will be searched for in the parent environment. |
degree |
desired degree of polynomial (for degree 1 use lmgC) |
graph |
Produce scatterplot with fitted polynomial. |
check |
Asks to produce a lowess or gam curve with approximate 95 fitted line wanders outside the band, then perhaps a linear fit is not appropriate. |
A list of class "polyGC". Elements that may be queried include "s" (residual standard error) and "R^2" (unadjusted).
Homer White hwhite0@georgetowncollege.edu
#To study the relationship between two numerical variables:
polyfitGC(mpg~wt,data=mtcars,degree=2,graph=TRUE)
#check the second-fdegree fit:
polyfitGC(mpg~wt,data=mtcars,degree=2,check=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.