fsmry2.by.grp: Summarize a categorical variable by a categorical variable

View source: R/fsmry2.by.grp.R

fsmry2.by.grpR Documentation

Summarize a categorical variable by a categorical variable

Description

Summarize a categorical variable by a categorical variable

Usage

fsmry2.by.grp(y, grp, cmp.method = c("fisher", "chisq"))

Arguments

y

A categorical variable.

grp

A categorical group variable.

cmp.method

Text string for comparisons method, "fisher" or, "chisq"

An

indicator of whether to log transform y

Value

Summary of difference in distribution of y by grp using Fisher's exact test or chi-squared test.

Examples

fsmry2.by.grp(y = factor(rep(c("Female", "Male", "Female", "Male"), c(2,8,6,4))),
              grp = factor(rep(c("grp1", "grp2"), each=10)),
              cmp.method = "fisher")

xkzhou/BTKR documentation built on Feb. 1, 2023, 1:14 a.m.