notefunctions {apsrtable} | R Documentation |
Prepare notes about standard errors and statistical significance
se.note() stars.note()
Table notes are part of the tabular environment and may be based on the content of the table itself. For example, the stars
argument to apsrtable
determines whether one or many levels of statistical significance are indicated in the output. The stars.note
function creates text to place in such a note.
By default the output uses the notation * p <.05 and the example below shows a replacement function that states, “significant at lev
percent.”.
Thanks to lazy evaulation, you can access variables in the call to apsrtable
from functions in notes
. The appropriate environment is 3 levels up the call stack (see the example).
Remember, to escape characters in Latex output, backslashes have to be doubled in R character strings.
A character string to place within the tabular environment in footnotesize beneath other output.
Michael Malecki <malecki at wustl.edu>
### Custom note function signif.pct <- function() { env <- sys.frame(-3); paste("$^*$ significant at", evalq(lev,env)*100, "percent") } ### Continue the example from apsrtable ## Not run: apsrtable(lm.D90, lm.D9, glm.D9, digits=1, align="left", stars=1, lev=0.05, model.counter=0, order="rl", notes=list(se.note(), signif.pct(), "Plant weight data from the lm() example" ) ) ## End(Not run)