README

This replication package provides the code for replicating 
the empirical analysis that is presented in the paper 
"A Ray-Based Input Distance Function to Model Zero-Valued Output 
Quantities: Derivation and an Empirical Application"
authored by Juan José Price and Arne Henningsen
and forthcoming in the Journal of Productivity Analysis.
We conducted the empirical analysis with the "R" statistical software
(version 4.3.0) using the add-on packages "combinat" (version 0.0.8), 
"miscTools" (version 0.6.28), "quadprog" (version 1.5.8),
sfaR (version 1.0.0), stargazer (version 5.2.3),
and "xtable" (version 1.8.4) that are available at CRAN.
We created the R package "micEconDistRay" that provides the functions
for empirical analyses with ray-based input distance functions
that we developed for the above-mentioned paper. Also this R package 
is available at CRAN (https://cran.r-project.org/package=micEconDistRay).

This replication package contains the following files and folders:

* README
This file

* MuseumsDk.csv
The original data obtained from the Danish Ministry of Culture and 
from Statistics Denmark. It includes the following variables:
- museum: Name of the museum.
- type: Type of museum 
  (Kulturhistorisk museum = cultural history museum;
  Kunstmuseer = arts museum;
  Naturhistorisk museum = natural history museum;
  Blandet museum = mixed museum).
- munic: Municipality, in which the museum is located.
- yr: Year of the observation.
- units: Number of visit sites.
- resp: Whether or not the museum has special responsibilities
  (0 = no special responsibilities; 1 = at least one special responsibility).
- vis: Number of (physical) visitors.
- aarc: Number of articles published (archeology).
- ach: Number of articles published (cultural history).
- aah: Number of articles published (art history).
- anh: Number of articles published (natural history).
- exh: Number of temporary exhibitions.
- edu: Number of primary school classes on educational visits to the museum.
- ev: Number of events other than exhibitions.
- ftesc: Scientific labor (full-time equivalents).
- ftensc: Non-scientific labor (full-time equivalents).
- expProperty: Running and maintenance costs [1,000 DKK].
- expCons: Conservation expenditure [1,000 DKK].
- ipc: Consumer Price Index in Denmark 
  (the value for year 2014 is set to 1).

* prepare_data.R
This R script imports the data set MuseumsDk.csv, prepares it 
for the empirical analysis (e.g., removing unsuitable observations,
preparing variables), and saves the resulting data set 
as DataPrepared.csv.

* DataPrepared.csv
This data set is prepared and saved by the R script prepare_data.R.
It is used for the empirical analysis.

* make_table_descriptive.R
This R script imports the data set DataPrepared.csv and creates the 
LaTeX table /tables/table_descriptive.tex, which provides summary 
statistics of the variables that are used in the empirical analysis.

* IO_Ray.R
This R script imports the data set DataPrepared.csv, estimates  
a ray-based Translog input distance functions with the 'optimal' 
ordering of outputs, imposes monotonicity on this distance function,
creates the LaTeX table /tables/idfRes.tex that presents the estimated 
parameters of this function, and creates several figures in the folder 
/figures/ that illustrate the results.

* IO_Ray_ordering_outputs.R
This R script imports the data set DataPrepared.csv, estimates  
a ray-based Translog input distance functions, imposes monotonicity
for each of the 720 possible orderings of the outputs, and saves all the
estimation results as (a huge) R object allOrderings.rds.

* allOrderings.rds (not included in the ZIP file, uploaded separately)
This is a saved R object created by the R script IO_Ray_ordering_outputs.R
that contains the estimated ray-based Translog input distance functions
(with and without monotonicity imposed) for each of the 720 possible orderings.

* IO_Ray_model_averaging.R
This R script loads the R object allOrderings.rds that contains the estimated
ray-based Translog input distance functions for each of the 720 possible 
orderings, does model averaging, and creates several figures in the folder 
/figures/ that illustrate the results.

* /tables/
This folder contains the two LaTeX tables table_descriptive.tex and
idfRes.tex (created by R scripts make_table_descriptive.R and IO_Ray.R, 
respectively) that provide summary statistics of the data set and 
the estimated parameters (without and with monotonicity imposed)
for the 'optimal' ordering of outputs.

* /figures/
This folder contains 48 figures (created by the R scripts IO_Ray.R and
IO_Ray_model_averaging.R) that illustrate the results obtained with the
'optimal' ordering of outputs and the model-averaged results and that
compare these two sets of results.
