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