A fitted model for a mediator or exposure or risk factor can be simulated given values of the other risk
factors or exposure saved in the data frame current_mat. This allows for potential outcomes to be measured for
causal analysis. For example, for an outcome \(Y_{A,M}\) with exposure A and mediators \(M_{1}, M_{3}, \dots M_{K}\)
the function can measure potential outcomes such as \(Y_{A=0,M_{1},M_{2},M_{3}}\) or \(Y_{A=0,M_{1},M_{2}=0,M_{3}=0}\) when there are three mediators.
The model can be either a binary, continuous or an ordered factor response model.
do_sim_sequentialPAF(colnum, current_mat, model)simulation
Column number of exposure or risk factor of interest within the data frame. The data frame has cases in rows and variables in columns.
The data frame containing the data for which the model can be simulated with. For
potential outcomes for example such as \(Y_{A=0,M_{1},M_{2},M_{3}}\) requires the exposure in this case
to be pre set to zero i.e. current_mat should have the exposure \(Y_{A=0}\) set to zero if simulating
e.g. \(M_{1}\).
A fitted causal regression model for either a binary, continuous or an ordered factor response.
if (FALSE) {
# I don't want you to run this
}
Run the code above in your browser using DataLab