| quadratic | R Documentation |
Computes orthogonal polynomials of degree 2 (Cohn and others, 1992). Used primarily in a linear regression formula.
quadratic(x, center = NULL)
x |
a numeric vector. Missing values are permitted and result in corresponding missing values in the output. |
center |
an optional value to use for the center of |
A matrix of two columns—the centered value of x and its
square.
If center is specified, then the polynomials will not
necessarily be orthogonal. If used in a linear regression formula, then the
coefficient of the linear term is the slope at center.
The function quadratic differs
from poly in that the data are not scaled, so the regression
coefficients are directly interpretable in terms of the units of x.
Cohn, T.A., Caulder, D.L., Gilroy, E.J., Zynjuk, L.D., and Summers, R.M., 1992, The validity of a simple statistical model for estimating fluvial constituent loads—An empirical study involving nutrient loads entering Chesapeake Bay: Water Resources Research, v. 28, no. 5, p. 937–942.
poly
## first and second orthogonal polynomials for the sequence from 1 to 10 quadratic(seq(10))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.