generate.data {simml}R Documentation

A data generation function

Description

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).

Usage

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)

Arguments

n

sample size.

p

dimension of covariates.

family

specifies the distribution of the outcome y; "gaussian", "binomial", "poisson"; the defult is "gaussian"

correlationX

correlation among the covariates.

sigmaX

standard deviation of the covariates.

sigma

standard deviation of the random noise term (for gaussian response).

s

controls the nonliarity of the treatment-specific link functions that define the interaction effect component.

s=1

linear

s=2

nonlinear

delta

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

pi.1

probability of being assigned to the treatment 1

true.beta

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).

true.eta

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).

Value

y

a n-by-1 vector of treatment outcomes.

A

a n-by-1 vector of treatment indicators.

X

a n-by-p matrix of pretreatment covariates.

SNR

the "signal" (interaction effect) to "nuisance" (main effect) variance ratio (SNR) in the canonical parameter function.

true.beta

the true single-index coefficient vector.

true.eta

the true main effect coefficient vector.

optTr

a n-by-1 vector of treatments, indicating the optimal treatment selections.

value.opt

the "value" implied by the optimal treatment decision rule, optTr.


[Package simml version 0.3.0 Index]