g.dicho: The estimator for the g-formula that utilizes data only...

View source: R/g.dicho.R

g.dichoR Documentation

The estimator for the g-formula that utilizes data only complete cases

Usage

g.dicho(mmodels, exposure, data, ...)

Arguments

mmodels

The models correspond to the models the outcome.

exposure

The time-varying exposure.

data

Data.

Value

coef

The coefficients in marginal strucktural model.

ExpectEstimate

The expected value of the potential outcome.

mmodels

The mmodels that have been used for modeling data.

exposure

The exposure of the analysis.

N

The sample size of data.

NCC

The sample size of complete cases of data. In case of no missing values NCC is equal to N

...

Author(s)

Thomas Maltesen thomas.maltesen@protonmail.com

References

put references to the literature/web site here

Examples

## Not run: 
model1 <- Y ~ L0 + A0 + L1 + A1 + L2 + A2 + L2*A2
model2 <- L2 ~ A1 + L1 + A0 + L0
model3 <- L1 ~ A0 + L0 + A0*L0


estimationSG<-lapply(1:loop,function(iiii) g.dicho(mmodels=c(model1,model2,model3),
                                                   exposure=c("A0","A1","A2"),
                                                   data=DataSetFull[[iiii]])$coef)
round(listMean(estimationSG),3)
     (Intercept)    A0    A1    A2 A0*A1  A0*A2  A1*A2 A0*A1*A2
Est.      -0.007 6.009 3.996 5.002     0 -2.004 -1.005        0


estimationSG.NA<-lapply(1:loop,function(iiii) g.dicho(mmodels=c(model1,model2,model3),
                                                      exposure=c("A0","A1","A2"),
                                                      data=DataSetMonotone[[iiii]])$coef)
round(listMean(estimationSG.NA),3)
     (Intercept)    A0    A1    A2 A0*A1  A0*A2  A1*A2 A0*A1*A2
Est.      -0.249 6.443 3.555 5.743     0 -2.551 -0.782        0

## End(Not run)

mcl868/causalinmisdata documentation built on March 5, 2024, 8:22 a.m.