clm | R Documentation |
Compute the least squares estimator using linear constrains on the coefficients.
clm(x, R, q = NULL)
## S3 method for class 'clm'
vcov(object, ...)
## S3 method for class 'clm'
summary(object, ...)
x |
a linear model fitted by |
R |
a matrix of constrains (one line for each constrain, one column for each coefficient), |
q |
an optional vector of rhs values (by default a vector of 0) |
object |
a |
... |
further arguments |
an object of class clm
which inherits from class lm
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.