make_deadata: make_deadata

View source: R/make_deadata.R

make_deadataR Documentation

make_deadata

Description

This function creates, from a data frame, a deadata structure, which is as list with fields input, output, dmunames, nc_inputs, nc_outputs, nd_inputs, nd_outputs.

Usage

make_deadata(datadea = NULL,
          ni = NULL,
          no = NULL,
          dmus = 1,
          inputs = NULL,
          outputs = NULL,
          nc_inputs = NULL,
          nc_outputs = NULL,
          nd_inputs = NULL,
          nd_outputs = NULL,
          ud_inputs = NULL, 
          ud_outputs = NULL)

Arguments

datadea

Data frame with DEA data.

ni

Number of inputs, if inputs are in columns 2:(ni + 1) (if DMUs are in the first column) or 1:ni (no DMUs column).

no

Number of outputs, if outputs are in columns (ni + 2):(ni + no + 1) (if DMUs are in the first column) or (ni + 1):(ni + no) (no DMUs column). If not specified, DMUs are in the first column.

dmus

Column (number or name) of DMUs (optional). By default, it is the first column. If there is not any DMU column, then it must be NULL.

inputs

Columns (numbers or names) of inputs (optional). It prevails over ni. Alternatively to datadea, it can be a matrix with the inputs (DMUs in columns). In this case, DMUs names are taken from the columns names.

outputs

Columns (numbers or names) of outputs (optional). It prevails over no. Alternatively to datadea, it can be a matrix with the outputs (DMUs in columns).

nc_inputs

A numeric vector containing the indices of non-controllable inputs.

nc_outputs

A numeric vector containing the indices of non-controllable outputs.

nd_inputs

A numeric vector containing the indices of non-discretionary inputs.

nd_outputs

A numeric vector containing the indices of non-discretionary outputs.

ud_inputs

A numeric vector containing the indices of undesirable (good) inputs.

ud_outputs

A numeric vector containing the indices of undesirable (bad) outputs.

Value

An object of class deadata

Author(s)

Vicente Coll-Serrano (vicente.coll@uv.es). Quantitative Methods for Measuring Culture (MC2). Applied Economics.

Vicente Bolós (vicente.bolos@uv.es). Department of Business Mathematics

Rafael Benítez (rafael.suarez@uv.es). Department of Business Mathematics

University of Valencia (Spain)

Examples

data("Coll_Blasco_2006")
data_example <- make_deadata(datadea = Coll_Blasco_2006,
                             ni = 2, 
                             no = 2)
# This is the same as:
data_example <- make_deadata(Coll_Blasco_2006,
                             inputs = 2:3, 
                             outputs = 4:5)
# And the same as:
dmunames <- c("A", "B", "C", "D", "E", "F")
nd <- length(dmunames) # Number of DMUs
inputnames <- c("Employees", "Capital")
ni <- length(inputnames) # Number of Inputs
outputnames <- c("Vehicles", "Orders")
no <- length(outputnames) # Number of Outputs
inputs <- matrix(c(8, 8, 11, 15, 14, 12, 12, 13, 11, 18, 18, 20),
                 nrow = ni, ncol = nd, dimnames = list(inputnames, dmunames))
outputs <- matrix(c(14, 20, 25, 42, 8, 30, 25, 8, 40, 22, 24, 30),
                  nrow = no, ncol = nd, dimnames = list(outputnames, dmunames))
data_example <- make_deadata(inputs = inputs,
                             outputs = outputs)                
# If the first input is a non-controllable input:
data_example <- make_deadata(Coll_Blasco_2006,
                             inputs = 2:3,
                             outputs = 4:5, 
                             nc_inputs = 1)
# If the second output is a non-discretionary output:
data_example <- make_deadata(Coll_Blasco_2006,
                             inputs = 2:3, 
                             outputs = 4:5, 
                             nd_outputs = 2)
# If the second input is a non-discretionary input and the second output is an undesirable:
data_example <- make_deadata(Coll_Blasco_2006,
                             inputs = 2:3, 
                             outputs = 4:5, 
                             nd_inputs = 2, 
                             ud_outputs = 2)


deaR documentation built on May 2, 2023, 5:13 p.m.

Related to make_deadata in deaR...