Generate text-based summaries of statistical output that can be embedded into prompts for querying Large Language Models (LLMs). Intended primarily for internal use.
Usage
summarize(object, ...)
# Default S3 method
summarize(object, ...)
# S3 method for class 'htest'
summarize(object, ...)
# S3 method for class 'lm'
summarize(object, ...)
# S3 method for class 'glm'
summarize(object, ...)
# S3 method for class 'polr'
summarize(object, ...)
# S3 method for class 'lme'
summarize(object, ...)
# S3 method for class 'lmerMod'
summarize(object, ...)
# S3 method for class 'glmerMod'
summarize(object, ...)
# S3 method for class 'gam'
summarize(object, ...)
# S3 method for class 'survreg'
summarize(object, ...)
# S3 method for class 'coxph'
summarize(object, ...)
# S3 method for class 'rpart'
summarize(object, ...)
Arguments
- object
An object for which a summary is desired (e.g., a glm object).
- ...
Additional optional arguments. (Currently ignored.)
Examples
tt <- t.test(1:10, y = c(7:20))
summarize(tt) # prints output as a character string
#> [1] "\n\tWelch Two Sample t-test\n\ndata: 1:10 and c(7:20)\nt = -5.4349, df = 21.982, p-value = 1.855e-05\nalternative hypothesis: true difference in means is not equal to 0\n95 percent confidence interval:\n -11.052802 -4.947198\nsample estimates:\nmean of x mean of y \n 5.5 13.5 \n"
cat(summarize(tt)) # more useful for reading
#>
#> Welch Two Sample t-test
#>
#> data: 1:10 and c(7:20)
#> t = -5.4349, df = 21.982, p-value = 1.855e-05
#> alternative hypothesis: true difference in means is not equal to 0
#> 95 percent confidence interval:
#> -11.052802 -4.947198
#> sample estimates:
#> mean of x mean of y
#> 5.5 13.5