CalcRMST: Estimation of restricted mean and median survival times...

Description Usage Details Value Author(s) Examples

View source: R/CalcRMST.R

Description

The function implements the proposed methodology in Nevo and Gorfine (2021+, Biostatistics)

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
CalcRMST(
  rho,
  tau,
  n.gamma.vals,
  n.sample.pers,
  population,
  Xnames,
  data,
  res,
  list.out = T,
  detailed = F
)

Details

bla bla bla

Value

Mean and median treatment effects within population strata as well as estimated stratum proportions.

Author(s)

Daniel Nevo

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
## Not run: 
set.seed(314)
times <- seq(1, 15, 1)
alpha.nt <- LongitSemiComp:::logit(dchisq(times,3, ncp =5)/2 + 0.025)
alpha.t <- LongitSemiComp:::logit(times*(0.075/10)  - 0.0005*(times/20)^2  + 0.05)
alpha.or <- 0.15 - times/10 + 0.75*(times/10)^2 + 0.3*(times/20)^3
plot(x = times, y= exp(alpha.or))
plot(x = times, y= LongitSemiComp:::expit(alpha.nt))
plot(x = times, y= LongitSemiComp:::expit(alpha.t))
beta.nt <- log(c(0.7, 3))
beta.t <- log(c(0.5, 1))
beta.or <- log(c(1.4, 1))
beta.y <- log(1.4)
my.data <- SimLongitData(n.sample = 2000, times = times,  beta.y,
                         alpha.nt, alpha.t, alpha.or,
                         beta.nt, beta.t, beta.or)
longit.data <- my.data[-1]
X <- as.data.frame(my.data[1])
LongitSC(longit.data = longit.data, times = times,  formula.NT =  ~ X.1 + X.2,
         formula.T =  ~ X.1 + X.2,
         formula.OR = ~ X.1 + X.2,
         data = X, epsOR = 10^(-10),
         knots = 5, lambda = 1)

## End(Not run)

daniel258/CausalSemiComp documentation built on Dec. 24, 2021, 5:06 p.m.