csim: A Constrained single index model (main function)

Description Usage Arguments Details Value Author(s) See Also Examples

Description

csim is the main function for fitting the constrained single index model (CSIM). csim uses pre-treatment covariates X for modeling a scalar-valued treatment outcome y. The single index variable is defined to be a linear combinations of X. The differential treatment effect is estimated by treatment-specific nonparametrically-defined link functions on the single index variable. For simultaneous variable selection for the treatment effect modifiers, csim estimates a sparse single index coefficient vector via a L1 regularization. The estimated single index variable is useful for comparing differential treatment efficacy; the resulting csim object can be used to estimate an optimal treatment selection rule for a new patient with pretreatment clinical information.

Usage

1
2
3
4
5
6
7
csim(y, Tr, X, ortho.constr = TRUE, sparse = TRUE, type = "AIC",
  seed = 1234, lam.by = 0.03, n.lam = 100, n.max = 10,
  eps = 10^-4, it.max = 70, trace = F, nbasis.t = NULL,
  rho.grid = c(0, 0.25, 0.5), eff.aug = FALSE, X.aug = NULL,
  linear.link = FALSE, coef.ini = NULL, i.fx = NULL,
  mc.ini = FALSE, unit.norm = FALSE, plots = TRUE, boot.CI = FALSE,
  n.boot = 500)

Arguments

y

treatment outcomes, n-by-1 vector

Tr

treatment indicators, n-by-1 vector; each element represents one of the K available treatment options

X

a pretreatment covarate matrix, n-by-p matrix

ortho.constr

the constraint that separates the interaction effects from the main effect (without this, the interaction effect can be confounded by the main effect); the default is TRUE.

sparse

if TRUE, apply L1 regularization when estimating the single index coefficients; the default is TRUE.

type

when sparse=TRUE, can choose bewteen "CV" and "BIC", for the sparsity tuninig parameter selection.

seed

when type="CV", randomization seed for cross validation.

lam.by

a value specifying the grid of the sparsity tuning parameters [1, 1+lam.by, ... 1 + n.lam*lam.by].

n.lam

a value specifying the grid of the sparsity tuning parameters [1, 1+lam.by, ... 1 + n.lam*lam.by].

n.max

a maximum number of nonzero (active) coeffients in CSIM.

eps

a value specifying the converge criterion of algorithm.

it.max

an integer value specifying the maximum number of iterations for each coordinate.

trace

if TRUE, show the trace of the fitting procedure; the default is FALSE.

nbasis.t

a length K+1 vector; each element specifies the number of B-spline basis funtions for approximating the treatment-specific link function; the last element is for the "main effect" link function; the default is nbasis.t=NULL, and will be determined depending on the sample size.

rho.grid

a grid vector of (ridge-type) smoothing parameters for approximating the link functions.

eff.aug

if TRUE, perform efficiency augmentation (using a L1 regularized linear regression for the main effects of X); the default is FALSE.

X.aug

a design matrix to be used for efficinecy augmentation; the default is NULL.

linear.link

if TRUE, restrict the link functions to be linear functions; the default is FALSE.

coef.ini

an initial solution for alpha.coef; the default is NULL.

i.fx

an index to be fixed throughout estimation for model identifiability; the default is NULL.

mc.ini

if TRUE, use an estimate obtained from the modified covariate method as an initial solution; this is only applicable for K=2 case; the default is FALSE.

unit.norm

if TRUE, set the estimated coefficient vector to have a unit norm for model identifiability; the default is to set the component with the largest magnitude to be 1.

plots

if TRUE, produce a plot of the estimated link functions and the coefficient estimate.

boot.CI

if TRUE, return a boot object that can be used to construct bootstrap confidence intervals for the single index coefficients; the default is FALSE.

n.boot

when boot.CI=TRUE, a value specifying the number of bootstrap replications.

Details

The sequence of the model coefficients implied by the tuning paramters lam is fit by block coordinate descent algorithm.

Value

a list of information of the final fitted model including

coef.obj

an object containing information about the estimated coefficients.

link.fn.obj

an object containing information about the estimated link functions.

alpha.coef

the estimated single index coefficients.

eta.coef

the estimated main effect coefficients if eff.aug=TRUE.

