Description Usage Arguments Details Value Examples
The main algorithm in pirate package for calculating the coefficients of the linear combination of the covariates to generate a GEM. This function can be applied to data sets with more than two treatment groups. See more detail in E Petkova, T Tarpey, Z Su, and RT Ogden. Generated effect modifiers (GEMs) in randomized clinical trials. Biostatistics, (First published online: July 27, 2016). doi: 10.1093/biostatistics/kxw035.
1 | gem_fit(dat, method = "F")
|
dat |
Data frame with first column as the treatment index, second column as the outcome, and the remaining columns as the covariates design matrix. The elements of the treatment index take K distinct values, where K is the number of treatment groups. The outcome has to be a continuous variable. |
method |
Choice of the criterion that the generated effect modifier optimizes. This is a string in
|
gemObject
is a list of three elements. The first element is the
calculated weight α for combining the predictors X. The second element contains the K vectors of coefficients (γ_{j0},γ_{j1}) from
y_j = γ_{j0} + (Xα)γ_{j1} + ε, j = 1,...,K,
for the K treatment groups respectively. The third element contains the K vectors of coefficients from the unconstraint linear regression models
y_j = β_{j0} + Xβ_{j1} + ε, j = 1,...,K,
for the K treatment groups respectively.
method
The criterion used to generate the GEM
gemObject
Fitted result for the GEM model, see more in Details
p_value
The p-value for the interaction term in model Y = a + trt + Z + trt*Z + ε, where Z is the GEM
Augmented_Data
The input data argumented with the GEM as the last column
effect.size
The effect size of the GEM if there are only two treatment groups
plot
A scatter plot of Y versus the GEM with fitted lines and grouped by treatment
1 2 3 4 5 6 7 8 9 10 | #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")
model_de <- gem_fit(dat = dat, method = "de")
model_F <- gem_fit(dat = dat, method = "F")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.