mc_gini_test: Monte Carlo Gini Index Test

Description Usage Arguments Examples

View source: R/mc_gini_test.R

Description

Takes a vector of counts and calculates its Gini coefficient then it generates a Monte Carlo distribution of Gini coefficients under the specified family (Poisson or nbinom) and compares the observed Gini with the MC confidence interval. There is an option to generate a plot of the values and critical region.

Usage

1
2
mc_gini_test(x, data = NULL, reps = 2000, keep_reps = FALSE,
  family = c("poisson", "nbinom"), plots = FALSE)

Arguments

x

A numeric or intenger vector of event counts. If data is provided, x is the character label of the column of event counts.

data

A data frame.

reps

The number of Monte Carlo replicates

keep_reps

Logical option to keep the vector of Gini Index statistics for the Monte Carlo replications.

family

Family distribution for the Null Hypothesis.

plots

Logical indicating whether to generate a plot of the test.

Examples

1
mc_gini_test("extortions", data = testdata, plots = TRUE, family = "poisson")

prestevez/victim documentation built on Jan. 30, 2020, 7:16 p.m.