stat.col | R Documentation |
This function produces vectors of p-values and tests for addition via ptype= to a summary table generated with make.table
. P-values are rounded to three decimal places or formatted as '<0.001' as appropriate. The name of the test is printed if requested with pname=TRUE.
stat.col(var, strat, ptype, pname, output)
var |
Variable input. Required. |
strat |
Column stratifying variable. Required for two-sample tests. |
ptype |
Test requested to compute p-value. Required.
|
pname |
If TRUE then the name of the statistical test used will be printed below the p-value. Optional; defaults to FALSE. |
output |
Type of output, passed from |
Returns a vector with a p-value and the name of the test used, if requested, to be added to a summary data frame.
Erica Wozniak
Table1
make.table
quick.table
cat.var
cont.var
out.plain
out.latex
out.html
library(survival) attach(pbc) ##Default output stat.col(var=bili, strat=sex, ptype='ttest') ##Print test stat.col(var=bili, strat=sex, ptype='ttest', pname=TRUE) ##The ptype= and pname= options in summary functions call stat.col #Results are automatically added to the summary table cat.var(var=hepato, strat=sex, rownames=c('Not present', 'Present'), header=c('Hepatomegaly'), ptype='chisq', pname=TRUE )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.