simcausal (version 0.2.0)

rcategor.int: Categorical Node Distribution (Integer)

Description

Same as rcategor, but returning a vector of sampled integers 1, 2, ..., ncol(probs)+1 instead of a factor.

Usage

rcategor.int(n, probs)

Arguments

n
Sample size.
probs
Either a vector or a matrix of success probabilities. When probs is a vector, n identically distributed random categorical variables are generated with categories: 1, 2, ..., length(probs)+1. When probs is a matrix,

Value

  • An integer vector of length n with values: 1,2, ...,ncol(probs)+1.