Computes the standardized mean differnce (SMD) between two groups.

$$ d = \sqrt{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}{\sqrt{(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)\).

```
smd(x, g, w, std.error = FALSE, na.rm = FALSE, gref = 1L)
# S4 method for character,ANY,missing
smd(x, g, w, std.error = FALSE, na.rm = FALSE, gref = 1L)
# S4 method for character,ANY,numeric
smd(x, g, w, std.error = FALSE, na.rm = FALSE, gref = 1L)
# S4 method for logical,ANY,missing
smd(x, g, w, std.error = FALSE, na.rm = FALSE, gref = 1L)
# S4 method for logical,ANY,numeric
smd(x, g, w, std.error = FALSE, na.rm = FALSE, gref = 1L)
# S4 method for matrix,ANY,missing
smd(x, g, w, std.error = FALSE, na.rm = FALSE, gref = 1L)
# S4 method for matrix,ANY,numeric
smd(x, g, w, std.error = FALSE, na.rm = FALSE, gref = 1L)
# S4 method for list,ANY,missing
smd(x, g, w, std.error = FALSE, na.rm = FALSE, gref = 1L)
# S4 method for list,ANY,numeric
smd(x, g, w, std.error = FALSE, na.rm = FALSE, gref = 1L)
# S4 method for data.frame,ANY,missing
smd(x, g, w, std.error = FALSE, na.rm = FALSE, gref = 1L)
# S4 method for data.frame,ANY,numeric
smd(x, g, w, std.error = FALSE, na.rm = FALSE, gref = 1L)
```

- x
a

`vector`

or`matrix`

of values- g
a vector of at least 2 groups to compare. This should coercable to a

`factor`

.- w
a vector of

`numeric`

weights (optional)- std.error
Logical indicator for computing standard errors using

`compute_smd_var`

. Defaults to`FALSE`

.- na.rm
Remove

`NA`

values from`x`

? Defaults to`FALSE`

.- gref
an integer indicating which level of

`g`

to use as the reference group. Defaults to`1`

.

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