Type: Package
Title: Computes Statistics from Discrimination Experimental Data
Version: 0.1.3
Description: In discrimination experiments candidates are sent on the same test (e.g. job, house rental) and one examines whether they receive the same outcome. The number of non negative answers are first examined in details looking for outcome differences. Then various statistics are computed. This package can also be used for analyzing the results from random experiments.
License: GPL-3
Encoding: UTF-8
LazyData: true
RoxygenNote: 7.3.1
Imports: stats, ggplot2
Suggests: knitr, rmarkdown
BuildVignettes: true
VignetteBuilder: knitr
NeedsCompilation: no
Packaged: 2025-03-03 10:33:24 UTC; 32902
Author: Emmanuel Duguet ORCID iD [aut, cre], David Gray ORCID iD [ctb], Loïc du Parquet [dtc], Yannick L'Horty ORCID iD [ctb], Rémi Le Gall ORCID iD [dtc], Noam Léandri [dtc], Pascale Petit ORCID iD [ctb], Florent Sari ORCID iD [ctb]
Maintainer: Emmanuel Duguet <emmanuel.duguet@u-pec.fr>
Depends: R (≥ 3.5.0)
Repository: CRAN
Date/Publication: 2025-03-03 10:50:02 UTC

Origin/Gender discrimination and strongly negative mediatic exposure (information technologist)

Description

The data were collected by the TEPP team (FR CNRS 2042) between December 2008 and January 2009. A candidate is defined by the variables ("gender","origin", "mediaexp"). The variable "reput" creates a sample separation.

Usage

data(address1)

Format

A data frame with 3684 rows and 11 variables

References

Duguet E., Gray D., L'Horty Y., Du Parquet L, Petit P., 2020. Labor market effects of urban riots: an experimental assessment. Papers in Regional Science, 99:787-806.


Data formatting

Description

Creates the data set used in the callback package.

Usage

callback(data, cluster, candid, callback, comp = "ref")

Arguments

data

A data frame.

cluster

A variable name, identifying the test (e.g., a job offer number).

candid

A list of factor names defining the candidates (e.g., gender, origin).

callback

A Boolean variable, equal to TRUE for non negative callbacks.

comp

An option, equal to "all" or "ref" (the default). "ref" give the comparisons with the reference candidate, and "all" the pairwise comparisons.

Value

A list with class 'callback' containing the formatted data set (fds), the averaged formatted data set (afds, for multiple tests), the list of the paired formatted data sets (pfds), the offer-level formatted data set (ofds), the names of the candidate variables (candid) and the name of the callback variable (callback).

fds contains the following variables:

afds contains the following variables:

pfds data frames containing the following variables:

ofds contains variables corresponding to the candidates' codes and the following variables:

Author(s)

Emmanuel Duguet

Examples

data(inter1)
m <- callback(data=subset(origin1,reput=="U"),cluster="offer",candid="origin",
     callback="callback",comp = "ref")
str(m)

Creates the estimation data for a component model

Description

Creates the estimation data for a component model

Usage

callback_comp(
  data = NULL,
  cluster = NULL,
  candid = NULL,
  callback = NULL,
  model = NULL
)

Arguments

data

a data frame.

cluster

A variable name, identifying the test (e.g., a job offer number).

candid

A list of factor names defining the candidates (e.g., gender, origin).

callback

A Boolean variable, equal to TRUE for non negative callbacks.

model

a list of string lists, defining the components of the model, in difference from the reference candidate.

Value

a list with class callback_comp containing:

Author(s)

Emmanuel Duguet

Examples

data(mobility1)
model <- list(c("license"),c("woman"),c("woman","license","inter"))
callback_comp(data = mobility1, cluster = "offer",
candid = c("gender","licenses"), callback = "callback",
model = model)


Difference of proportions plot

Description

Difference of proportions plot

Usage

g_difp(data = NULL, col = NULL, ...)

Arguments

data

A callback_stat object.

col

A list of three colors.

...

further arguments passed to or from other methods.

Value

A ggplot2 object

Author(s)

Emmanuel Duguet

Examples

data(labour1)
m <- callback(labour1,"offer","hist","callback","all")
s <- stat_mcr(m)
g_difp(s)


