Gmc: Monte Carlo Gini Coefficient

Description Usage Arguments Value

View source: R/Gmc.R

Description

A function that estimates a Gini coefficient using a Monte Carlo simulation of a Poisson process. It uses the Gini function from the ineq package.

Usage

1
Gmc(x, n = NULL, reps = 99, mean = TRUE)

Arguments

x

a vector of counts that is to be simulated, or a mean event rate representing the distribution to be simulated. x can be a table or a dataframe with a distribution, instead of the whole vector.

n

a number representing how many observations should be generated in each replicate. Defaults to NULL, in which case the length(x) is used.

reps

number of replicates to generate, defaults to 99.

mean

logical idicating whether the estimate reported ought to be the mean or median of the simulated estimates. Defaults to TRUE (i.e. the mean)

conf.level

the alpha value of the confidence interval; defaults to 0.95. Only accepts values between 0 and 1, exclusive.

Value

A list of Gmc class, number of replictes, type of estimate (mean or median), the simulated distributions and their Gini coefficients.


prestevez/crimeineq documentation built on May 29, 2019, 7:39 a.m.