Internal: Simulate from the post intervention distribution corresponding to eliminating a risk factor
sim_outnode(data, col_num, current_mat, parent_list, col_list, model_list)
An updated data frame (a new version of current_mat) with new columns simulated for variables that the risk factor causally effects.
Data frame. A dataframe containing the original variables used for fitting the models. Must contain all variables used in fitting
The indicator for the risk factor that is being eliminated
The current value of the data frame
A list. The ith element is the vector of variable names that are direct causes of ith variable in node_vec (Note that the variable names should be columns in data)
Column indicators for the variables in node_vec (note that node_vec is ordered from root to leaves)
List. A list of fitted models corresponding for the outcome variables in node_vec, with parents as described in parent_vec. This list must be in the same order as node_vec and parent_list. Models can be linear (lm), logistic (glm) or ordinal logistic (polr). Non-linear effects of variables (if necessary) should be specified via ns(x, df=y), where ns is the natural spline function from the splines library