Last data update: 2014.03.03

R: Variable Selection for Optimal Treatment Decision with...
censoredR Documentation

Variable Selection for Optimal Treatment Decision with Censored Survival Times

Description

A penalized regression framework that can simultaneously estimate the optimal treatment strategy and identify important variables when the response is continuous and censored. This method uses an inverse probability weighted least squares estimation with adaptive LASSO penalty for variable selection.

Usage

censored(x, y, a, delta, propen, phi, logY = TRUE, 
         intercept = TRUE)

Arguments

x

Matrix or data.frame of model covariates.

y

Vector of response. Note that this data is used to estimate the Kaplan-Meier Curve and should not be log(T).

a

Vector of treatment received. Treatments must be coded as integers or numerics that can be recast as integers without loss of information.

delta

Event indicator vector. The indicator must be coded as 0/1 where 0=no event and 1=event.

propen

Vector or matrix of propensity scores for each treatment. If a vector, the propensity is assumed to be the same for all samples. Column or element order must correspond to the sort order of the treatment variable, i.e., 0,1,2,3,... If the number of columns/elements in propen is one fewer than the total number of treatment options, it is assumed that the base or lowest valued treatment has not been provided.

phi

A character 'c' or 'l' indicating if the constant ('c') or linear ('l') baseline mean function is to be used.

logY

TRUE/FALSE indicating if log(y) is to be used for regression.

intercept

TRUE/FALSE indicating if an intercept is to be included in phi model.

Value

A list object containing

beta

A vector of the estimated regression coefficients after variable selection.

optTx

The estimated optimal treatment for each sample.

Author(s)

Wenbin Lu, Hao Helen Zhang, Yuan Geng, and Shannon Holloway

References

Geng, Y., Lu, W., and Zhang, H. H. (2015). On optimal treatment regimes selection for mean survival time. Statistics in Medicine, 34, 1169–1184. PMCID: PMC4355217.

Examples

  sigma <- diag(10)
  ct <- 0.5^{1L:9L}
  rst <- unlist(sapply(1L:9L,function(x){ct[1L:{10L-x}]}))
  sigma[lower.tri(sigma)] <- rst
  sigma[upper.tri(sigma)] <- t(sigma)[upper.tri(sigma)]

  M <- t(chol(sigma))
  Z <- matrix(rnorm(1000),10,100)
  X <- t(M%*%Z)

  A <- rbinom(100,1,0.5)

  Y <- rweibull(100,shape=0.5,scale=1)
  C <- rweibull(100,shape=0.5,scale=1.5)

  delta <- as.integer(C <= Y)

  Y[delta > 0.5] <- C[delta>0.5]

  dat <- data.frame(X,A,exp(Y),delta)
  colnames(dat) <- c(paste("X",1:10,sep=""),"a","y","del")
  
  censored(x = X, 
           y = Y, 
           a = A, 
           delta = delta,
           propen = 0.5, 
           phi = "c", 
           logY = TRUE, 
           intercept = TRUE)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(OTRselect)
Loading required package: lars
Loaded lars 1.2

Loading required package: survival

OTRselect was developed in support of IMPACT, a comprehensive research
program that aims to improve the health and longevity of people by
improving the clinical trial process. To learn more about our 
research and available software visit www.impact.unc.edu. 


> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/OTRselect/censored.Rd_%03d_medium.png", width=480, height=480)
> ### Name: censored
> ### Title: Variable Selection for Optimal Treatment Decision with Censored
> ###   Survival Times
> ### Aliases: censored
> 
> ### ** Examples
> 
>   sigma <- diag(10)
>   ct <- 0.5^{1L:9L}
>   rst <- unlist(sapply(1L:9L,function(x){ct[1L:{10L-x}]}))
>   sigma[lower.tri(sigma)] <- rst
>   sigma[upper.tri(sigma)] <- t(sigma)[upper.tri(sigma)]
> 
>   M <- t(chol(sigma))
>   Z <- matrix(rnorm(1000),10,100)
>   X <- t(M%*%Z)
> 
>   A <- rbinom(100,1,0.5)
> 
>   Y <- rweibull(100,shape=0.5,scale=1)
>   C <- rweibull(100,shape=0.5,scale=1.5)
> 
>   delta <- as.integer(C <= Y)
> 
>   Y[delta > 0.5] <- C[delta>0.5]
> 
>   dat <- data.frame(X,A,exp(Y),delta)
>   colnames(dat) <- c(paste("X",1:10,sep=""),"a","y","del")
>   
>   censored(x = X, 
+            y = Y, 
+            a = A, 
+            delta = delta,
+            propen = 0.5, 
+            phi = "c", 
+            logY = TRUE, 
+            intercept = TRUE)
$beta
                  [,1]
(Intercept) -3.9739269
x1           1.6190830
x2           2.7973386
x3          -3.6500924
x4           0.6438501
x5          -0.4516813
x6          -0.5562705
x7          -2.4672523
x8           4.5544519
x9          -2.9795620
x10          0.3788380

$optTx
  [1] 0 1 0 1 1 0 0 0 0 0 1 0 1 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 1 0 1 0 0
 [38] 1 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 1 0 1 1 1 0 0 0 0 0 0 0 0 0 0 1 0 0
 [75] 0 0 0 1 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 1 0

> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>