Skip to contents

A standard marginal structural model answers one question at baseline. The history-adjusted version answers it again at every time point, conditioning on what was known then – the decision at month six is made with six months of information, not none.

Usage

Hmstrn(y, treatment_history, covariate_history, time, regime)

Arguments

y

Outcome.

treatment_history

Treatment received at each time, n by T.

covariate_history

Time-varying covariate, n by T.

time

Time points.

regime

Treatment the rule prescribes at each time.

Value

List with estimate, intercept, by_time, n_consistent, n.

Details

Formula: E[Y(d) | H_t] = g0 + g1 t, fitted with weights prod_s 1/P(A_s|H_s) over units consistent with the regime.

References

van der Laan, M. J. & Petersen, M. L. (2007). IJB 3(1):3; van der Laan, Petersen & Joffe (2005) IJB 1(1):4.

Examples

Hmstrn(y = c(1, 2, 3, 4, 5, 6, 7, 8), treatment_history = c(1, 2, 3, 4, 5, 6, 7, 8),
  covariate_history = c(1, 2, 3, 4, 5, 6, 7, 8), time = c(1, 2, 3, 4, 5, 6, 7, 8),
  regime = c(1, 2, 3, 4, 5, 6, 7, 8))
#> $estimate
#> [1] 0
#> 
#> $intercept
#> [1] 1
#> 
#> $by_time
#> [1] 1
#> 
#> $n_consistent
#> [1] 8
#> 
#> $n
#> [1] 8
#> 
#> $method
#> [1] "History-adjusted marginal structural model"
#> 
#> attr(,"class")
#> [1] "morie_rich_result" "list"