# just a stupid simple example
snqProfitEla( matrix(101:109,3,3), c(1,1,1), c(1,-1,-1), c(0.4,0.3,0.3) )
# now with real data
data( germanFarms )
germanFarms$qOutput <- germanFarms$vOutput / germanFarms$pOutput
germanFarms$qVarInput <- -germanFarms$vVarInput / germanFarms$pVarInput
germanFarms$qLabor <- -germanFarms$qLabor
germanFarms$time <- c( 0:19 )
pNames <- c( "pOutput", "pVarInput", "pLabor" )
qNames <- c( "qOutput", "qVarInput", "qLabor" )
estResult <- snqProfitEst( pNames, qNames, c("land","time"), data=germanFarms )
estResult$ela # price elasticities at mean prices and mean quantities
# price elasticities at the last observation (1994/95)
snqProfitEla( estResult$coef$beta, estResult$estData[ 20, pNames ],
estResult$estData[ 20, qNames ], estResult$weights )
Run the code above in your browser using DataLab