The R Project SVN R

Rev

Rev 69612 | Rev 88529 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 69612 Rev 72924
Line 1... Line 1...
1
% File src/library/splines/man/bs.Rd
1
% File src/library/splines/man/bs.Rd
2
% Part of the R package, https://www.R-project.org
2
% Part of the R package, https://www.R-project.org
3
% Copyright 1995-2015 R Core Team
3
% Copyright 1995-2017 R Core Team
4
% Distributed under GPL 2 or later
4
% Distributed under GPL 2 or later
5
 
5
 
6
\name{bs}
6
\name{bs}
7
\alias{bs}
7
\alias{bs}
8
\title{B-Spline Basis for Polynomial Splines}
8
\title{B-Spline Basis for Polynomial Splines}
Line 17... Line 17...
17
  \item{x}{the predictor variable.  Missing values are allowed.}
17
  \item{x}{the predictor variable.  Missing values are allowed.}
18
  \item{df}{degrees of freedom; one can specify \code{df} rather than
18
  \item{df}{degrees of freedom; one can specify \code{df} rather than
19
    \code{knots}; \code{bs()} then chooses \code{df-degree} (minus one
19
    \code{knots}; \code{bs()} then chooses \code{df-degree} (minus one
20
    if there is an intercept) knots at suitable quantiles of \code{x}
20
    if there is an intercept) knots at suitable quantiles of \code{x}
21
    (which will ignore missing values).  The default, \code{NULL},
21
    (which will ignore missing values).  The default, \code{NULL},
-
 
22
    takes the number of inner knots as \code{length(knots)}.  If that is
22
    corresponds to \emph{no} inner knots, i.e., \code{degree - intercept}.}
23
    zero as per default, that corresponds to \code{df = degree - intercept}.}
23
  \item{knots}{the \emph{internal} breakpoints that define the
24
  \item{knots}{the \emph{internal} breakpoints that define the
24
    spline.  The default is \code{NULL}, which results in a basis for
25
    spline.  The default is \code{NULL}, which results in a basis for
25
    ordinary polynomial regression.  Typical values are the mean or
26
    ordinary polynomial regression.  Typical values are the mean or
26
    median for one knot, quantiles for more knots.  See also
27
    median for one knot, quantiles for more knots.  See also
27
    \code{Boundary.knots}.}
28
    \code{Boundary.knots}.}
Line 34... Line 35...
34
    \code{knots} and \code{Boundary.knots} are supplied, the basis
35
    \code{knots} and \code{Boundary.knots} are supplied, the basis
35
    parameters do not depend on \code{x}.  Data can extend beyond
36
    parameters do not depend on \code{x}.  Data can extend beyond
36
    \code{Boundary.knots}.}
37
    \code{Boundary.knots}.}
37
}
38
}
38
\details{
39
\details{
39
  \code{bs} is based on the function \code{\link{spline.des}}.
40
  \code{bs} is based on the function \code{\link{splineDesign}}.
40
  It generates a basis matrix for
41
  It generates a basis matrix for
41
  representing the family of piecewise polynomials with the specified
42
  representing the family of piecewise polynomials with the specified
42
  interior knots and degree, evaluated at the values of \code{x}.  A
43
  interior knots and degree, evaluated at the values of \code{x}.  A
43
  primary use is in modeling formulas to directly specify a piecewise
44
  primary use is in modeling formulas to directly specify a piecewise
44
  polynomial term in a model.
45
  polynomial term in a model.