Learn R Programming

umx (version 1.4.0)

umxAPA: umxAPA

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.: umxAPA(m1, "wt") yields:

$\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. So, umxAPA(mtcars[,c("cyl", "wt", "mpg", )]) yields a table of correlations, means and SDs thus:

cyl wt
mpg cyl 1
0.78 -0.85 wt
0.78 1 -0.87
mpg -0.85 -0.87
1 cyl

3. Given obj and se, umxAPA returns a CI based on 1.96 times the se.

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

Usage

umxAPA(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, mxSE, 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:  
umxAPA(lm(mpg ~ wt + disp, mtcars))
umxAPA(lm(mpg ~ wt + disp, mtcars), "disp")
# Generate a summary table of correlations + Mean and SD:
umxAPA(mtcars[,1:3])
# Generate a CI string based on effect and se
umxAPA(.4, .3)
# format p-value
umxAPA(.0182613)
umxAPA(.000182613)

Run the code above in your browser using DataLab