Learn R Programming

CorBin (version 1.0.0)

cBern1dep: Generate binary data with 1-dependent correlated structure

Description

Equivalent to cBern(n, p, rho, type="1-dependent")

Usage

cBern1dep(n, p, rho)

Arguments

n

number of observations

p

the vector of marginal probabilities with dimension m

rho

either a non-negative value indecating the shared correlation coefficient or and m-1 vector indicating the correlation coefficients between adjacent variables.

Value

an n*p matrix of binary data

Examples

Run this code
# NOT RUN {
X <- cBern1dep(5, c(0.4,0.5,0.6), c(0.2,0.3))
# }

Run the code above in your browser using DataLab