Exclusive callback shares plot

Description

Exclusive callback shares plot

Usage

g_ecs(data = NULL, col = NULL, ...)

Arguments

data

a callback_stat object.

col

A list of four colors.

...

further arguments passed to or from other methods.

Value

A ggplot2 object

Author(s)

Emmanuel Duguet

Examples

data(labour1)
m <- callback(labour1,"offer","hist","callback","all")
s <- stat_ecs(m)
g_ecs(s)


Proportions' comparison plot

Description

Proportions' comparison plot

Usage

g_mcr(data = NULL, col = NULL, ...)

Arguments

data

A callback_stat object.

col

A list of three colors.

...

further arguments passed to or from other methods.

Value

A ggplot2 object

Author(s)

Emmanuel Duguet

Examples

data(labour1)
m <- callback(labour1,"offer","hist","callback","all")
s <- stat_mcr(m)
g_mcr(data = s)


Raw callback rates plot

Description

Raw callback rates plot

Usage

g_raw(data = NULL, col = NULL, ...)

Arguments

data

A callback_stat object.

col

A list of two colors.

...

further arguments passed to or from other methods.

Value

A ggplot2 object

Author(s)

Emmanuel Duguet

Examples

data(origin1)
m <- callback(labour1,"offer","hist","callback","all")
s <- stat_raw(m)
g_raw(s)


Total callback shares plot

Description

Total callback shares plot

Usage

g_tcs(data = NULL, col = NULL, ...)

Arguments

data

a callback_stat object.

col

A list of three colors.

...

further arguments passed to or from other methods.

Value

A ggplot2 object

Author(s)

Emmanuel Duguet

Examples

data(labour1)
m <- callback(labour1,"offer","hist","callback","all")
s <- stat_tcs(m)
g_tcs(s)


Gender/Maternity discrimination (commercial and administrative jobs in the financial sector)

Description

The data were collected in January-March 2002 by Pascale Petit for her PhD thesis (University of Paris I-Panthéon-Sorbonne, 2004). A candidate is defined by the variables ("gender","age","child").

Usage

data(gender1)

Format

A data frame with 942 rows and 14 variables

References

Duguet E., Petit P., 2005. Hiring discrimination in the French financial sector: an econometric analysis on field experiment data. Annals of Economics and Statistics, 78: 79-102.

Petit P., 2007. The effects of age and family constraints on gender hiring discrimination: A field experiment in the French financial sector. Labor Economics, 14: 371-391.


Gender/Maternity discrimination (electricians)

Description

The data were collected by the TEPP team (FR CNRS 2042) between February and July 2015. A candidate is defined by the variables ("gender","educ").

Usage

data(gender2)

Format

A data frame with 564 rows and 15 variables

References

Duguet E., du Parquet L., Petit P. (2022). Extracting the discrimination
components from the callback rates". TEPP Working Paper 2022-15.

Duguet, E., du Parquet, L. & Petit, P. (2022). Révéler les composantes de la discrimination à partir des taux de rappel. Revue française d'économie, XXXVII, 233-268.


Gender/Maternity discrimination (masons)

Description

The data were collected by the TEPP team (FR CNRS 2042) between February and July 2015. A candidate is defined by the variables ("gender","educ").

Usage

data(gender3)

Format

A data frame with 532 rows and 15 variables

References

Duguet E., du Parquet L., Petit P. (2022). Extracting the discrimination components from the callback rates". TEPP Working Paper 2022-15.

Duguet, E., du Parquet, L. & Petit, P. (2022). Révéler les composantes de la discrimination à partir des taux de rappel. Revue française d'économie, XXXVII, 233-268.


Gender/Maternity discrimination (plumbers)

Description

The data were collected by the TEPP team (FR CNRS 2042) between February and July 2015. A candidate is defined by the variables ("gender","educ").

Usage

data(gender4)

Format

A data frame with 1152 rows and 15 variables

References

Duguet E., du Parquet L., Petit P. (2022). Extracting the discrimination components from the callback rates". TEPP Working Paper 2022-15.

Duguet, E., du Parquet, L. & Petit, P. (2022). Révéler les composantes de la discrimination à partir des taux de rappel. Revue française d'économie, XXXVII, 233-268.


