Sample \(n\) observations with the following scheme:
Covariates: \(X_j ~ N(0,1)\).
Assignment: \(Z ~ Bin(n, p)\) with \(p = logit^{-1}(a + X \gamma^L + Q \gamma^N)\) where \(a = \omega - mean(X \gamma^L + Q \gamma^N)\).
Mean response: \(E(Y(0)|X) = X \beta_0^L + Q \beta_0^N \) and \(E(Y(1)|X) = X \beta_1^L + Q \beta_1^N\).
Observation: \(Y ~ N(\mu,\sigma_y^2))\).
Superscript \(L\) denotes the linear components, whilst \(N\) denotes the non-linear components.
simulate_su_hill_data(
n,
treatment_linear = TRUE,
response_parallel = TRUE,
response_aligned = TRUE,
y_sd = 1,
tau = 4,
omega = 0,
add_categorical = FALSE,
n_subjects = 0,
sd_subjects = 1,
coef_categorical_treatment = NULL,
coef_categorical_nontreatment = NULL
)
An object of class suhillsim
that is a list with elements
Simulated data in data.frame
The mean y values for each individual (row)
List of arguments passed to function
Response formulas used to generate data
Coefficients for the formulas
Size of simulated sample.
Treatment assignment mechanism is linear?
Response surface is parallel?
Response surface is aligned?
Observation noise.
Treatment effect for parallel response surfaces. Not applicable if surface is nonparallel.
Offset to control treatment assignment ratios.
Should a categorical variable be added? (Not in Hill and Su)
How many subjects are there? For repeated observations. (Hill and Su = 0, default)
Random effect intercept standard deviation for subjects. (Not in Hill and Su. Used if n_subjects > 0)
What are the coefficients of the categorical variable under treatment? (Not in Hill and Su)
What are the coefficients of the categorical variable under nontreatment? (Not in Hill and Su)
Coefficients used are returned in the list this function creates. See Table 1 in Su and Hill (2013) for the table of coefficients.
The \(X_j\) are in a data.frame named data
in the returned list.
The formula for the model matrix \([X,Q]\) is named su_hill_formula
in the returned list.
The coefficients used for the model matrix are contained in coefs
.
The Su and Hill (2013) simulations did not include categorical variables, but you can add them here using arguments: add_categorical
, coef_categorical_treatment
, coef_categorical_nontreatment
.
Hill, Jennifer; Su, Yu-Sung. Ann. Appl. Stat. 7 (2013), no. 3, 1386--1420. doi:10.1214/13-AOAS630. https://projecteuclid.org/euclid.aoas/1380804800