exact2x2Plot: Plot p-value function for one 2 by 2 table.

View source: R/exact2x2Plot.R

exact2x2PlotR Documentation

Plot p-value function for one 2 by 2 table.

Description

Plots two-sided p-values as a function of odds ratios. Can plot three types of p-values: the two-sided Fisher's exact, the central Fisher's exact (i.e., twice the one-sided Fisher's exact), and Blaker's exact.

Usage

exact2x2Plot(x, y=NULL, OR = NULL, ndiv = 1000, tsmethod=NULL,
    method = NULL, paired=FALSE, orRange = NULL, dolog = TRUE,
    dolines = FALSE, dopoints = TRUE, doci=TRUE,  
    alternative=c("two.sided","less","greater"),
    conf.level=.95, alphaline=TRUE, newplot = TRUE, ...)

Arguments

x

matrix representing the 2 by 2 table

y

a factor object; ignored if x is a matrix.

OR

odds ratio values for plot, if NULL divides orRange into ndiv pieces

ndiv

number of pieces to divide up odds ratio range

tsmethod

either "minlike","blaker" or "central"

method

same as tsmethod, kept for backward compatability

paired

logical, do paired analysis giving McNemar's test p-values

orRange

range for calculating odds ratios

dolog

logical,plot odds ratios on log scale?

dolines

logical, add lines to a plot?

dopoints

logical, add points to a plot?

doci

logical, add vertical lines at confidence interval?

alternative

one of "two.sided","less","greater", type of alternative for p-values

conf.level

when doci=TRUE, level for confidence interval to be plotted

alphaline

logical, if doci=TRUE should a line be drawn at the significance level?

newplot

logical,start a new plot?

...

values passed to plot, points, or lines statement

See Also

exact2x2

Examples

example1<-matrix(c(6,12,12,5),2,2,dimnames=list(c("Group A","Group B"),c("Event","No Event")))
example1
exact2x2Plot(example1)
## add lines from central Fisher's exact
exact2x2Plot(example1,method="central",dolines=TRUE,newplot=FALSE,col="red")

exact2x2 documentation built on Feb. 16, 2023, 10:11 p.m.