/
pretty_per_effect.Rd
86 lines (65 loc) · 2.97 KB
/
pretty_per_effect.Rd
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/pretty_per_effect.R
\name{pretty_per_effect}
\alias{pretty_per_effect}
\title{A Function to Convert Effect Estimates into Percentage Changes}
\usage{
pretty_per_effect(est = NULL, lci = NULL, uci = NULL, string = FALSE,
sep = " to ", note = "95\% CI ", replace_bracket = TRUE, digits = 0,
inline = FALSE, percentage = TRUE, effect_direct = "increase", ...)
}
\arguments{
\item{est}{A numeric or character vector of estimates.}
\item{lci}{A numeric or character vector of lower confidence/credible intervals.}
\item{uci}{A numeric or character vector of upper confidence/credible intervals.}
\item{string}{Logical, defaults to \code{FALSE}. Is the input a string as formated by
\code{pretty_ci}? If \code{TRUE} Then this function is not vectorised. Will attempt to
split based on the supplied sep criteria as well as several common splitting characters.}
\item{sep}{A character vector indicating the seperator used between the upper and
lower confidence/credible intervals. The default is ' to '.}
\item{note}{A character vector indicating the explanatory note to be used.}
\item{replace_bracket}{Logical, defaults to \code{TRUE}. Should the leading bracket be automatically
be reinserted in front of the custom note supplied by \code{note}.}
\item{digits}{Integer indicating the number of decimal places to be used.}
\item{inline}{Logical operator indicating whether an explanatory note is required.}
\item{percentage}{A logical (defaults to \code{FALSE}), which indicates whether the output should
be treated as a percentage.}
\item{effect_direct}{A character string indicating the direction of the percentage.
Can be specified as "increase" or "decrease" (defaults to "increase").}
\item{...}{Pass additional arguements to \code{\link[prettypublisher]{pretty_ci}}}
}
\value{
A pretty formated percentage with confidence intervals
}
\description{
A function to convert effect estimates into percentage changes for use in line in
publications. It can either convert an effect estimate with lower and upper confidence intervals that
is unformated into a pretty formated percentage or it can convert a \code{\link[prettypublisher]{pretty_ci}}
formatted effect size into a pretty formated percentage.
}
\examples{
est <- 1.2
lci <- 1.1
uci <- 1.3
## As unformated effects
pretty_per_effect(est, lci, uci)
## As formated effects
x <- pretty_ci(est, lci, uci, inline = TRUE)
pretty_per_effect(x, string = TRUE, inline = TRUE)
## For a decrease
pretty_per_effect(x, string = TRUE, inline = TRUE, effect_direct = "decrease")
## For difference seperations between strings (vectorised)
x <- pretty_ci(est, lci, uci, inline = TRUE, sep = ", ")
x <- c(x, x)
pretty_per_effect(x, string = TRUE, inline = TRUE)
## For a decrease
pretty_per_effect(x, string = TRUE, inline = TRUE, effect_direct = "decrease")
## Vectorised (as a string)
est <- c(est, 1.1)
lci <- c(lci, 1)
uci <- c(uci, 1.2)
pretty_per_effect(est, lci, uci)
}
\seealso{
pretty_ci
}