Skip to main content

Section 13.7 Quick Reference to ISCAM R Workspace Functions and Other R Commands

Table 13.7.1. R Command Reference
Procedure Desired Function Name (Options)
Set up two-way table matrixname = matrix(c(A, C, B, D), nrow = 2, dimnames = list(c("row name", "row name"), c("column name", "column name")))
Segmented bar graph Set up two-way table and then use barplot; barplot(prop.table(matrixname, margin=2), legend = T, ylab = "Proportion")
Generate data from Binomial rbinom(number, sample size, probability)
Create a column of 3 graphs par(mfrow=c(3,1))
Two proportion z-test/interval iscamtwopropztest(x1, n1, x2, n2, hypothesized, alternative, conf.level) *x1 can be count or proportion
Hypergeometric probability iscamhyperprob(k, total, succ, n, lower.tail = FALSE)
Normal approximation to hypergeometric iscamhypernorm(x, N, M, n, TRUE/FALSE)
Generate data from hypergeometric rhyper(number, sample size, probability)
Create Boolean for values below x sum(data <= x)/n
Fisher’s Exact Test, CI for odds ratio fisher.test(matrix, alternative)
Relative risk fmsb::riskratio(A, B, A+C, B+D, conf.level, p.calc.by.independence = TRUE)
You have attempted of activities on this page.