Skip to contents

Linear transformation model g{S(t | Z)} = h(t) + Z'beta with censored data: stage 1 estimates the censoring survival G by Kaplan-Meier (left limit, validated against the paper's printed Freireich anchor), stage 2 solves estimating equation (2.3) with unit weights. Sandwich variance of Section 2 / Appendix 1.

Usage

Twostg(time, event, X, Z = NULL, error = "ph", max_iter = 50L, tol = 1e-10)

Arguments

time

Observed times.

event

Event indicator (1 = event, 0 = censored).

X

Covariate matrix.

Z

Optional additional covariates, concatenated to X.

error

"ph" (extreme-value, proportional hazards) or "po" (logistic, proportional odds).

max_iter, tol

Newton controls.

Value

List with estimate, se, cov, n_iter, error, method.

References

Cheng, S. C., Wei, L. J. and Ying, Z. (1995), Biometrika 82(4), 835-845.

Examples

Twostg(time = c(1, 2, 3, 4, 5, 6, 7, 8), event = c(0, 1, 0, 1, 1, 0, 1, 0),
  X = c(1, 2, 3, 4, 5, 6, 7, 8))
#> $estimate
#> [1] -0.5469466
#> 
#> $se
#> [1] 0.1938127
#> 
#> $cov
#>            [,1]
#> [1,] 0.03756335
#> 
#> $n_iter
#> [1] 6
#> 
#> $error
#> [1] "ph"
#> 
#> $method
#> [1] "Cheng-Wei-Ying (1995) two-stage transformation-model estimator, eq. (2.3)"
#>