spline_mod {eesim}R Documentation

Fit a generalized linear model

Description

Fits a model to estimate the log relative risk between an exposure and outcome by using a natural cubic spline to control for long-term and seasonal trends and assuming a quasi-Poisson distribution for the outcome. This function provides an example of a function that can be input to eesim or power_calc.

Usage

spline_mod(df, df_year = 7)

Arguments

df

A data frame with columns for daily exposure and outcome called "x" and "outcome", respectively

df_year

A numeric value specifying the degrees of freedom per year to use in the spline to control for long-term and seasonal trends in the outcome.

Value

A numeric vector of length six with summary measures from fitting this model to simulated data.

Examples

exp <- sim_exposure(n = 500, central = 100, sd = 10, trend = "cos1",
                    amp = .6, exposure_type = "continuous")
out <- sim_outcome(exposure = exp, average_outcome = 22, rr = 1.01)
spline_mod(df = out)


[Package eesim version 0.1.0 Index]