pvalueplot {fmsb}R Documentation

Drawing p-value function plot by a cross table


Drawing the p-value function (a.k.a. nested confidence intervals) plot of risk ratio (RR) or odds ratio (OR) for a given 2 by 2 cross table, which is strongly recommended by Rothman KJ "Epidemiology: An introduction. 2nd Ed." Oxford Univ. Press.

Until fmsb-0.4.2, the formula to calculate p-values was not appropriate, so that the curve was not correct. Through discussion with Professor Rothman, I realized my mistake, then fixed it in fmsb-0.4.3. The feasible calculation is only possible in the manner of back-calculation from p-values to RR or OR, so that the calculation of p-values is restricted to the given range from 0.0005 to 1.


 pvalueplot(XTAB, plot.OR, plot.log, xrange)



A 2 by 2 matrix to draw p-value function (in another term, nested confidence intervals). The table should be given as the cross table for the exposure status being column and the health outcome status being row, opposite from usual manner for cross tabulation. To note, usually the numbers of incidence and the total observed numbers for exposed and nonexposed population as risk data, but in this function, the numbers of incidence and the remaining numbers without disease should be given as rows.


Logical. If you want to draw the p-value function for the odds ratio, it should be set at TRUE, otherwise the p-value function for the risk ratio is drawn. Default FALSE.


A numeric vector includes 2 elements for minimum and maximum of x axis. Default is c(0.01, 5).


Logical. If TRUE, the horizontal axis becomes logarythmic scale. Default FALSE.


The data.frame containing the set of p-values (ranging from 0.0005 to 1) and corresponding RR or OR is returned.


Minato Nakazawa (minato-nakazawa[atmark]umin.net)



[Package fmsb Index]