div_add_median_label {div}R Documentation

Adds a column with new labels (H)igh and (L) for a given colName (within a given grade and jobID)

Description

This function calculates the entropy of a system with discrete states

Usage

div_add_median_label(
  d,
  colName = "age",
  value1 = "T",
  value2 = "F",
  newColName = "isYoung"
)

Arguments

d

tibble, a tibble with team data columns as defined in the documentation (at least the column colName (as set by next parameter), 'grade', and 'jobID')

colName

the name of the columns that contains the factor object to be used as explaining dimension for the paygap (defaults to 'gender')

value1

character, the label to be used for the first half of observations (the smallest ones)

value2

character, the label to be used for the second half of observations (the biggest ones)

newColName

the value in new column name that will hold the values value1 and value2

Value

dataframe (with columns grade, jobID, salary_selectedValue, salary_others, n_selectedValue, n_others, paygap, confidence) , where "confidence" is one of the following: NA = not available (numbers are too low), "" = no bias detectable, "." = there might be some bias, but we're not sure, "*" = bias detected wit some degree of confidence, "**" = quite sure there is bias, "***" = trust us, this is biased.

Examples

df <- div_add_median_label(div_fake_team())
colnames(df)

[Package div version 0.3.1 Index]