Gender/Origin discrimination (software developer)

Description

The data were collected by the TEPP team (FR CNRS 2042) between February and April 2009. A candidate is defined by the variables ("gender","origin").

Usage

data(inter1)

Format

A data frame with 2480 rows and 11 variables

References

Petit P., Duguet E., L'Horty Y., Du Parquet L., Sari F., 2013. Discrimination à l'embauche : les effets du genre et de l'origine se cumulent-ils systématiquement ? Economie et Statistique, 464-465-466: 141-153.

Duguet E., Du Parquet L, L'Horty Y., Petit P., 2015. New Evidence of Ethnic and Gender discriminations in the French Labor Market using experimental data: A ranking extension of responses from correspondence tests. Annals of Economics and Statistics, 117-118: 21-39.


Computational compatibility

Description

Computational compatibility

Usage

is.calc(x)

Arguments

x

A variable name

Value

A logical variable indicating whether the variable can be used for computations (TRUE) or not (FALSE).

Examples

data(origin1)
is.calc(origin1$cartime)
is.calc(origin1$callback)
is.calc(origin1$origin)


Labour market history discrimination (accountants)

Description

The data were collected by the TEPP team (FR CNRS 2042) between February and April 2015. A candidate is defined by the variable "hist".

Usage

data(labour1)

Format

A data frame with 1475 rows and 7 variables

References

Duguet E., Le Gall R., L’Horty Y., Petit P., 2018. How does labour market history influence the access to hiring interviews? International Journal of Manpower, 39(4), 519-533.


Labour market history discrimination (sales assistant)

Description

The data were collected by the TEPP team (FR CNRS 2042) between January and April 2015. A candidate is defined by the variable "hist".

Usage

data(labour2)

Format

A data frame with 1470 rows and 7 variables

References

Duguet E., Le Gall R., L’Horty Y., Petit P., 2018. How does labour market history influence the access to hiring interviews? International Journal of Manpower, 39(4), 519-533.


Gender discrimination and mobility (management controller)

Description

The data were collected by the TEPP team (FR CNRS 2042) between October 2008 and March 2009. A candidate is defined by the variables ("gender", "licenses").

Usage

data(mobility1)

Format

A data frame with 1200 rows and 12 variables

References

Duguet E., du Parquet L., L'Horty Y., Petit P., 2018. Counterproductive hiring discrimination against women: evidence from a French correspondence test. International Journal of Manpower, 39(1): 37-50.


Origin discrimination (accountants)

Description

The data were collected by the TEPP team (FR CNRS 2042) between September and November 2006. A candidate is defined by the variables ("nation","lnation", "fnation"). The variables "educ" and "reput" create sample separations.

Usage

data(origin1)

Format

A data frame with 1097 rows and 20 variables

References

Duguet E., Leandri N., L'Horty Y., Petit P., 2010. Are young French jobseekers of ethnic immigrant origin discriminated against? A controlled experiment in the Paris area. Annals of Economics and Statistics, 99-100: 187-215.


Origin discrimination (waiters)

Description

The data were collected by the TEPP team (FR CNRS 2042) between September and November 2006. A candidate is defined by the variables ("nation","lnation", "fnation"). The variables "educ" and "reput" create sample separations.

Usage

data(origin2)

Format

A data frame with 936 rows and 20 variables

References

Petit P., Duguet E., L'Horty Y., 2015. Discrimination résidentielle et origine ethnique: une étude expérimentale sur les serveurs en Ile de France. Economie et Prevision, 206-207: 55-69.


Plots for callback rates and shares

Description

Plots for callback rates and shares

Usage

## S3 method for class 'callback_stat'
plot(x, col = NULL, dif = TRUE, ...)

Arguments

x

a callback_stat object.

col

A list of four colors.

dif

FALSE for the confidence intervals (the default), TRUE for the difference in proportions

...

further arguments passed to or from other methods.

Value

a ggplot2 object

Author(s)

Emmanuel Duguet

Examples

data(labour1)
m <- callback(labour1,"offer","hist","callback","all")
s <- stat_mcr(m)
plot(s)


Prints the structure of the experiment

Description

