Description Usage Arguments Value Examples
Computes the standardized mean differnce (SMD) between two groups.
d = √{D' S^{-1} D}
where D is a vector of differences between group 1 and 2 and S is the covariance matrix of these differences. If D is length 1, the result is multplied by sign(D).
In the case of a numeric
or integer
variable, this is equivalent
to:
d = \frac{\bar{x}_1 - \bar{x}_2}{√{(s^2_1 + s^2_2)/2}}
where \bar{x}_g is the sample mean for group g and s^2_g is the sample variance.
For a logical
or factor
with only two levels, the equation above is
\bar{x}_g = \hat{p}_g, i.e. the sample proportion and s^2_g = \hat{p}_g(1 - \hat{p}_g).
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 | smd(x, g, w, std.error = FALSE, na.rm = FALSE, gref = 1L)
## S4 method for signature 'character,ANY,missing'
smd(x, g, w, std.error = FALSE, na.rm = FALSE, gref = 1L)
## S4 method for signature 'character,ANY,numeric'
smd(x, g, w, std.error = FALSE, na.rm = FALSE, gref = 1L)
## S4 method for signature 'logical,ANY,missing'
smd(x, g, w, std.error = FALSE, na.rm = FALSE, gref = 1L)
## S4 method for signature 'logical,ANY,numeric'
smd(x, g, w, std.error = FALSE, na.rm = FALSE, gref = 1L)
## S4 method for signature 'matrix,ANY,missing'
smd(x, g, w, std.error = FALSE, na.rm = FALSE, gref = 1L)
## S4 method for signature 'matrix,ANY,numeric'
smd(x, g, w, std.error = FALSE, na.rm = FALSE, gref = 1L)
## S4 method for signature 'list,ANY,missing'
smd(x, g, w, std.error = FALSE, na.rm = FALSE, gref = 1L)
## S4 method for signature 'list,ANY,numeric'
smd(x, g, w, std.error = FALSE, na.rm = FALSE, gref = 1L)
## S4 method for signature 'data.frame,ANY,missing'
smd(x, g, w, std.error = FALSE, na.rm = FALSE, gref = 1L)
## S4 method for signature 'data.frame,ANY,numeric'
smd(x, g, w, std.error = FALSE, na.rm = FALSE, gref = 1L)
|
x |
a |
g |
a vector of at least 2 groups to compare. This should coercable to a
|
w |
a vector of |
std.error |
Logical indicator for computing standard errors using
|
na.rm |
Remove |
gref |
an integer indicating which level of |
a data.frame
containing standardized mean differences between
levels of g
for values of x
. The data.frame
contains
the columns:
term
: the level being comparing to the reference level
estimate
: SMD estimates
std.error
: (if std.error = TRUE
) SMD standard error estimates
1 2 3 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.