# Cobb-Douglas production function for the apple data set
# First compute the total production
apples <- apples %>% mutate(prod = apples + otherprod)
# unconstrained linear model
cd <- lm(log(prod) ~ log(capital) + log(labor) +
log(materials), apples)
# constrained linear model imposing constant
# return to scales
crs <- clm(cd, R = matrix(c(0, 1, 1, 1), nrow = 1),
q = 1)
Run the code above in your browser using DataLab