Computes the number of tests available for each pair of candidates

Usage

## S3 method for class 'callback'
print(x, ...)

Arguments

x

a stat_paired object.

...

further arguments passed to or from other methods.

Value

Printed output.

Examples

data(labour1)
x <- callback(data=labour1,cluster="offer",candid="hist",callback="callback",
comp = "all")
print(x)

Prints the structure of a component model

Description

Prints the structure of a component model

Usage

## S3 method for class 'callback_comp'
print(x, ...)

Arguments

x

a list with class "callback_comp"

...

further arguments passed to or from other methods.

Value

Printed output.

Author(s)

Emmanuel Duguet

Examples

model <- list(c("license"),c("woman"),c("woman","license","inter"))
print(callback_comp(mobility1,"offer",c("gender","licenses"),"callback",model))

Prints the components of a component model

Description

Prints the components of a component model

Usage

## S3 method for class 'callback_reg'
print(x, ...)

Arguments

x

a list with class "callback_reg"

...

further arguments passed to or from other methods.

Value

Printed output.

Author(s)

Emmanuel Duguet

Examples

model <- list(c("license"),c("woman"),c("woman","license","inter"))
z <- reg(callback_comp(mobility1,"offer",c("gender","licenses"),"callback",model))
print(z)

Prints the callback proportions analysis

Description

Prints the statistics about the callback rates or shares.

Usage

## S3 method for class 'callback_stat'
print(x, digits = 3, ...)

Arguments

x

a callback_stat object.

digits

minimal number of significant digits.

...

further arguments passed to or from other methods.

Value

Printed output.

Examples

data(labour1)
x <- callback(labour1, "offer", "hist", "callback", comp = "all")
print(stat_mcr(x))

Print the callback counts analysis

Description

Computes the callback numbers for each candidate.

Usage

## S3 method for class 'stat_paired'
print(x, ...)

Arguments

x

a stat_paired object.

...

further arguments passed to or from other methods.

Value

Printed output.

Examples

data(labour1)
print(stat_paired(callback(labour1, "offer", "hist", "callback",
comp = "all")))

Generic regression function

Description

Generic regression function

Usage

reg(x, ...)

Arguments

x

A callback_reg object.

...

further arguments passed to or from other methods.


Component model estimation

Description

Component model estimation

Usage

## S3 method for class 'callback_comp'
reg(x, method = "fgls", ...)

Arguments

x

a callback_comp object.

method

estimation method, "ols" or "fgls" (the default).

...

further arguments passed to or from other methods.

Value

a list with class callback_reg containing "config" for the definition of the estimation method and "reg" for the estimation output.

The "config" data frame includes the following elements:

The list "reg" includes the following elements (when relevant):

References

Duguet E., Le Gall R., L'Horty Y., Petit P. (2018). How does the labour market history influence the access to hiring interviews? International Journal of Manpower, 39(4), 519-533, doi: 10.1108/IJM-09-2017-0231.

Examples

model <- list(c("license"),c("woman"),c("woman","license","inter"))
comp <- callback_comp(data = mobility1, cluster = "offer", 
candid = c("gender","licenses"), callback = "callback", model = model)
reg(comp)
summary(reg(comp))


Asymptotic least squares estimation

Description

Asymptotic least squares estimation

Usage

reg_als(x, y, omega, ols = FALSE)

Arguments

x

the matrix of the right-hand variables (incl. the constant term when needed).

y

the vector of the left-hand variable.

omega

the covariance matrix of the disturbances.

ols

logical indicating whether to perform OLS (TRUE) or FGLS (FALSE). The default is FALSE.

Value

a list with class reg_als containing "config" for the definition of the estimation method and "reg" for the estimation output.

The "config" data frame includes the following elements:

The list "reg" includes the following elements (when relevant):

References

Chamberlain, G. (1982). Multivariate regression models for panel data. Journal of econometrics, 18(1), 5-46. Gourieroux, C., Monfort, A., & Trognon, A. (1985). Moindres carrés asymptotiques. Annales de l'INSEE, 91-122. Kodde, D. A., Plam, F. C., & Pfann, G. A. (1990). Asymptotic least‐squares estimation efficiency considerations and applications. Journal of Applied Econometrics, 5(3), 229-243.

