gpaux / Mediana

Clinical Trial Simulations
http://gpaux.github.io/Mediana
26 stars 2 forks source link

No censoring when SampleSize is used in a time-to-event endpoint #1

Closed gpaux closed 9 years ago

gpaux commented 9 years ago

In version 1.0.1 of the package, the only way to get censored observations is to use the Event object. In some cases, the user might want to use the SampleSize object or define sample size within each Samples object, and define a Design object to censure observations.

Example:

# Case study 1
# Clinical trial in patients with metastatic colorectal cancer with censoring

# Sample size parameters
event.count.total = c(390, 420)
randomization.ratio = c(1,2)

# Outcome parameters
median.time.placebo = 6
rate.placebo = log(2)/median.time.placebo
outcome.placebo = parameters(rate = rate.placebo)
median.time.treatment = 9
rate.treatment = log(2)/median.time.treatment
outcome.treatment = parameters(rate = rate.treatment)

# Dropout parameters
dropout.par = parameters(rate = 0.0115)

# Data model
case.study1.data.model = DataModel() +
  OutcomeDist(outcome.dist = "ExpoDist") +
  Event(n.events = event.count.total, rando.ratio = randomization.ratio) +
  Design(enroll.period = 9,
         study.duration = 21,
         enroll.dist = "UniformDist",
         dropout.dist = "ExpoDist",
         dropout.dist.par = dropout.par) +
  Sample(id = "Placebo",
         outcome.par = parameters(outcome.placebo)) +
  Sample(id = "Treatment",
         outcome.par = parameters(outcome.treatment))

In this case, no problem as Event has been used. If Sample size is used such as in the following example, no censoring is made even if Design has been used, and all patients will get the event.

# Case study 1
# Clinical trial in patients with metastatic colorectal cancer with censoring

# Outcome parameters
median.time.placebo = 6
rate.placebo = log(2)/median.time.placebo
outcome.placebo = parameters(rate = rate.placebo)
median.time.treatment = 9
rate.treatment = log(2)/median.time.treatment
outcome.treatment = parameters(rate = rate.treatment)

# Dropout parameters
dropout.par = parameters(rate = 0.0115)

# Data model
case.study1.data.model = DataModel() +
  OutcomeDist(outcome.dist = "ExpoDist") +
  SampleSize(350) +
  Design(enroll.period = 9,
         study.duration = 21,
         enroll.dist = "UniformDist",
         dropout.dist = "ExpoDist",
         dropout.dist.par = dropout.par) +
  Sample(id = "Placebo",
         outcome.par = parameters(outcome.placebo)) +
  Sample(id = "Treatment",
         outcome.par = parameters(outcome.treatment))
gpaux commented 9 years ago

Issue has been resolved in v1.0.2 by enabling the user to determine the type of outcome in the OutcomeDist object. If the user specify "event", the observation could be censored if a Design object is define. The lenght of the outcome.type argument must corresponds to the number of endpoints.

Example:

# Outcome parameters
median.time.placebo = 6
rate.placebo = log(2)/median.time.placebo
outcome.placebo = parameters(rate = rate.placebo)
median.time.treatment = 9
rate.treatment = log(2)/median.time.treatment
outcome.treatment = parameters(rate = rate.treatment)

# Dropout parameters
dropout.par = parameters(rate = 0.0115)

# Data model
case.study1.data.model = DataModel() +
  OutcomeDist(outcome.dist = "ExpoDist", outcome.type = "event") +
  SampleSize(350) +
  Design(enroll.period = 9,
         study.duration = 21,
         enroll.dist = "UniformDist",
         dropout.dist = "ExpoDist",
         dropout.dist.par = dropout.par) +
  Sample(id = "Placebo",
         outcome.par = parameters(outcome.placebo)) +
  Sample(id = "Treatment",
         outcome.par = parameters(outcome.treatment))

# Analysis model
case.study1.analysis.model = AnalysisModel() +
  Test(id = "Placebo vs treatment",
       samples = samples("Placebo", "Treatment"),
       method = "LogrankTest") +
  Statistic(id = "Events Placebo",
            samples = samples("Placebo"),
            method = "EventCountStat") +
  Statistic(id = "Events Treatment",
            samples = samples("Treatment"),
            method = "EventCountStat")  +
  Statistic(id = "Patients Placebo",
            samples = samples("Placebo"),
            method = "PatientCountStat") +
  Statistic(id = "Patients Treatment",
            samples = samples("Treatment"),
            method = "PatientCountStat")

# Evaluation model
case.study1.evaluation.model = EvaluationModel() +
  Criterion(id = "Marginal power",
            method = "MarginalPower",
            tests = tests("Placebo vs treatment"),
            labels = c("Placebo vs treatment"),
            par = parameters(alpha = 0.025))  +
  Criterion(id = "Mean Events Placebo",
            method = "MeanSumm",
            statistics = statistics("Events Placebo"),
            labels = c("Mean Events")) +
  Criterion(id = "Mean Events Treatment ",
            method = "MeanSumm",
            statistics = statistics("Events Treatment"),
            labels = c("Mean Events"))  +
  Criterion(id = "Mean Patients Placebo",
            method = "MeanSumm",
            statistics = statistics("Patients Placebo"),
            labels = c("Mean Patients")) +
  Criterion(id = "Mean Patients Treatment",
            method = "MeanSumm",
            statistics = statistics("Patients Treatment"),
            labels = c("Mean Patients"))

# Simulation Parameters
case.study1.sim.parameters =  SimParameters(n.sims = 1000, 
                                            proc.load = "full", 
                                            seed = 42938001)

# Perform clinical scenario evaluation
case.study1.results = CSE(case.study1.data.model,
                          case.study1.analysis.model,
                          case.study1.evaluation.model,
                          case.study1.sim.parameters)