Learn R Programming

equSA (version 1.2.1)

SimMNR: Simulate Data for high-dimensional inference

Description

Simulate data with graphical structure for generalized regression, which can be used in MNR(x,y,...) for constructing confidence intervals and assessing p-values.

Usage

SimMNR(n, p, coef, family="gaussian")

Arguments

n

Number of observations.

p

Number of variables.

coef

A \(p+1\)x\(1\) vector. The first value denotes the intercept term and other \(p\) values denote the true regression coefficients for \(p\) variables.

family

Quantitative for family='gaussian' (default), binary (0-1) for family='binomial'. Survival data for family='cox'.

Value

x

Simulated data in a nxp design matrix, without an intercept.

y

The response vector of dimension \(n\)x\(1\). Quantitative for family='gaussian', binary (0-1) for family='binomial'. For family='cox', y should be an object of class Surv, as provided by the function Surv() in the package survival.

A

The true adjacency matrix of variables in the design matrix \(x\).

%% ...

Details

We generate \(p\) variables from the following precision matrix, which is often been called "band" structure or "AR(2)" structure. $$ C_{i,j}=\left\{\begin{array}{ll} 0.5,&\textrm{if $\left| j-i \right|=1, i=2,...,(p-1),$}\\ 0.25,&\textrm{if $\left| j-i \right|=2, i=3,...,(p-2),$}\\ 1,&\textrm{if $i=j, i=1,...,p,$}\\ 0,&\textrm{otherwise.} \end{array}\right. $$

References

Liang, F., Xue, J. and Jia, B. (2018). Markov Neighborhood Regression for High-Dimensional Inference. Submitted to J. Amer. Statist. Assoc.

Examples

Run this code
# NOT RUN {
library(equSA)
p <- 200
coef_true <- rep(0,p)
coef_true[1:5] <- runif(5,3,5)
coef <- c(1,coef_true)
data <- SimMNR(n = 100, p = 200, coef = coef, family = "cox")
# }

Run the code above in your browser using DataLab