smooth_dt: Return smooth predictions, using generalized additive model

View source: R/plotting_functions.R

smooth_dtR Documentation

Return smooth predictions, using generalized additive model

Description

Function returns the predictions from a simple generalized additive model that uses natural cubic splines to regress y on splines of x, with k knots, given the family

Usage

smooth_dt(x, y, k, family = c("poisson", "gaussian"))

Arguments

x

vector of x values

y

vector of y values

k

integer number of knots

family

string indicating family, must be either "poisson" (default) or "gaussian"

Value

vector of smoothed predictions

Examples

smooth_dt(x,y,10,"poisson")

lmullany/rawcoviddata documentation built on March 21, 2023, 10:04 a.m.