Learn R Programming

statsExpressions (version 1.4.0)

tidy_model_expressions: Expressions with statistics for tidy regression data frames

Description

Expressions with statistics for tidy regression data frames

Usage

tidy_model_expressions(
  data,
  statistic = NULL,
  k = 2L,
  effsize.type = "omega",
  ...
)

Arguments

data

A tidy data frame from regression model object (see statsExpressions::tidy_model_parameters()).

statistic

Which statistic is to be displayed (either "t" or "f"or "z" or "chi") in the expression.

k

Number of digits after decimal point (should be an integer) (Default: k = 2L).

effsize.type

Type of effect size needed for parametric tests. The argument can be "eta" (partial eta-squared) or "omega" (partial omega-squared).

...

Currently ignored.

Details

When any of the necessary numeric column values (estimate, statistic, p.value) are missing, for these rows, a NULL is returned instead of an expression with empty strings.

Examples

Run this code
if (FALSE) { # identical(Sys.getenv("NOT_CRAN"), "true")
# setup
set.seed(123)
library(statsExpressions)

# extract a tidy data frame
df <- tidy_model_parameters(lm(wt ~ am * cyl, mtcars))

# create a column containing expression; the expression will depend on `statistic`
tidy_model_expressions(df, statistic = "t")
tidy_model_expressions(df, statistic = "z")
tidy_model_expressions(df, statistic = "chi")
}

Run the code above in your browser using DataLab