get_cumu_eff: Calculate (or plot) cumulative effect for all time-points of...

View source: R/cumulative-effect.R

get_cumu_effR Documentation

Calculate (or plot) cumulative effect for all time-points of the follow-up

Description

Calculate (or plot) cumulative effect for all time-points of the follow-up

Usage

get_cumu_eff(data, model, term, z1, z2 = NULL, se_mult = 2)

gg_cumu_eff(data, model, term, z1, z2 = NULL, se_mult = 2, ci = TRUE)

Arguments

data

Data used to fit the model.

model

A suitable model object which will be used to estimate the partial effect of term.

term

A character string indicating the model term for which partial effects should be plotted.

z1

The exposure profile for which to calculate the cumulative effect. Can be either a single number or a vector of same length as unique observation time points.

z2

If provided, calculated cumulative effect is for the difference between the two exposure profiles (g(z1,t)-g(z2,t)).

se_mult

Multiplicative factor used to calculate confidence intervals (e.g., lower = fit - 2*se).

ci

Logical. Indicates if confidence intervals for the term of interest should be calculated/plotted. Defaults to TRUE.


pammtools documentation built on July 26, 2023, 6:07 p.m.