Learn R Programming

bayesGAM (version 0.0.2)

fitted: Extract fitted values from a model fit by bayesGAM

Description

Method for bayesGAMfit objects. Extracts the fitted values based on a specified quantile for the posterior distribution. The median is the default.

Usage

# S4 method for bayesGAMfit
fitted(object, ...)

Arguments

object

an object of class bayesGAMfit, usually a result of a call to bayesGAM.

...

additional arguments to pass to coefficients

Value

Numeric vector of fitted values

Examples

Run this code
# NOT RUN {
require(stats); require(graphics)
f <- bayesGAM(weight ~ np(height), data = women, family = gaussian, 
              iter = 500, chains = 1)
plot(fitted(f), women$weight, type='o', xlab="fitted", ylab="actual")
# }

Run the code above in your browser using DataLab