Learn R Programming

dpasurv (version 0.1.0)

Mreg: Internal mediator regression function storing a linear regression estimate for each event time

Description

Do not call this function on its own

Usage

Mreg(regformula, obstimes, startt, stopt, event, mediator, dataset, w = 1)

Value

data.frame with observation times and estimated coefficients for independent variables in "regformula"

Arguments

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)

Examples

Run this code
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