Learn R Programming

apsrtable (version 0.7-3)

notefunctions: Table notes

Description

Prepare notes about standard errors and statistical significance

Usage

se.note()
stars.note()

Arguments

Value

  • A character string to place within the tabular environment in footnotesize beneath other output.

Details

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.

Examples

Run this code
### Custom note function

signif.pct <- function() {
  env <- sys.frame(-3); 
  paste("$^*$ significant at", evalq(lev,env)*100, "percent")
}
### Continue the example from apsrtable
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" )
	 )

Run the code above in your browser using DataLab