Description Usage Arguments Examples
View source: R/helpers_expr_templates.R
Creates an expression from a dataframe containing statistical details.
Ideally, this dataframe would come from having run tidy_model_parameters
function on your model object.
This function is currently not stable and should not be used outside of this package context.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19  expr_template(
data,
paired = FALSE,
bayesian = FALSE,
no.parameters = 0L,
statistic.text = NULL,
effsize.text = NULL,
top.text = NULL,
prior.distribution = NULL,
prior.type = NULL,
n = NULL,
n.text = ifelse(paired, list(quote(italic("n")["pairs"])),
list(quote(italic("n")["obs"])))[[1]],
conf.method = "HDI",
k = 2L,
k.df = 0L,
k.df.error = 0L,
...
)

data 
A dataframe containing details from the statistical analysis and should contain some or all of the the following columns:

paired 
Logical that decides whether the experimental design is
repeated measures/withinsubjects or betweensubjects. The default is

bayesian 
Is this Bayesian analysis? Defaults to 
no.parameters 
An integer that specifies that the number of parameters
for the statistical test. Can be 
statistic.text 
A character that specifies the relevant test statistic.
For example, for tests with tstatistic, 
effsize.text 
A character that specifies the relevant effect size. 
top.text 
Text to display on top of the Bayes Factor message. This is
mostly relevant in the context of 
prior.distribution 
A character that specifies the prior type. 
prior.type 
The type of prior. 
n 
An integer specifying the sample size used for the test. 
n.text 
A character that specifies the design, which will determine
what the 
conf.method 
The type of index used for Credible Interval. Can be

k 
Number of digits after decimal point (should be an integer)
(Default: 
k.df, k.df.error 
Number of decimal places to display for the
parameters (default: 
... 
Currently ignored. 
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25  set.seed(123)
# creating a dataframe with stats results
stats_df < cbind.data.frame(
statistic = 5.494,
df = 29.234,
p.value = 0.00001,
estimate = 1.980,
conf.level = 0.95,
conf.low = 2.873,
conf.high = 1.088
)
# expression for *t*statistic with Cohen's *d* as effect size
# note that the plotmath expressions need to be quoted
expr_template(
no.parameters = 1L,
data = stats_df,
statistic.text = quote(italic("t")),
effsize.text = quote(italic("d")),
n = 32L,
n.text = quote(italic("n")["no.obs"]),
k = 3L,
k.df = 3L
)

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.