Internal: Calculation of an impact fraction using the direct approach
if_direct(
data,
ind,
model,
model_type,
new_data,
prev,
t_vector,
response,
weight_vec
)
A numeric estimated impact fraction.
A dataframe containing variables used for fitting the model
An indicator of which rows will be used from the dataset
Either a clogit, glm or coxph fitted model object. Non-linear effects should be specified via ns(x, df=y), where ns is the natural spline function from the splines library.
Either a "clogit", "glm" or "coxph" model object
A dataframe (of the same variables and size as data) representing an alternative distribution of risk factors
Population prevalence of disease (default NULL)
A vector of times at which PAF estimates are desired (for a coxph model)
A string representing the name of the outcome variable in data
An optional vector of inverse sampling weights