dalmatian (version 0.3.0)

fitted.dalmatian: Prediction method for dalmatian Fitted Objects

Description

Prediction method for dalmatian Fitted Objects

Usage

# S3 method for dalmatian
fitted(object, df = object$df, method = "mean",
  ci = TRUE, level = 0.95, ...)

Arguments

object

Object of class dalmatian created by dalmatian().

df

data frame containing predictor values to predict response variables. Defaults to data in object if not supplied. (data.frame)

method

Method to construct the fitted model. Either "mean" or "mode" (character)

ci

returning credible intervals for predictions if TRUE (logical)

level

level of credible intervals for predictions (numeric)

...

Ignored

Value

predictions (list)

Examples

Run this code
# NOT RUN {
## Load pied flycatcher data
data(pied_flycatchers_1)

## Create variables bounding the true load
pfdata$lower=ifelse(pfdata$load==0,log(.001),log(pfdata$load-.049))
pfdata$upper=log(pfdata$load+.05)

## Add 'log(IVI)' variable in pfdata
pfdata$'log(IVI)' <- log(pfdata$IVI)

## Load output from previously run model
load(system.file("Pied_Flycatchers_1","pfresults.RData",package="dalmatian"))

## Compute fitted values 
pred.pfresults <- fitted(object = pfresults, 
                         df = pfdata,
                         method = "mean",
                         ci = TRUE,
                         level = 0.95)
# }

Run the code above in your browser using DataLab