beta.t.coef

the list of the estimated treatment-specific B-spline coefficient vectors.

beta.0.coef

the estimated B-spline coefficient vector for the main effect of the single index variable.

smoother

an object containing information about the estimated link functions, including the knot sequences used in the B-spline approximation knots.t.

link.fn.plot

a plot object for the link functions.

coef.plot

a plot object for the single index coefficients.

boot.results

a boot object that can be used to construct bootstrap confidence intervals for the single index coefficients.

Author(s)

Park, Petkova, Tarpey, Ogden

See Also

pred.csim, fit.csim, fit.csim.cv

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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
## generate a training set
dat.train <- dataGenerationFn(n=500, p=500, w=3, delta = 1);
y.train <- dat.train$y;
Tr.train <- dat.train$Tr;
X.train <- dat.train$X

## generate a  testing set, under the same setting as in the trainint set.
dat.test <- dataGenerationFn(n=10000, p= dat.train$p, w= dat.train$w, delta = dat.train$delta,
                             true.alpha = dat.train$true.alpha, true.eta = dat.train$true.eta);
y.test <- dat.test$y;
Tr.test <- dat.test$Tr;
X.test <- dat.test$X;

# the "signal" to "noise"  ratio (SNR)
dat.test$SNR
# the optimal treatment selection rule
optTr <- dat.test$optTr
value.opt <- dat.test$value.opt
# the true single index coefficients
true.alpha <- dat.test$true.alpha


# 1. fit a constrained single index model, based on the training set
csim.obj   <- csim(y.train, Tr.train, X.train, type = "AIC", rho.grid =0, eff.aug = FALSE)
csim.obj$alpha.coef
# compare the estimate to the true single index coefficients
true.alpha

## can also perform a 5 fold cross validation
#csim.obj2  <- csim(y.train, Tr.train, X.train, type = "CV", rho.grid =0, eff.aug = FALSE)
#csim.obj2$alpha.coef
## can also obtain an un-regularized estimator.
#csim.obj3   <- csim(y.train, Tr.train, X.train, sparse = FALSE, rho.grid =0, eff.aug = FALSE)
#csim.obj3$alpha.coef

## performance assessment:
# y.test, Tr.test, X.test are testing data
pred.test <- pred.csim(csim.obj, X.test)$pred.new
performance.obj <- performance_measure(pred.test, y.test, Tr.test, value.opt, optTr)

# proprortion of correct decisions
performance.obj$pcd;
# the ratio of the Value of ITR (i.e., Value/ Value.opt)
performance.obj$value.s;
# proportion of correctly (C.) selected treatment effect modifiers:
sum(csim.obj$alpha.coef[true.alpha!=0] != 0) /sum(true.alpha!=0);
# proportion of covariates incorrectly (I.C.) selected as treatment effect modifiers:
sum(csim.obj$alpha.coef[!(true.alpha!=0)] != 0)/ sum(true.alpha==0);


# 2. fit a modified covariate model (with efficiency augmentation)
mc.obj <- mc(y.train, Tr.train, X.train, eff.aug  = TRUE, use.lasso=TRUE)
mc.obj$alpha.coef

pred.test <- pred.mc(mc.obj, X.test)$pred.new
performance.obj <- performance_measure(pred.test, y.test, Tr.test, value.opt, optTr)
performance.obj$pcd
performance.obj$value.s

# proportion of correctly (C.) selected treatment effect modifiers:
sum(mc.obj$alpha.coef[true.alpha!=0]!= 0) /sum(true.alpha!=0);
# proportion of covariates incorrectly (I.C.) selected as treatment effect modifiers:
sum(mc.obj$alpha.coef[!(true.alpha!=0)]!= 0)/ sum(true.alpha==0);

## 3. fit a system of K separate sparse addtive models, one for each treatment group
#K.SAM.obj <- K.SAM(y.train, Tr.train, X.train)
#pred.test <- pred.K.SAM(K.SAM.obj, X.test)$pred.new
#performance.obj <- performance_measure(pred.test, y.test, Tr.test, value.opt, optTr)
#performance.obj$pcd
#performance.obj$value.s

syhyunpark/csim documentation built on May 31, 2019, 4:56 a.m.