Next: fromclip()
Up: MacAnova Help File
Previous: fprint()
Contents
Usage:
result <- formatpval(pvals [,minpval:minp] [,format:fmt]), non-negative
REAL vector or scalar, nonnegative REAL scalar minp <= .001, CHARACTER
scalar fmt
|
Keywords:
output
formatpval() is designed to be used in a macro to format printed
P-values similarly to the way the built-in GLM functions such as
regress(), anova() and logistic() do.
result <- formatpval(pvals), where pvals is a REAL scalar or vector with
min(pvals) >= 0, computes the CHARACTER scalar or vector result the same
length as pvals.
If pvals[i] < minP, where minP is the value of option 'minpval', then
result[i] has the form, for example, "< 1e-8", when minP = 1e-8. If
pvals[i] >= minP, result[i] is simply paste(pvals[i]).
result <- formatpval(pvals, minpval:minP), where 0 <= minP <= .001 does
the same, except the supplied value of minP is used.
result <- formatpval(pvals, format:fmt [, minpval:minP]), where fmt is a
CHARACTER scalar specifying a legal output format (see subtopic
options:"format"), does the same, except fmt is used to format result,
instead of the default format.
Cmd> tstats <- vector(4.585, 5.536, 6.576, 7.611, 8.826)
Cmd> formatpval(twotailt(tstats,23),minpval:1e-7,format:".3g")
(1) "0.000131"
(2) "1.25e-05"
(3) "1.04e-06"
(4) "< 1e-07"
(5) "< 1e-07"
See also print(), write(), options:"minpval", options:"format",
twotailt().
Gary Oehlert
2003-01-15