Learn R Programming

moodlequizR (version 2.1.1)

gen.cont.table.data: gen.cont.table.data

Description

This function generates data for problems that use contingency tables

Usage

gen.cont.table.data(n, A, B, tbl = FALSE, rho)

Value

A matrix with two columns

Arguments

n

sample size

A

vector of values of first categorical variable

B

vector of values of second categorical variable

tbl

should output be a table

rho

correlation between A and B

Examples

Run this code
gen.cont.table.data(10, c("a", "b"), 1:3, rho=0.9)

Run the code above in your browser using DataLab