gencov: Create a set of binary covariates with a specific covariate...

Description Usage Arguments Value

View source: R/misc.R

Description

Create a set of binary covariates with a specific covariate distribution

Usage

1
gencov(z.probs, n.r, code = NULL)

Arguments

z.probs

if a scalar, assume there is one binary covariate z and the scalar is P(z=1). if z.probs is a vector of length k, there are k static covariates, z1, ..., zk, and the the jth element of the vector is P(zj=1). if z.probs is a matrix with k columns and n.r rows, there are k dynamic covariates z1, ...zk. the (i,j)th element is the probability that the jt unit of the ith covariate is equal to 1

n.r

number of covariate values to generate

code

set to NULL if (-1,1) coding is used for the treatments. Set to 0 if (0, 1) is used.

Value

dataframe with covariates


mst1g15/biasedcoin documentation built on Nov. 26, 2019, 4:01 a.m.