Description Usage Arguments Examples
View source: R/add_stats.data.frame.r
add_stats.data.frame
is a function to add a tidy data frame of
results to a tidystats list. tidystats does not support all possible
statistical tests, so it may not be able to produce tidy output of a
statistical model. The best solution for now is to tidy the output of a
statistical test yourself, creating a tidy data frame, and then use
add_stats
, which will call this function, to add it to the tidystats
list.
1 2 3 4 |
results |
A tidystats list. |
output |
A data frame that contains statistical output in a tidy format. |
identifier |
A character string identifying the model. Automatically created if not provided. |
type |
A character string indicating the type of test. One of "hypothesis", "manipulation check", "contrast", "descriptives", or "other". Can be abbreviated. |
confirmatory |
A boolean to indicate whether the statistical test was confirmatory (TRUE) or exploratory (FALSE). Can be NA. |
notes |
A character string to add additional information. Some statistical tests produce notes information, which will be overwritten if notes are provided. |
class |
Unused. |
args |
Unused. |
1 2 3 4 5 6 7 8 9 10 11 12 | # Create an empty list to store the results in
results <- list()
# Example: Manual chi-squared test of independence
x_squared_data <- data.frame(
statistic = c("X-squared", "df", "p"),
value = c(5.4885, 6, 0.4828),
method = "Chi-squared test of independence"
)
# Add results to results
results <- add_stats(results, x_squared_data)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.