rpsftm.refit.Rd
This function refits an rpsftm object with a specific weight applied to control arm efficacy. It is a short cut to recalling rpsftm with same parameters and varying the treat_modifier parameter.
rpsftm.refit(x, k)
rpsftm object (rpsftm)
weight to be applied in the control arm for treatment effect. Single number.
See also documentation for rpsftm call treat_modifier= value.
# use data included in rpsftm package
library(rpsftm)
immdef <- rpsftm::immdef
immdef$rx <- with(immdef, 1 - xoyrs/progyrs)
# fit the model
imm.fit <- rpsftm(Surv(progyrs, prog) ~ rand(imm, rx),
data=immdef,
censor_time=censyrs)
rpsftm.refit(imm.fit, k = 0.7)
#> arm rx.Min. rx.1st Qu. rx.Median rx.Mean rx.3rd Qu. rx.Max.
#> 1 0 0.0000000 0.0000000 0.0000000 0.1574062 0.2547779 0.9770941
#> 2 1 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000
#> Call:
#> rpsftm(formula = Surv(progyrs, prog) ~ rand(imm, rx), data = immdef,
#> censor_time = censyrs)
#>
#> N Observed Expected (O-E)^2/E (O-E)^2/V
#> .arm=0 500 152 152 4.59e-06 9.51e-06
#> .arm=1 500 143 143 4.88e-06 9.51e-06
#>
#> Chisq= 0 on 1 degrees of freedom, p= 1
#>
#> psi: -0.1816447
#> exp(psi): 0.8338976
rpsftm.refit(imm.fit, k = 1.3)
#> arm rx.Min. rx.1st Qu. rx.Median rx.Mean rx.3rd Qu. rx.Max.
#> 1 0 0.0000000 0.0000000 0.0000000 0.1574062 0.2547779 0.9770941
#> 2 1 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000
#> Call:
#> rpsftm(formula = Surv(progyrs, prog) ~ rand(imm, rx), data = immdef,
#> censor_time = censyrs)
#>
#> N Observed Expected (O-E)^2/E (O-E)^2/V
#> .arm=0 500 132 132 1.31e-06 2.54e-06
#> .arm=1 500 143 143 1.21e-06 2.54e-06
#>
#> Chisq= 0 on 1 degrees of freedom, p= 1
#>
#> psi: -0.2096808
#> exp(psi): 0.8108431