u: Defining smooths in PLBPSM formulae

Description Usage Arguments Value Examples

Description

Function used in definition of smooth terms within plbpsm model formulae. The function does not evaluate a (spline) smooth - it exists purely to help set up a model using spline based smooths.

Usage

1
2
u(..., N = 2, q = 3, KnotsLocation = "quantile", knots = NULL,
  N_MI = 4, fx = FALSE, id = NULL)

Arguments

...

a list of variables that are the covariates that this smooth is a function of.

N

Number of interior knots in generating spline matrix.

q

Degree of polynomial spline. Default is 3.

KnotsLocation

A character string naming the way for knots locations. Default is "quantile". The only alternative is "uniform".

knots

An optional vector specifying the knots to be used in constructing spline bases.

N_MI

Number of interior knots in generating spline matrix in the model identification process.

fx

indicates whether the term is a fixed d.f. regression spline (TRUE) or a penalized regression spline (FALSE).

id

An identifying label or number for the smooth, linking it to other smooths. Defaults to NULL for no linkage.

Value

These smooth.spec objects define uivariate smooths and are turned into bases and penalties by BasisCon functions. The returned object contains the following items:

term

An array of text strings giving the names of the covariates that the term is a function of.

N

Number of interior knots in generating spline matrix.

q

Degree of polynomial spline. Default is 3.

knotsLocation

A character string naming the way for knots locations. Default is "quantile". The only alternative is "uniform".

knots

An optional vector specifying the knots to be used in constructing spline bases.

N_MI

Number of interior knots in generating spline matrix in the model identification process.

fx

TRUE if the term is to be treated as a pure regression spline (with fixed degrees of freedom); FALSE if it is to be treated as a penalized regression spline

dim

The dimension of the smoother - i.e. the number of covariates that it is a function of.

label

A suitable text label for this smooth term.

id

An identifying label or number for the smooth, linking it to other smooths. Defaults to NULL for no linkage.

Examples

1
2
3
4
5
library(GgAM)
data(eg1pop_dat)
V=eg1pop_dat[['V2']]
Tr=eg1pop_dat[['T2']]
res <- u(x1,x2,N=2,q=3)

funstatpackages/GgAM documentation built on Nov. 4, 2019, 12:59 p.m.