Learn R Programming

hgam (version 0.1-2)

methods.hgam: Methods for displaying information about high-dimensional generalized additive models

Description

print.hgam is used to display some information about the fitted GAMs. plot.hgam plot the marginal effects of the two selected covariates. fitted.hgam is used to predict the original data with the fitted GAM model. coef.hgam is used to display the fitted coefficients. predict.hgam is used to predict (new) data with the fitted GAM model. logLik.hgam is used to display the value of the log likelihood function. print.hrisk is used to display the results of the hrisk function.

Usage

"print"(x, ...) "plot"(x, which = NULL, newdata = NULL, rug = TRUE, multidim = FALSE, ...) "fitted"(object, ...) "coef"(object, ...) "predict"(object, newdata = NULL, which = NULL, intercept = NULL, ...) "logLik"(object, ...) "print"(h, ...)

Arguments

x
an object of class hgam
object
an object of class hgam
newdata
a data frame. If newdata = NULL then original data will be used.
which
which covariate to be predicted. Character or integer can both be used. If which = NULL all predictors will be used.
multidim
when multidim = TRUE the marginal effects of the two selected covariates is plotted in a three-dimensional grid.
intercept
boolean or NULL. If intercept = NULL then the function uses the same intercept options as specified in hgam.
h
an object of the class hrisk.
rug
logical, add rugs to plots.
...
ignored.

Examples

Run this code
test.d <- dgp(1000)
test.m <- hgam(y ~ ., data = test.d)

print(test.m)
coef(test.m)
fitted(test.m)
predict(test.m)
logLik(test.m)
plot(test.m, which = c("x1", "x2"), multidim = TRUE)

Run the code above in your browser using DataLab