Description Usage Arguments Value Author(s) Examples
Evaluate the goodness of fit for predicted ITR or A-ITR.
1 2 | ## S3 method for class "ITR"
evalITR(rule, a, y, p = 1/d[2])
|
rule |
object of class inheriting from |
a |
an optional 0-1 matrix with the same dimemsion of the first argument or a vector indicating the actual treaments the patients received. |
y |
a numeric vector indicating the outcome after taking the treatment. |
p |
a numeric vector with each element between 0 to 1, indicating the probability of the treatment been assigned to the patient. |
evalFit
returns a numeric value indicating the expected outcome under the fitted rule.
Haomiao Meng
1 2 3 4 5 6 7 8 9 10 | data(sim1)
train = sim1[1:1000, ]
test = sim1[3001:5000, ]
res = itrFit(train[, 1:2], train[, 3], train[, 4], kernel = "polynomial", d = 4, lambda = 5^(4:11))
rule = predict(res, test[, 1:2], option = "normal")
evalITR(rule, test[, 3], test[, 4]) #evaluate prediction for ITR
rule = predict(res, test[, 1:2])
evalITR(rule, test[, 3], test[, 4]) #evaluate prediction for A-ITR
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.