Approximate information from a random samples of a given size for ordinal outcomes
Source:R/asymptotic_information_mw.R
asymptotic_information_mann_whitney_fm.Rd
These functions provide an asymptotic approximation to the information (i.e. precision, inverse of the variance) provided by two samples under either an assumed value of the Mann-Whitney estimand or probability mass functions (PMFs) of an ordinal outcome in treatment and control populations.
Usage
asymptotic_information_mann_whitney_fm(
n_0,
n_1,
mw = NULL,
pmf_1 = NULL,
pmf_0 = NULL,
adjust = TRUE
)
Arguments
- n_0
Numeric vector containing the sample size in the control arm
- n_1
Numeric vector containing the sample size in the treatment arm
- mw
Numeric vector containing the Mann-Whitney estimand
- pmf_1
Numeric vector or matrix of row vectors, each containing the probability mass function of outcomes in the population of individuals receiving the active intervention
- pmf_0
Numeric vector or matrix of row vectors, each containing the probability mass function of outcomes in the population of individuals receiving the control intervention
- adjust
(Scalar: Logical) Should the estimand be adjusted for ties? NOTE: This can only be computed when
pmf_0
andpmf_1
are supplied.
Value
When all parameters are scalars, the result is a scalar, indicating the approximate information. When multiple values are specified, a grid of unique parameters are constructed, and the approximate information is computed for each value of the parameters.
See also
asymptotic_information_difference_means and asymptotic_information_difference_proportions for continuous and binary outcomes, respectively.
Examples
# When a single value is supplied for each parameter, a scalar is returned:
asymptotic_information_mann_whitney_fm(
n_0 = 100,
n_1 = 100,
mw = 0.75,
adjust = FALSE
)
#> [1] 0.001185536
# When multiple values are supplied for one or more parameters, the grid of
# parameters are created, and a data.frame is returned.
asymptotic_information_mann_whitney_fm(
n_0 = c(100, 150),
n_1 = c(100, 150),
mw = 0.75,
adjust = FALSE
)
#> n_0 n_1 mw t information_asymptotic
#> 1 100 100 0.75 1 0.0011855357
#> 2 150 100 0.75 1 0.0009867857
#> 3 100 150 0.75 1 0.0009867857
#> 4 150 150 0.75 1 0.0007888095
# Specifying PMFs - With and Without Tie Adjustment
asymptotic_information_mann_whitney_fm(
n_0 = 100,
n_1 = 100,
pmf_0 = c(0.2, 0.2, 0.6),
pmf_1 = c(0.1, 0.1, 0.8),
adjust = TRUE
)
#> [1] 0.001036432
# Specifying Multiple PMFs
asymptotic_information_mann_whitney_fm(
n_0 = 100,
n_1 = 100,
pmf_0 =
rbind(
c(0.2, 0.2, 0.6),
c(0.3, 0.1, 0.6)
),
pmf_1 =
rbind(
c(0.1, 0.1, 0.8),
c(0.05, 0.05, 0.9)
),
adjust = TRUE
)
#> n_0 n_1 pmf_0 pmf_1 mw t pmf_0_1 pmf_0_2 pmf_0_3 pmf_1_1 pmf_1_2
#> 1 100 100 1 1 0.600 0.6502663 0.2 0.2 0.6 0.10 0.10
#> 2 100 100 2 1 0.610 0.6480162 0.3 0.1 0.6 0.10 0.10
#> 3 100 100 1 2 0.650 0.5742331 0.2 0.2 0.6 0.05 0.05
#> 4 100 100 2 2 0.655 0.5723581 0.3 0.1 0.6 0.05 0.05
#> pmf_1_3 information_asymptotic
#> 1 0.8 0.0010364315
#> 2 0.8 0.0010218898
#> 3 0.9 0.0008578564
#> 4 0.9 0.0008481421