Description Usage Arguments Details Value Examples

Calculates the value of the treatment decision based on the information from a fitted GEM model.The information
is contained in the `gemObject`

, which is obtained from the `gem_fit`

function. With `gem_test_sample`

the value
of decision based on a GEM model is obtained for a test sample that for each subject has observed outcome under only one treatment
condition (this would be the situation when the test sample is a "real" data set). With `gem_test_simsample`

the value
of decision is calculated when the test sample has the outcome under all treatment conditions for all subjects
(this would be the situation when simulated data is used).

1 2 3 | ```
gem_test_sample(dat, gemObject)
gem_test_simsample(y0, y1, XFrame, gemObject)
``` |

`dat` |
Data frame with first column as the treatment index, second column as outcome, and the remaining columns as covariates design matrix. The treatment index could only have two values ana the outcome should be of continuous type. |

`gemObject` |
A list containing the fitted GEM information, which could be the second element |

`y0` |
Outcome vector for all subjects under the first treatment assignment |

`y1` |
Outcome vector for all subjects under the second treatment assignment |

`XFrame` |
Design matrix of the predictors in the simulated sample with known outcomes under both treatment conditions |

The treatment decision rule estimated by the `gem_fit`

function can be applied to a new (real) data set to estimate its value.
It can also be applied to a simulated data set, where the outcome is known under both conditions, to study its performance of such treatment decision rule.
These two functions correspond to those two situations and compute the population average benefit (or the value of the decision rule based on a GEM model).

`PAB_gem`

Population average benefit of a the treatment regime based on a GEM model

`PAB_unres`

Population average benefit of a treatment regime based on an unrestricted linear model

`opt_gem`

The optimal treatment assignment for each subject

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | ```
#constructing the covariance matrix
co <- matrix(0.2, 10, 10)
diag(co) <- 1
dataEx <- data_generator1(d = 0.3, R2 = 0.5, v2 = 1, n = 300,
co = co, beta1 = rep(1,10),inter = c(0,0))
#fit the GEM
dat <- dataEx[[1]]
model_nu <- gem_fit(dat = dat, method = "nu")
#calculate the population average benefit in the data sample
gem_test_sample(dat,model_nu[[2]])
#calculate the population average benefit when outcome under both treatment conditions
#is known, usually in a simulated sample
bigData <- data_generator3(n = 1000,co = co,bet =dataEx[[2]], inter = c(0,0))
gem_test_simsample(bigData[[1]],bigData[[2]],bigData[[3]],model_nu[[2]])
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.