powered by
Wrapper function for creating a matrix of thin-plate regression splines (TPRS) to be used in a regression analysis.
createTPRSmodelmatrix( data, df = 5, covarnames = NULL, xname = "x", yname = "y", TPRSfx = TRUE, matrixonly = TRUE )
Matrix or data frame of data
Degrees of freedom for thinplate splines. This does not include an intercept, so the k argument of s() is \(k = df + 1\).
k
s()
Names of other covariates to be included in the model matrix.
Name of variable the provides the x-coordinate of location.
Name of variable the provides the y-coordinate of location.
Should the TPRS degrees of freedom be fixed. Passed as the fx argument to s().
fx
Logical indicator of whether only the model matrix should be returned, or the full output from gam.
gam
createPCAmodelmatrix, predkmeansCVest
createPCAmodelmatrix
predkmeansCVest
# NOT RUN { 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) # }
Run the code above in your browser using DataLab