Learn R Programming

apsrtable (version 0.8-8)

notefunctions: Table notes

Description

Prepare notes about standard errors and statistical significance

Usage

se.note(env) stars.note(env)

Arguments

env
The environment of the apsrtable() call, because note functions may need to make use of some variables such as lev or digits.

Value

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.”.

To access variables in the call to apsrtable from functions in notes, include the arugment env in any custom functions. This is the apsrtable call environment.

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) {
  paste("$^*$ significant at", evalq(lev,envir=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)

Run the code above in your browser using DataLab