#' simulated data for demonstrating the features of mixedBayes
#'
#' @docType data
#' @keywords datasets
#' @name data
#' @aliases data y e X g k coeff
#' @format The data object consists of seven components: y, e, X, g, k, and coeff.
#' The response y and the covariates e, X, and g are all provided in long format and share a common row ordering.
#' The component coeff contains the true parameter values (main and interaction effects) used to generate y.
#'
#' @details
#'
#' \strong{The data and model setting}
#'
#' Consider a longitudinal study on \eqn{n} subjects with \eqn{k} repeated measurement for each subject. Let \eqn{Y_{ij}} be the measurement for the \eqn{i}th subject at each time point \eqn{j}(\eqn{1\leq i \leq n, 1\leq j \leq k}) .We use the \eqn{m}-dimensional vector \eqn{\boldsymbol{G_{ij}}} to denote measurements of genetic factors for the \eqn{i}th subject at time point \eqn{j}, where \eqn{\boldsymbol{G_{ij}} = (G_{ij1},...,G_{ijm})^\top}. Also, we use \eqn{p}-dimensional vector \eqn{\boldsymbol{E_{ij}}} to denote the environmental/treatment factors, where \eqn{\boldsymbol{E_{ij}} = (E_{ij1},...,E_{ijp})^\top}. \eqn{\boldsymbol{X_{ij}} = (1, \boldsymbol{T^\top_{ij}})^\top}, where \eqn{\boldsymbol{T_{ij}}} is a vector of time effects . \eqn{\boldsymbol{Z_{ij}}} is a \eqn{h \times 1} covariate associated with random effects and \eqn{\boldsymbol{\alpha_{i,\theta}}} is a \eqn{h\times 1} vector of random effects. In a typical one-way repeated measure ANOVA with a fixed number (say four) of factor levels, the environmental (or treatment) factor is modeled as a group of three dummy variables. Therefore, gene-environment (or treatment) interaction leads to variable selections on individual levels (main effects) and group levels (interaction effects) simultaneously. Considering the genetics factors, environmental (or treatment) factors and their interactions that are jointly associated with the longitudinal phenotype, we have the following mixed-effects model at a given quantile level \eqn{\theta}, (\eqn{0 < \theta < 1}):
#' \deqn{Y_{ij} = \boldsymbol{X^\top_{ij}}\boldsymbol{\gamma_{0,\theta}}+\boldsymbol{E^\top_{ij}}\boldsymbol{\gamma_{1,\theta}}+\boldsymbol{G^\top_{ij}}\boldsymbol{\gamma_{2,\theta}}+(\boldsymbol{G_{ij}}\bigotimes \boldsymbol{E_{ij}})^\top\boldsymbol{\gamma_{3,\theta}}+\boldsymbol{Z^\top_{ij}}\boldsymbol{\alpha_{i,\theta}}+\epsilon_{ij,\theta}.}
#' where \eqn{\boldsymbol{\gamma_{1,\theta}}},\eqn{\boldsymbol{\gamma_{2,\theta}}},\eqn{\boldsymbol{\gamma_{3,\theta}}} are \eqn{p},\eqn{m} and \eqn{mp} dimensional vectors that represent the coefficients of the environmental effects, the genetic effects and interaction effects, respectively. In addition, \eqn{\boldsymbol{\gamma_{0,\theta}}} is the coefficient vector for \eqn{\boldsymbol{X_{ij}}}.
#' The gene–environment interactions that can be expressed as a Kronecker product between the two types of main effects as a \eqn{mp}-dimensional vector:
#' \deqn{\boldsymbol{G_{ij}}\bigotimes \boldsymbol{E_{ij}} = [G_{ij1}E_{ij1},G_{ij1}E_{ij2},...,G_{ij1}E_{ijp},G_{ij2}E_{ij1},...,G_{ijm}E_{ijp}]^\top.}
#'
#' The above model also includes \eqn{\boldsymbol{Z_{ij}}} with random effects \eqn{\boldsymbol{\alpha_{i,\theta}}} to account for intra-correlations among repeated measurements.
#' The \eqn{h \times 1} vector \eqn{\boldsymbol{Z_{ij}}} corresponds to the random intercept–slope model and random intercept model under \eqn{h = 2} and 1, respectively. The model error \eqn{\epsilon_{ij,\theta}}’s are independent with the \eqn{\theta}th quantile being zero.
#'
#' Without loss of generality, we suppress the subscript \eqn{\theta} of the regression coefficient vectors for both fixed and random effects from now on for simplicity of notation.
#'
#' In this example, we generate data under random intercept-and-slope model.
#'
#' @examples
#' data(data)
#' length(y)
#' dim(g)
#' dim(e)
#' print(k)
#' print(X)
#' print(coeff)
#'
#' @seealso \code{\link{mixedBayes}}
NULL
