[R] comparing two "half-normal production" stochastic frontier functions
Arne Henningsen
arne.henningsen at gmail.com
Sat Oct 4 06:59:45 CEST 2014
Dear Rainer
On 3 October 2014 14:51, Rainer M Krug <Rainer at krugs.de> wrote:
> I am using the function frontier::sfa (from the package frontier) to
> estimate several "half-normal production" stochastic frontier functions.
>
> Now I want to compare the coefficients of the linear frontier function
> and see if they are different.
>
> According to my stackexchange (CrossValidated) question [1] I can
> compare these as I can compare a normal linear regression.
>
> In R, I would uswe the function anova to do this model comparison -
> correct?
>
> Now this function does not accept objects of the type 'frontier' - so
> how can I do this comparison in R?
>
> To re-iterate, I want to know if the coefficients of the frontier line
> (slope and intercept) are significantly different.
>
> Below please find a reproducible example based on data provided in the
> package, of what I did, and below the transcript.
>
> --8<---------------cut here---------------start------------->8---
> library(frontier)
> data(front41Data)
> dat1 <- front41Data[1:30,]
> dat2 <- front41Data[30:60,]
> x1 <- sfa(log(output) ~ log(capital), data=dat1)
> x2 <- sfa(log(output) ~ log(capital), data=dat2)
> x1
> x2
> anova(x1, x2
> --8<---------------cut here---------------end--------------->8---
library( "frontier" )
data( "front41Data" )
# estimate pooled model
mp <- sfa( log(output) ~ log(capital), data = front41Data )
# create a dummy variable
front41Data$dum <- rep( c( 1, 0 ), 30 )
# estimate model with different intercepts and different slopes
# but the same sigmsSq and the same gamma
md <- sfa( log(output) ~ log(capital)*dum, data = front41Data )
# likelihood ratio test
lrtest( mp, md )
If you have further questions regarding the frontier package, you may
also use the "help" forum at frontier's R-Forge site:
https://r-forge.r-project.org/projects/frontier/
...and please do not forget to cite the frontier package in your
publications (see output of the R command 'citation("frontier")').
Best regards,
Arne
--
Arne Henningsen
http://www.arne-henningsen.name
More information about the R-help
mailing list