disprop: Disproportionality

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/disprop.R

Description

Calculates the magnitude of disproportionality for values within a dataset.

Usage

1

Arguments

z

"hotspots" object

Details

Calculates the magnitude of disproportionality for each value within the data by dividing the difference between each value and the median by the difference between the hot spot cutoff, (Ch, as calculated by the function hotspots), and the median:

disproportionality = (x - med(x)) / (Ch - med(x))

Using this equation, all hot spots have a magnitude of disproportionality of > 1. Increasingly skewed distributions (for example, lognormal distributions with higher standard deviation) will have higher magnitudes of disproportionality for some of their values.

Value

A list containing the objects positive, negative, or both, depending on the which tails were calculated in the hotspots object. These objects are numeric vectors of the magnitudes of disproportionality. NA values are preserved.

Author(s)

Anthony Darrouzet-Nardi

See Also

hotspots

Examples

1
2
3
4
5
6
7
8
rln30 <- sort(c(rlnorm(15),rlnorm(15)*-1,NA), na.last = TRUE)
rln30
disprop(hotspots(rln30, tail = "both"))

#higher levels of disproportionality
rln30sd2 <- sort(c(rlnorm(15,sd = 3),rlnorm(15,sd = 3)*-1,NA), na.last = TRUE)
rln30sd2
disprop(hotspots(rln30sd2, tail = "both"))

Example output

Loading required package: lattice
Loading required package: ineq
 [1] -4.1059871 -2.2890583 -2.2355564 -1.7113327 -1.6485105 -1.4999897
 [7] -1.3453997 -1.1560398 -0.7847109 -0.7289945 -0.6159303 -0.5967237
[13] -0.5866681 -0.5775989 -0.4499879  0.2616265  0.3620220  0.4193956
[19]  0.4942839  0.6509198  0.7390413  0.8521111  0.9042273  1.0789752
[25]  1.0975336  1.1732652  1.2278229  4.8399564  8.4467287 12.6139661
[31]         NA
$positive
 [1] -1.06489414 -0.58260847 -0.56840690 -0.42925693 -0.41258139 -0.37315804
 [7] -0.33212366 -0.28185994 -0.18329439 -0.16850501 -0.13849324 -0.13339506
[13] -0.13072590 -0.12831855 -0.09444549  0.09444549  0.12109448  0.13632374
[19]  0.15620209  0.19777952  0.22117051  0.25118377  0.26501750  0.31140257
[25]  0.31632873  0.33643092  0.35091273  1.30971769  2.26709957  3.37325134
[31]          NA

$negative
 [1]  1.06489414  0.58260847  0.56840690  0.42925693  0.41258139  0.37315804
 [7]  0.33212366  0.28185994  0.18329439  0.16850501  0.13849324  0.13339506
[13]  0.13072590  0.12831855  0.09444549 -0.09444549 -0.12109448 -0.13632374
[19] -0.15620209 -0.19777952 -0.22117051 -0.25118377 -0.26501750 -0.31140257
[25] -0.31632873 -0.33643092 -0.35091273 -1.30971769 -2.26709957 -3.37325134
[31]          NA

 [1] -5.824752e+03 -6.791703e+02 -4.376427e+02 -4.564945e+01 -1.216731e+01
 [6] -7.341244e+00 -5.967454e+00 -4.798547e+00 -2.223625e+00 -4.022950e-01
[11] -2.580310e-01 -1.778074e-01 -1.002476e-01 -2.126799e-02 -7.233896e-03
[16]  1.364273e-02  1.803004e-01  3.693364e-01  1.474913e+00  1.975723e+00
[21]  2.181088e+00  2.342581e+00  4.627229e+00  8.298387e+00  1.035225e+01
[26]  1.193587e+01  3.068017e+01  8.539469e+01  1.240564e+02  7.920127e+02
[31]            NA
$positive
 [1] -3.385904e+02 -3.948005e+01 -2.544016e+01 -2.653769e+00 -7.074667e-01
 [6] -4.269295e-01 -3.470717e-01 -2.791237e-01 -1.294446e-01 -2.357150e-02
[11] -1.518550e-02 -1.052214e-02 -6.013620e-03 -1.422570e-03 -6.067745e-04
[16]  6.067745e-04  1.029451e-02  2.128309e-02  8.554977e-02  1.146616e-01
[21]  1.265994e-01  1.359869e-01  2.687925e-01  4.821953e-01  6.015855e-01
[26]  6.936406e-01  1.783238e+00  4.963769e+00  7.211158e+00  4.603916e+01
[31]            NA

$negative
 [1]  3.385904e+02  3.948005e+01  2.544016e+01  2.653769e+00  7.074667e-01
 [6]  4.269295e-01  3.470717e-01  2.791237e-01  1.294446e-01  2.357150e-02
[11]  1.518550e-02  1.052214e-02  6.013620e-03  1.422570e-03  6.067745e-04
[16] -6.067745e-04 -1.029451e-02 -2.128309e-02 -8.554977e-02 -1.146616e-01
[21] -1.265994e-01 -1.359869e-01 -2.687925e-01 -4.821953e-01 -6.015855e-01
[26] -6.936406e-01 -1.783238e+00 -4.963769e+00 -7.211158e+00 -4.603916e+01
[31]            NA

hotspots documentation built on May 1, 2019, 8:19 p.m.

Related to disprop in hotspots...