% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/environment_mix_lib_package.R
\name{simul_x_block}
\alias{simul_x_block}
\title{Simulate covariate matrix with block structure}
\usage{
simul_x_block(n, p, block_idx, sigma2_x = 1, within_rho = 0.6, btw_rho = 0.2)
}
\arguments{
\item{n}{a positive integer to indicate sample size}

\item{p}{a positive integer to specify the number of covariates}

\item{block_idx}{a vector of positive integers to indicate the block IDs.
The length of the vector is p.}

\item{sigma2_x}{a positive numeric scalar for variance of the covariates}

\item{within_rho}{a numeric scalar between 0 and 1 for the within block correlation}

\item{btw_rho}{a numeric scalar between 0 and 1 for the between block correlation}
}
\value{
a list object of the following
\describe{
\item{x}{covariate matrix of dimension n by p}
\item{n}{sample size}
\item{p}{number of covariates}
\item{sigma2_x}{variance}
\item{within_rho}{within block correlation}
\item{btw_rho}{between block correaltion}
\item{block_idx}{block indices}
}
}
\description{
Simulate covariate matrix with block structure
}
\examples{
dat <- simul_x_block(n = 1000, p = 10, block_idx = rep(1:4,length=10))
}
\author{
Wei Hao <weihao@umich.edu>
}
