compute_gini: Compute gini index.

View source: R/compute_functions.R

compute_giniR Documentation

Compute gini index.

Description

\lifecycle

experimental Compute the gini index with weights.

Usage

compute_gini(file, file_name, variable, weight = NULL, na.rm = FALSE)

Arguments

file

A LIS or LWS file.

file_name

The name of the LIS or LWS file.

variable

A string with the name of the variable for which gini should be computed.

weight

A string with the name of the variable in 'file' that should be used as sample weights.

na.rm

A boolean. Indicates if NAs should be ignored. Defaults to FALSE.

Value

A numeric vector with the gini index.

Examples

## Not run: 
lissy_datasets <- read_lissy_files(c("fr84h", "fr94h", "fr10h"))
compute_gini(lissy_datasets[["fr1984h"]], "dhi", na.rm = TRUE)

## End(Not run)

JosepER/lissyrtools documentation built on Jan. 26, 2025, 10:01 p.m.