add_sim_fitted: Add a column with the predicted data from a model

Description Usage Arguments Value Examples

View source: R/add_sim_fiited.R

Description

Add a column with the predicted data from a model

Usage

1
add_sim_fitted(df, sim_obj, colname, scenario = NULL)

Arguments

df

A data frame

sim_obj

A 'sim' object derived from that frame

colname

A reference to the name of the new column - defaults to 'fitted'

scenario

A scenario for prediction. If NULL fits are based on original data

Value

The data frame with an extra column for the fitted value

Examples

1
2
3
require(tidyverse)
eastmid_ttw %>% poisson_reg(From,To,Dist,Count) -> mdl
eastmid_ttw %>% add_sim_fitted(mdl)

chrisbrunsdon/simR documentation built on May 5, 2019, 2:41 a.m.