Learn R Programming

umx (version 1.2.5)

summaryAPA: summaryAPA

Description

This function creates object summaries used in reporting models, effects, and summarizing data. 1. Given an lm, will return a formated effect, including 95% CI in square brackets, for one of the effects (specified by name in se). e.g.:

summaryAPA(m1, "wt") $\beta$ = -5.344 [-6.486, -4.203], p< 0.001

2. Given a dataframe, summaryAPA will return a table of correlations, with the mean and SD of each variable as the last row.

3. Given obj and se will return a CI based on 1.96 times the se.

4. Given only obj, will be treated as a p value as returned in APA format.

Usage

summaryAPA(obj, se = NULL, std = FALSE, digits = 2, use = "complete",
  min = 0.001, addComparison = NA, report = c("table", "html"))

Arguments

obj
Either a model (lm), a beta-value, or a data.frame
se
If b is a model, then name of the parameter of interest, else the SE (standard-error)
std
If obj is an lm, whether to re-run the model on standardized data and report std betas
digits
Round numbers to how many values
use
If obj is a data.frame, how to handle NA (default = "complete")
min
= .001 for a p-value, the smallest value to report numerically
addComparison
for a p-value, whether to add "
report
what to return (default = markdown table). Use "html" to open a web page table

Value

  • - string

References

- https://github.com/tbates/umx, https://tbates.github.io

See Also

Other Reporting Functions: loadings.MxModel, umx_APA_pval, umx_aggregate, umx_print, umx_show, umx_time, umx

Examples

Run this code
# Generate a formatted string convey the effects in a model:  
summaryAPA(lm(mpg ~ wt + disp, mtcars))
summaryAPA(lm(mpg ~ wt + disp, mtcars), "disp")
# Generate a summary table of correlations + Mean and SD:
summaryAPA(mtcars[,1:3])
# Generate a CI string based on effect and se
summaryAPA(.4, .3)
# format p-value
summaryAPA(.0182613)
summaryAPA(.000182613)

Run the code above in your browser using DataLab