beta_par {earlygating}R Documentation

Parameters of Beta distribution given Historical Data

Description

Function for calculating the parameters of the beta distribution used to average the operating characteristics, given historical data.

Usage

beta_par(
  mu_cov,
  phi_cov = NULL,
  orr,
  data,
  newdata,
  link = NULL,
  weights = NULL,
  plot = T
)

Arguments

mu_cov

A character vector containing the names of covariates in data that should be used to model the parameter \mu in the pdf.

phi_cov

A character vector containing the names of covariates in data that should be used to model the parameter \phi in the pdf. Default is NULL, so \phi will not be modelled with respect to the covariates.

orr

Character containing the name of the variable in data that represents the objective response rate.

data

Data frame containing all the covariates and the ORR.

newdata

Data frame containing a single value for each of the specified covariates that will be used to estimate the parameters of the Beta distribution.

link

Link function for \mu. Corresponds to g. Default is NULL, which means the link function will be automatically chosen as the one yielding the highest log-likelihood for the given data and covariates.

weights

Weights that should be used for regression. Default is NULL, so no weights.

plot

Plots yes or no. Default is TRUE.

Examples


mu_cov <- c("date", "Phase")
orr <- "ORR"
newdata <- data.frame(
  "date" = 2017,
  "Phase" = factor(3)
  )
studs <- data.frame(
  "ORR"= c(0.693, 0.580, 0.693, 0.477, 0.609,
           0.727, 0.727, 0.591, 0.362, 0.593,
           0.792, 0.620, 0.550, 0.690, 0.776),
  "date" = c(2011, 2008.5, 2009, 1996, 2001,
             2003.5, 2002.5, 2008, 2000,
             2006, 2005, 2007.5, 2009.5,
             2010.5, 2010),
   "Phase" = factor(c(3, 2, 3, 3, 2, 2, 3, 3,
                      3, 3, 2, 3, 3, 3, 2)),
   "N" = c(293, 69, 336, 235, 92, 110, 131,
           208, 94, 123, 53, 182, 267, 239, 237)
 )

beta_par(
  mu_cov = mu_cov,
  orr = orr,
  data = studs,
  newdata = newdata,
  weights = studs$N/mean(studs$N)
)


[Package earlygating version 1.1 Index]