genIndepTable: Generate Independent Two-way Table

Description Usage Arguments Details Value Author(s)

Description

A function to generate a two-way table with independent margins

Usage

1
2
3
4
genIndepTable(n = sample(100:500, size = 1), prow = 1:3, pcol = 1:4, 
dmnames = list(X = paste("x", 1:length(prow), sep = ""), 
Y = paste("y", 1:length(pcol), sep = "")), addmargins = TRUE, 
as.df = FALSE, untable = TRUE)

Arguments

n

sum total of observations generated

prow

nonnegative weights for the row marginal distribution

pcol

nonnegative weights for the col marginal distribution

dmnames

names for the table dimensions

addmargins

should margins be added to the table

as.df

should the result be returned as a data frame

untable

if true then data frame will be expanded to one observation per row

Details

This function will generate a two-way table with independent marginal distributions.

Value

Either an object of class table or a data frame.

Author(s)

G. Jay Kerns


prob documentation built on May 2, 2019, 6:11 p.m.