| residuals.frontier {frontier} | R Documentation |
This method returns the residuals from stochastic frontier models
estimated with sfa or frontier.
## S3 method for class 'frontier': residuals( object, asInData = FALSE, ... )
object |
a stochastic frontier model
returned by frontier. |
asInData |
logical. If TRUE,
the residuals are returned in the same order
as the corresponding observations in the data set
used for the estimation
(see section ‘value’ below). |
... |
currently ignored. |
If argument asInData is FALSE (default),
a matrix of the residuals is returned,
where each row corresponds to a firm (cross-section unit)
and each column corresponds to a time period.
If argument asInData is TRUE,
a vector of residuals is returned,
where the residuals are in the same order
as the corresponding observations in the data set
used for the estimation.
Arne Henningsen
# rice producers in the Philippines (panel data)
data( riceProdPhil )
riceProdPhil <- plm.data( riceProdPhil, c( "FMERCODE", "YEARDUM" ) )
# Error Components Frontier (Battese & Coelli 1992), no time effect
rice <- sfa( log( PROD ) ~ log( AREA ) + log( LABOR ) + log( NPK ),
data = riceProdPhil )
residuals( rice )
riceProdPhil$residuals <- residuals( rice, asInData = TRUE )
# Error Components Frontier (Battese & Coelli 1992), with time effect
riceTime <- sfa( log( PROD ) ~ log( AREA ) + log( LABOR ) + log( NPK ),
data = riceProdPhil, timeEffect = TRUE )
residuals( riceTime )
riceProdPhil$residualsTime <- residuals( riceTime, asInData = TRUE )