powered by
Do not call this function on its own
Mreg(regformula, obstimes, startt, stopt, event, mediator, dataset, w = 1)
data.frame with observation times and estimated coefficients for independent variables in "regformula"
independent variable input as for standard lm fuction in R
observed event times at which Aalen's additive model is estimated via the function Areg
start time of the observation intervals
end time of the observation intervals (actual event times)
event indicator
mediator of interest
dataset (in counting process format)
(optional) weights (not actually used in the default implementation of dynamic path analysis, set to 1)
library(dpasurv) data(simdata) obj <- Mreg(~x, sort(simdata$stop[simdata$event==1]), "start", "stop", "event", "M", simdata)
Run the code above in your browser using DataLab