generate.data
generates an example dataset from a mean model that has a "main" effect component and a treatment-by-covariates interaction effect component (and a random component for noise).
generate.data(n = 200, p = 10, family = "gaussian",
correlationX = 0, sigmaX = 1, sigma = 0.4, s = 2, delta = 1,
pi.1 = 0.5, true.beta = NULL, true.eta = NULL)
sample size.
dimension of covariates.
specifies the distribution of the outcome y; "gaussian", "binomial", "poisson"; the defult is "gaussian"
correlation among the covariates.
standard deviation of the covariates.
standard deviation of the random noise term (for gaussian response).
controls the nonliarity of the treatment-specific link functions that define the interaction effect component.
s=1
linear
s=2
nonlinear
controls the intensity of the main effect; can take any intermediate value, e.g., delta= 1.4
.
delta=1
moderate main effect
delta=2
big main effect
probability of being assigned to the treatment 1
a p-by-1 vector of the true single-index coefficients (associated with the interaction effect component); if NULL
, true.beta
is set to be (1, 0.5, 0.25, 0.125, 0,...0)
' (only the first 4 elements are nonzero).
a p-by-1 vector of the true main effect coefficients; if NULL
, true.eta
is set to be (0,..., 0.125, 0.25, 0.25, 1)
' (only the last 4 elements are nonzero).
a n-by-1 vector of treatment outcomes.
a n-by-1 vector of treatment indicators.
a n-by-p matrix of pretreatment covariates.
the "signal" (interaction effect) to "nuisance" (main effect) variance ratio (SNR) in the canonical parameter function.
the true single-index coefficient vector.
the true main effect coefficient vector.
a n-by-1 vector of treatments, indicating the optimal treatment selections.
the "value" implied by the optimal treatment decision rule, optTr
.