SimMNR: Simulate Data for high-dimensional inference

Description Usage Arguments Details Value Author(s) References Examples

View source: R/SimMNR.R

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

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

Arguments

n

Number of observations.

p

Number of variables.

coef

A p+1x1 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'.

Details

We generate p variables from the following precision matrix, which is often been called "band" structure or "AR(2)" structure.

C_{i,j}=≤ft\{\begin{array}{ll} 0.5,&\textrm{if $≤ft| j-i \right|=1, i=2,...,(p-1),$}\\ 0.25,&\textrm{if $≤ft| j-i \right|=2, i=3,...,(p-2),$}\\ 1,&\textrm{if $i=j, i=1,...,p,$}\\ 0,&\textrm{otherwise.} \end{array}\right.

Value

x

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

y

The response vector of dimension nx1. 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.

Author(s)

Bochao Jiajbc409@gmail.com and Faming Liang

References

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

Examples

1
2
3
4
5
6
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")

equSA documentation built on May 6, 2019, 1:06 a.m.