vcov: Compute variance-covariance matrix of stochastic frontier...

vcovR Documentation

Compute variance-covariance matrix of stochastic frontier models

Description

vcov computes the variance-covariance matrix of the maximum likelihood (ML) coefficients from stochastic frontier models estimated with sfacross, sfalcmcross, or sfaselectioncross.

Usage

## S3 method for class 'sfacross'
vcov(object, extraPar = FALSE, ...)

## S3 method for class 'sfalcmcross'
vcov(object, ...)

## S3 method for class 'sfaselectioncross'
vcov(object, extraPar = FALSE, ...)

Arguments

object

A stochastic frontier model returned by sfacross, sfalcmcross, or sfaselectioncross.

extraPar

Logical. Only available for non heteroscedastic models returned by sfacross and sfaselectioncross. Default = FALSE. If TRUE, variances and covariances of additional parameters are returned:

sigmaSq = sigmauSq + sigmavSq

lambdaSq = sigmauSq/sigmavSq

sigmauSq = \exp{(Wu)} = \exp{(\bm{\delta} \mathbf{Z}_u)}

sigmavSq = \exp{(Wv)} = \exp{(\bm{\phi} \mathbf{Z}_v)}

sigma = sigmaSq^0.5

lambda = lambdaSq^0.5

sigmau = sigmauSq^0.5

sigmav = sigmavSq^0.5

gamma = sigmauSq/(sigmauSq + sigmavSq)

...

Currently ignored

Details

The variance-covariance matrix is obtained by the inversion of the negative Hessian matrix. Depending on the distribution and the 'hessianType' option, the analytical/numeric Hessian or the bhhh Hessian is evaluated.

The argument extraPar, is currently available only for objects of class 'sfacross' and 'sfaselectioncross'. When 'extraPar = TRUE', the variance-covariance of the additional parameters is obtained using the delta method.

Value

The variance-covariance matrix of the maximum likelihood coefficients is returned.

See Also

sfacross, for the stochastic frontier analysis model fitting function using cross-sectional or pooled data.

sfalcmcross, for the latent class stochastic frontier analysis model fitting function using cross-sectional or pooled data.

sfaselectioncross for sample selection in stochastic frontier model fitting function using cross-sectional data.

Examples


## Using data on Spanish dairy farms
# Cobb Douglas (production function) half normal distribution
cb_s_h <- sfacross(formula = YIT ~ X1 + X2 + X3 + X4, udist = 'hnormal',
data = dairyspain, S = 1, method = 'bfgs')
vcov(cb_s_h)
vcov(cb_s_h, extraPar = TRUE)
 
# Other variance-covariance matrices can be obtained using the sandwich package
 
# Robust variance-covariance matrix
 
requireNamespace('sandwich', quietly = TRUE)
 
sandwich::vcovCL(cb_s_h)
 
# Coefficients and standard errors can be obtained using lmtest package
 
requireNamespace('lmtest', quietly = TRUE)
 
lmtest::coeftest(cb_s_h, vcov. = sandwich::vcovCL)
 
# Clustered standard errors
 
lmtest::coeftest(cb_s_h, vcov. = sandwich::vcovCL, cluster = ~ FARM)
 
# Doubly clustered standard errors
 
lmtest::coeftest(cb_s_h, vcov. = sandwich::vcovCL, cluster = ~ FARM + YEAR)
 
# BHHH standard errors
 
lmtest::coeftest(cb_s_h, vcov. = sandwich::vcovOPG)
 
# Adjusted BHHH standard errors
 
lmtest::coeftest(cb_s_h, vcov. = sandwich::vcovOPG, adjust = TRUE)

## Using data on eighty-two countries production (GDP)
# LCM Cobb Douglas (production function) half normal distribution
cb_2c_h <- sfalcmcross(formula = ly ~ lk + ll + yr, udist = 'hnormal',
data = worldprod, uhet = ~ initStat, S = 1)
vcov(cb_2c_h)


sfaR documentation built on Oct. 29, 2024, 9:07 a.m.