The good news is that in this lecture we are going to take a bit of a break from only discussing theory and will apply what we’ve discussed this far. To date all of the production functions that you’ve seen are so called engineering production functions in the sense that they all relate to a specific production process. Going forward we will pivot to inter-firm production functions which will enable us to compare firms with each other. To this end we will make extensive use of Henningsen’s (2018) Introduction to Econometric Production Analysis with R (Second Version). The data that we will be using for this section of the work was collected by Ivaldi et al. (1996) and consists of a cross-sectional production data set of 140 French apple producers from the year 1986. Each line of the dataset represents a different producer and covers the following variables:
vCap costs of capital (including land)
vLab costs of labour (including remuneration of unpaid family labour)
vMat costs of intermediate materials (e.g. seedlings, fertilizer, pesticides, fuel)
qApples quantity index of apple output
qOtherOut quantity index of other outputs
qOut quantity index of all outputs (apples and other outputs)
pCap price index of capital goods
pLab price index of labour
pMat price index of materials
pOut price index of the aggregate output
adv use of advisory service i.e. extension
qCap quantity of capital used
qLab quantity of labour used
qMat quantity of materials used
Note that several of the variables are transformed to indices. This simply means that they do not represent the actual values but rather a transformed version thereof to make it independent of measurement units. Thus they represent the relative units and not the actuals.
Download the data and save it in the Data folder of your R project for this course. Also download Henningsen’s book and save it in the Supporting materials folder. Import the data into R and work through the dataset along with Henningsen, starting on page 32 and 33, and thereafter from page 49 to 93. Hereafter you will have to analyse a dataset as part of your homework. Note that Henningsen do not use the data.table and ggplot packages. I recommend that you do use them but its up to you. To illustrate the difference, lets work through the first couple of examples together.
remove(list=ls()) #clear all from memory
require("data.table")
## Loading required package: data.table
require("ggplot2")
## Loading required package: ggplot2
dat <- setDT(read.csv("Data/apples_prepped.csv"))
#Calculation of total costs
#this is how Henningsen does it:
dat$cost <- with( dat, vCap + vLab + vMat )
#this is how I would do it
dat[, cost := vCap + vLab + vMat]
dat #lets have a look at the data
## X vCap vLab vMat qApples qOtherOut qOut pCap
## 1: 3.8485029 452146 1157608 994214 37.981529 3.760305 24210263.8 2.143822
## 2: 4.9781309 351351 1682201 1523776 35.201897 0.762395 20859289.2 0.807736
## 3: 1.8041589 182140 531956 317932 20.007357 1.116390 12251773.1 2.272612
## 4: 2.4070193 199501 581074 515592 19.887671 0.549471 11853542.1 0.512113
## 5: 2.2643984 293274 698029 507115 17.445820 0.374599 10335842.9 2.109772
## ---
## 136: 1.0231861 164978 386819 211407 0.018314 3.035876 1771430.2 1.828745
## 137: 0.3261538 35067 114120 28789 0.012209 0.169246 105243.9 1.866267
## 138: 0.5136403 26699 148599 48639 0.004070 0.442728 259142.8 0.759003
## 139: 0.4581785 25010 147750 80211 0.002035 1.062580 617476.7 1.002012
## 140: 0.9159727 92771 140435 195406 0.000610 0.651362 378143.8 0.971251
## pLab pMat pOut adv qCap qLab qMat cost
## 1: 1.081609 8.147002 2.7571547 0 210906.51 1070264.8 122034.335 2603968
## 2: 1.313335 11.582322 1.9946057 0 434982.48 1280862.1 131560.492 3557328
## 3: 0.953811 5.578166 2.4387073 1 80145.66 557716.4 56995.794 1032028
## 4: 1.239626 8.127554 1.0603798 0 389564.43 468749.4 63437.537 1296167
## 5: 0.997413 8.540845 1.9533246 0 139007.44 699839.5 59375.273 1498418
## ---
## 136: 1.572537 7.084576 0.8788172 1 90213.78 245984.0 29840.459 763204
## 137: 0.962492 5.077759 0.8262980 0 18789.92 118567.2 5669.627 177976
## 138: 1.159003 3.068043 0.8253056 0 35176.41 128212.8 15853.428 223937
## 139: 1.209600 5.759208 0.8191133 1 24959.78 122147.8 13927.435 252971
## 140: 1.245466 4.248687 0.7926813 0 95517.02 112757.0 45992.093 428612
#Calculation of variable costs
#this is how Henningsen does it:
dat$vcost <- with( dat, vLab + vMat )
#this is how I would do it
dat[, vcost := vLab + vMat]
# Calculation of profit
#this is how Henningsen does it:
dat$profit <- with( dat, pOut * qOut - cost )
#this is how I would do it
dat[, profit := pOut * qOut - cost]
# Calculation of gross margin (also called variable profit)
#this is how Henningsen does it:
dat$vprofit <- with( dat, pOut * qOut - vLab - vMat)
#this is how I would do it
dat[, vprofit := pOut * qOut - vLab - vMat]