ez.fishers: fisher.test(y,x), for many y and/or many x

View source: R/stats.R

ez.fishersR Documentation

fisher.test(y,x), for many y and/or many x

Description

fisher.test(y,x), for many y and/or many x

Usage

ez.fishers(
  df,
  y,
  x,
  report = T,
  view = F,
  plot = F,
  pmethods = c("bonferroni", "fdr"),
  compare = "col",
  cols = 3,
  lab.size = 18,
  text.size = 16,
  width = 300,
  error = T,
  pe = F,
  ...
)

Arguments

df

a data frame, internal go through dropna –> ez.2factor

y

compatible with ez.selcol

x

compatible with ez.selcol

report

print results (in APA format)

view

call View(result)

plot

T/F, the black dash line is bonferroni p = 0.05 (again for tests only with a non-NA p values), the grey black dash is uncorrected p = 0.05

pmethods

c('bonferroni','fdr'), type p.adjust.methods for all methods. This correction applies for all possible tests that have been/could be done.

compare

For posthoc, see more fisher.posthoc. If "row", treats the rows as the grouping variable. If "column", treats the columns as the grouping variable.

cols

number of columns for multiplot. NULL=auto calculate

width

width for toString(counts,width=width)

error

whether show error message when error occurs

Value

an invisible data frame or list of data frame (if many y and many x)

Note

odds ratio only exist for 2x2 table, otherwise NA (arbitrary assigned by jerry)
also computes chisq.test, however whenever any of expected count in cells was less than five (not observed frequency), fisher.test preferred because of cells that have expected count less than 5.
fisher.test() does not produce a test statistic, but SPSS does (termed as D(x), or FI(x), see p 151 of IBM SPSS Exact Tests)


jerryzhujian9/ezmisc documentation built on March 9, 2024, 12:44 a.m.