Examples

model <- list(c("license"),c("woman"),c("woman","license","inter"))
comp <- callback_comp(mobility1,"offer",c("gender","licenses"),"callback",model)
    x <- comp$aux_boole
    y <- comp$aux_coef
omega <- comp$aux_vcov
 
str(reg_als(x,y,omega))


Sums the numeric or logical columns in a data frame.

Description

Sums the numeric or logical columns in a data frame.

Usage

stat_colsums(x)

Arguments

x

A data frame

Value

A data frame with the column sums, under their original names.

Examples

data(labour1)
s <- callback(labour1,"offer","hist","callback","all")
stat_colsums(s$pfds[["LTC vs STC"]])


Exclusive callback shares

Description

Computes the exclusive callback shares and their confidence intervals. The analysis is restricted to the tests with discrimination cases.

Usage

stat_ecs(x, method = "student", level = 0.95)

Arguments

x

a callback object.

method

estimation method, "cp" for Clopper-Pearson, "wilson" for Wilson and "student" for Student (the default).

level

the level of the confidence intervals (0.95 by default).

Value

A list with class "callback_stat" containing 4 components: specif, counts, props and stats

specif: A list containing

counts: a data frame with the callback counts.

props: A data frame containing the following proportions and their confidence intervals (when relevant)

stats: a data frame containing the statistics for testing the equality of proportions.

Author(s)

Emmanuel Duguet

References

Clopper, C. J. & Pearson, E. S. (1934). The use of confidence or fiducial limits illustrated in the case of the binomial. Biometrika, 26, 404–413. doi:10.2307/2331986.

Student. (1908). The Probable Error of a Mean. Biometrika, 6(1), 1–25. doi:10.2307/2331554.

Wilson, E.B. (1927). Probable inference, the law of succession, and statistical inference. Journal of the American Statistical Association, 22, 209–212. doi:10.2307/2276774.

Examples

data(labour1)
x <- callback(data=labour1,cluster="offer",candid="hist",callback="callback")
str(stat_ecs(x))


Matched callback rates

Description

Computes the matched callback rates, their confidence intervals and performs the equality tests between the candidates.

Usage

stat_mcr(x, method = "student", level = 0.95)

Arguments

x

a callback object.

method

estimation method, "cp" for Clopper-Pearson, "wilson" for Wilson and "student" for Student (the default).

level

the level of the confidence intervals (0.95 by default).

Value

A list with class "callback_stat" containing 4 components: specif, counts, props and stats

specif: A list containing

counts: a data frame with the callback counts.

props: A data frame containing the following proportions and their confidence intervals (when relevant)

stats: a data frame containing the statistics for testing the equality of proportions.

Author(s)

Emmanuel Duguet

References

Clopper, C. J. & Pearson, E. S. (1934). The use of confidence or fiducial limits illustrated in the case of the binomial. Biometrika, 26, 404–413. doi:10.2307/2331986.

Student. (1908). The Probable Error of a Mean. Biometrika, 6(1), 1–25. doi:10.2307/2331554.

Wilson, E.B. (1927). Probable inference, the law of succession, and statistical inference. Journal of the American Statistical Association, 22, 209–212. doi:10.2307/2276774.

Examples

data(labour1)
x <- callback(data=labour1,cluster="offer",candid="hist",callback="callback")
str(stat_mcr(x))


Callback counts on paired data

Description

Computes the callback count statistics from the paired data sets.

Usage

stat_paired(x)

Arguments

x

A callback object.

Value

A list with class "stat_paired" containing two data frames: counts and props.

counts: a data frame with the callback counts.

props: a data frame with the following variables.

Author(s)

Emmanuel Duguet

Examples

data(labour2)
x <- callback(data=labour2,cluster="offer",candid="hist",callback="callback")
stat_paired(x)


Unmatched callback rates

Description

Number and proportion of callbacks for all the candidates.

Usage

stat_raw(x, method = "student", level = 0.95)

Arguments

x

A callback object.

method

estimation method, "cp" for Clopper-Pearson, "wilson" for Wilson and "student" for Student (the default).

level

A number, containing the level of the confidence intervals (0.95 by default).

