createTPRSmodelmatrix {predkmeans}R Documentation

Create matrix of Thin-Plate Regression Splines (TPRS)

Description

Wrapper function for creating a matrix of thin-plate regression splines (TPRS) to be used in a regression analysis.

Usage

createTPRSmodelmatrix(
  data,
  df = 5,
  covarnames = NULL,
  xname = "x",
  yname = "y",
  TPRSfx = TRUE,
  matrixonly = TRUE
)

Arguments

data

Matrix or data frame of data

df

Degrees of freedom for thinplate splines. This does not include an intercept, so the k argument of s() is k = df + 1.

covarnames

Names of other covariates to be included in the model matrix.

xname

Name of variable the provides the x-coordinate of location.

yname

Name of variable the provides the y-coordinate of location.

TPRSfx

Should the TPRS degrees of freedom be fixed. Passed as the fx argument to s().

matrixonly

Logical indicator of whether only the model matrix should be returned, or the full output from gam.

Author(s)

Joshua Keller

See Also

createPCAmodelmatrix, predkmeansCVest

Examples

n <- 200
x <- runif(n=n, 0, 100)
y <- runif(n=n, 0, 100)
d <- data.frame(x=x, y=y)
mx <- createTPRSmodelmatrix(data=d, df=5)

[Package predkmeans version 0.1.1 Index]