plot.mp: Interaction Plot for an "mp" Class Object.

Description Usage Arguments Details Value Examples

View source: R/plot.R

Description

This function plots interaction between received treatment and recommended treatment, which provides an estimate of treatment effect of the identified subgroup.

Usage

1
2
## S3 method for class 'mp'
plot(x, penalty_index, ...)

Arguments

x

A fitted "mp" class object returned by mpersonalzied function

penalty_index

The index of penalty parameter configuration in mp$penalty_parameter_sequence. When mp$penalty = "none", penalty_index is automatically set to be 1.

...

not used

Details

In the interaction plot, each point is the group mean given a received treatment and a recommended treatment. Although usually overestimating treatment effect in training set, interaction plots provides a sanity check for treatment recommendation rules. Given a specific index of penalty parameter, the function plots corresponding interaction plots.

Value

A list object with each element as the interaction plots for a penalty parameter configuration.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
set.seed(123)
sim_dat  = simulated_dataset(n = 200, problem = "meta-analysis")
Xlist = sim_dat$Xlist; Ylist = sim_dat$Ylist; Trtlist = sim_dat$Trtlist

# fit different rules with SGL penalty for this meta-analysis problem
mp_mod_diff = mpersonalized(problem = "meta-analysis",
                            Xlist = Xlist, Ylist = Ylist, Trtlist = Trtlist,
                            penalty = "lasso", single_rule = FALSE)

# interaction plot of the 5th penalty parameter
plots = plot(x = mp_mod_diff, penalty_index = 5)
set.seed(NULL)

chenshengkuang/MetaPersonalized documentation built on May 28, 2019, 7:16 p.m.