Value

A callback_stat object with 2 components: specif and props.

specif: A list containing

props: a data frame containing the following variables.

Author(s)

Emmanuel Duguet

References

Clopper, C. J. & Pearson, E. S. (1934). The use of confidence or fiducial limits illustrated in the case of the binomial. Biometrika, 26, 404–413. doi:10.2307/2331986.

Wilson, E.B. (1927). Probable inference, the law of succession, and statistical inference. Journal of the American Statistical Association, 22, 209–212. doi:10.2307/2276774.

Examples

data(labour2)
x <- callback(data=labour2,cluster="offer",candid="hist",callback="callback")
str(stat_raw(x))


Significance code of a p-value

Description

Significance code of a p-value

Usage

stat_signif(p)

Arguments

p

A number between 0 and 1

Value

A character string

Examples

stat_signif(0.045)


Total callback shares

Description

Computes the callback shares and their confidence intervals. The analysis is restricted to the tests with at least one callback. It is the definition used in Riach and Rich (2006).

Usage

stat_tcs(x, method = "student", level = 0.95)

Arguments

x

a callback object.

method

estimation method, "cp" for Clopper-Pearson, "wilson" for Wilson and "student" for Student (the default).

level

the level of the confidence intervals (0.95 by default).

Value

A list with class "callback_stat" containing 4 components: specif, counts, props and stats

specif: A list containing

counts: a data frame with the callback counts.

props: A data frame containing the following proportions and their confidence intervals (when relevant)

stats: a data frame containing the statistics for testing the equality of proportions.

Author(s)

Emmanuel Duguet

References

Clopper, C. J. & Pearson, E. S. (1934). The use of confidence or fiducial limits illustrated in the case of the binomial. Biometrika, 26, 404–413. doi:10.2307/2331986.

Riach, P. A., & Rich, J. (2006). An experimental investigation of sexual discrimination in hiring in the English labor market. The BE Journal of Economic Analysis & Policy, 6(2),

Student. (1908). The Probable Error of a Mean. Biometrika, 6(1), 1–25. doi:10.2307/2331554.

Wilson, E.B. (1927). Probable inference, the law of succession, and statistical inference. Journal of the American Statistical Association, 22, 209–212. doi:10.2307/2276774.

Examples

data(labour1)
x <- callback(data=labour1,cluster="offer",candid="hist",callback="callback")
str(stat_tcs(x))


Prints the regression table of a component model

Description

Prints the regression table of a component model

Usage

## S3 method for class 'callback_reg'
summary(object, ...)

Arguments

object

a list with class "callback_reg".

...

further arguments passed to or from other methods.

Value

Printed output.

Author(s)

Emmanuel Duguet

Examples

model <- list(c("license"),c("woman"),c("woman","license","inter"))
comp <- callback_comp(data = mobility1, cluster = "offer", 
candid = c("gender","licenses"), callback = "callback", model = model)
z <- reg(comp)
summary(z)


Training profile impact (plumbers)

Description

The data were collected by the TEPP team (FR CNRS 2042) in 2011. A candidate is defined by the variables "fname","lname","educ" and "educ_qual" (giving 10 possible cases).

Usage

data(train1)

Format

A data frame with 2167 rows and 22 variables

References

Fremigacci F., L'Horty Y., du Parquet L., Petit P. (2013).L'accès à l'emploi après un CAP ou un baccalauréat professionnel: une évaluation expérimentale dans deux secteurs d'activité. Revue d'économie politique, Vol. 123, No. 3, pp. 353-375. https://www.jstor.org/stable/43860017.


Training profile impact (waiters)

Description

The data were collected by the TEPP team (FR CNRS 2042) in 2011. A candidate is defined by the variables "fname","lname","educ" and "educ_qual" (giving 10 possible cases).

Usage

data(train2)

Format

A data frame with 3552 rows and 29 variables

References

Fremigacci F., L'Horty Y., du Parquet L., Petit P. (2013).L'accès à l'emploi après un CAP ou un baccalauréat professionnel: une évaluation expérimentale dans deux secteurs d'activité. Revue d'économie politique, Vol. 123, No. 3, pp. 353-375. https://www.jstor.org/stable/43860017.