Description Usage Arguments Value Examples
Takes a data frame, name of predictor variable, and polynomial order. Creates polynomial-transformed predictor variables, adds them to the data frame and returns the result. Original data frame is unchanged, remember to assign the result.
1 2 |
df |
data frame, should not contain any variables called "predictor" |
predictor |
string name of predictor variable |
poly.order |
integer order of polynomial to be created |
orthogonal |
logical value indicating whether polynomial should be orthogonal (default) or natural (aka raw) |
draw.poly |
logical value indicating whether to create a graph showing tranformed polynomial predictor values, defaults to TRUE |
Returns a data frame containing the original data and at least two new columns: "predictor".Index, and a column for each order of the polynomial-transformed predictor
1 2 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.