Skip to contents

The blipped-down outcome \(Y - \psi \sum_t A_t\) must be conditionally independent of treatment given history, giving $$\psi = \frac{\sum_i (A_i - \bar A_i) Y_i}{\sum_i (A_i - \bar A_i) A_i}$$ Solved in one step – the linear case needs no grid search over psi. Under randomization with the sample mean as the propensity, psi equals the OLS slope of Y on cumulative treatment exactly, which is why ols_slope is returned next to it.

Usage

Snmlin(
  y,
  treatment_history,
  covariate_history = NULL,
  time = NULL,
  propensity = NULL
)

Arguments

y

Outcomes.

treatment_history

Subjects by time.

covariate_history, time

Accepted for signature compatibility.

propensity

\(E[A|H]\) for cumulative treatment; sample mean if omitted (correct only under randomization).

Value

Named list with estimate, psi, se, ci_lower, ci_upper, ols_slope, residual_treatment, n, method.

References

Robins (1994) Commun Stat 23:2379-2412.

Examples

Snmlin(c(2, 1, 4, 2.5), matrix(c(1, 0, 1, 0, 0, 0, 1, 1), nrow = 4))
#> $estimate
#> [1] 1.5
#> 
#> $psi
#> [1] 1.5
#> 
#> $se
#> [1] 0.7071068
#> 
#> $ci_lower
#> [1] 0.1140962
#> 
#> $ci_upper
#> [1] 2.885904
#> 
#> $ols_slope
#> [1] 1.5
#> 
#> $residual_treatment
#> [1]  0 -1  1  0
#> 
#> $times
#> [1] 1 2
#> 
#> $n
#> [1] 4
#> 
#> $method
#> [1] "g-estimation of a linear SNMM (Robins 1994)"
#>