IQ2: IQ-learning: Recommend stage 2 treatment

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

Description

Recommends the estimated optimal second-stage treatment for a given stage 2 history, h2.

Usage

1
IQ2(object, h2)

Arguments

object

object of type learnIQ2

h2

vector of observed second-stage main effects corresponding to the variables in H2 used in learnIQ2()

Details

Use the estimated optimal second-stage decision rule from learnIQ2() to recommend the best stage 2 treatment for a patient presenting with history h2. It is essential that h2 include the same variables and ordering as H2. If a formula was used to fit learnIQ2(), we recommend checking summary(<learnIQ2 object>) for the correct order of h2.

Value

q2Pos

estimated value of the second-stage Q-function when H2=h2 and A2=1

q2Neg

estimated value of the second-stage Q-function when H2=h2 and A2=-1

q2opt

estimated optimal second-stage treatment for a patient presenting with h2

Author(s)

Kristin A. Linn <kalinn@ncsu.edu>, Eric B. Laber, Leonard A. Stefanski

References

Linn, K. A., Laber, E. B., Stefanski, L. A. (2015) "iqLearn: Interactive Q-Learning in R", Journal of Statistical Software, 64(1), 1–25.

Laber, E. B., Linn, K. A., and Stefanski, L. A. (2014) "Interactive model building for Q-learning", Biometrika, 101(4), 831-847.

See Also

learnIQ2, summary.learnIQ2, plot.learnIQ2

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
## load in two-stage BMI data
data (bmiData)
bmiData$A1[which (bmiData$A1=="MR")] = 1
bmiData$A1[which (bmiData$A1=="CD")] = -1
bmiData$A2[which (bmiData$A2=="MR")] = 1
bmiData$A2[which (bmiData$A2=="CD")] = -1
bmiData$A1 = as.numeric (bmiData$A1)
bmiData$A2 = as.numeric (bmiData$A2)
s1vars = bmiData[,1:4]
s2vars = bmiData[,c (1, 3, 5)]
a1 = bmiData[,7]
a2 = bmiData[,8]
## define response y to be the negative 12 month change in BMI from
## baseline 
y = -(bmiData[,6] - bmiData[,4])/bmiData[,4]
fitIQ2 = learnIQ2 (y ~ gender + parent_BMI + month4_BMI +
  A2*(parent_BMI + month4_BMI), data=bmiData, "A2", c("parent_BMI",
  "month4_BMI"))                                     
summary (fitIQ2)
## new patient
h2 = c (1, 30, 45)
optIQ2 = IQ2 (fitIQ2, h2)
optIQ2$q2opt

iqLearn documentation built on May 2, 2019, 6:44 a.m.