Hi 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. Thanks, Rainer --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) | > dat1 <- front41Data[1:30,] | > dat2 <- front41Data[30:60,] | > x1 <- sfa(log(output) ~ log(capital), data=dat1) | > x2 <- sfa(log(output) ~ log(capital), data=dat2) | Warning message: | In sfa(log(output) ~ log(capital), data = dat2) : the parameter | 'gamma' is close to the boundary of the parameter space [0,1]: this | can cause convergence problems and can negatively affect the validity | and reliability of statistical tests and might be caused by model | misspecification | > x1 | | Call: | sfa(formula = log(output) ~ log(capital), data = dat1) | | Maximum likelihood estimates | (Intercept) log(capital) sigmaSq gamma | 2.8646 0.2642 0.4364 0.8243 | > x2 | | Call: | sfa(formula = log(output) ~ log(capital), data = dat2) | | Maximum likelihood estimates | (Intercept) log(capital) sigmaSq gamma | 2.7035 0.4550 0.9736 0.9972 | > | > anova(x1, x2) | Error in UseMethod("anova") : | no applicable method for 'anova' applied to an object of class "frontier" `---- Footnotes: [1] http://stats.stackexchange.com/questions/117319/comparing-coefficients-of-linear-stochastic-frontier-production-and-cost-funct -- Rainer M. Krug email: Rainer<at>krugs<dot>de PGP: 0x0F52F982
pgp2kBr_N08zn.pgp
Description: PGP signature
______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.