draw.binom: Simulate independent draws from two independent Binomial...

Description Usage Arguments Value Examples

View source: R/front.R

Description

This function can be conveniently used in simulations such as a monte carlo sample size calculations.

Usage

1
draw.binom(ss, theta1 = 0.3, theta2 = 0.7, row.prop = 1/2, matrix = FALSE)

Arguments

ss

a positive integer representing the sample size

theta1

the probability of success of the first group

theta2

the probability of success of the second group

row.prop

the proportion of observations in the first group. Default is 1/2.

matrix

a logical for whether to return a matrix or data frames. Default is FALSE.

Value

If the argument matrix is FALSE, a list containing a (0,1) group indicator data frame and a (0,1) response data frame, each with ss rows and one column. If the argument matrix is TRUE, a 2x2 matrix storing the data in a contingency table.

Examples

1
out <- draw.binom(100)

brb225/FragilityTools documentation built on Jan. 21, 2022, 1:26 a.m.