View source: R/cobbDouglasCalc.R
cobbDouglasCalc | R Documentation |
Calculate the dependent variable of a Cobb-Douglas function.
cobbDouglasCalc( xNames, data, coef, coefCov = NULL, dataLogged = FALSE )
xNames |
a vector of strings containing the names of the independent variables. |
data |
data frame containing the data. |
coef |
vector containing the coefficients:
if the elements of the vector have no names,
the first element is taken as intercept of the logged equation
and the following elements are taken as coefficients of
the independent variables defined in argument |
coefCov |
optional covariance matrix of the coefficients
(the order of the rows and columns must correspond
to the order of the coefficients in argument |
dataLogged |
logical. Are the values in |
A vector containing the endogenous variable.
If the inputs are provided as logarithmic values
(argument dataLogged
is TRUE
),
the endogenous variable is returned as logarithm;
non-logarithmic values are returned otherwise.
If argument coefCov
is specified,
the returned vector has an attribute "variance"
that is a vector containing the variances
of the calculated (fitted) endogenous variable.
Arne Henningsen
translogCalc
, cobbDouglasOpt
.
data( germanFarms ) # output quantity: germanFarms$qOutput <- germanFarms$vOutput / germanFarms$pOutput # quantity of variable inputs germanFarms$qVarInput <- germanFarms$vVarInput / germanFarms$pVarInput # a time trend to account for technical progress: germanFarms$time <- c(1:20) # estimate a Cobb-Douglas production function estResult <- translogEst( "qOutput", c( "qLabor", "land", "qVarInput", "time" ), germanFarms, linear = TRUE ) # fitted values fitted <- cobbDouglasCalc( c( "qLabor", "land", "qVarInput", "time" ), germanFarms, coef( estResult )[ 1:5 ] ) #equal to estResult$fitted # fitted values and their variances fitted2 <- cobbDouglasCalc( c( "qLabor", "land", "qVarInput", "time" ), germanFarms, coef( estResult )[ 1:5 ], coefCov = vcov( estResult )[ 1:5, 1:5 ] ) # t-values c( fitted2 ) / attributes( fitted2 )$variance^0.5
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.