
Last chance! 50% off unlimited learning
Sale ends in
aidsCalc( priceNames, totExpName, data = NULL, px = "TL", lnp = NULL,
coef = NULL, alpha0 = ifelse( is.null( coef$alpha0 ), 0,
coef$alpha0 ) )
aidsPx
).px
' is not 'TL').aidsCalc
returns a list with following elements:aidsEst
, aidsPx
data( Blanciforti86 )
# Data on food consumption are available only for the first 32 years
Blanciforti86 <- Blanciforti86[ 1:32, ]
priceNames <- c( "pFood1", "pFood2", "pFood3", "pFood4" )
shareNames <- c( "wFood1", "wFood2", "wFood3", "wFood4" )
## LA-AIDS
estResult <- aidsEst( priceNames, shareNames, "xFood",
data = Blanciforti86, method = "LA:L" )
lnp <- aidsPx( "L", priceNames, shareNames, Blanciforti86 )
fitted <- aidsCalc( priceNames, "xFood", Blanciforti86,
coef = estResult$coef, lnp = lnp )
fitted$shares # equal to estResult$wFitted
fitted$quant # equal to estResult$qFitted
## AIDS
estResult <- aidsEst( priceNames, shareNames, "xFood",
data = Blanciforti86, method = "IL:L" )
fitted <- aidsCalc( priceNames, "xFood", Blanciforti86,
coef = estResult$coef )
fitted$shares # equal to estResult$wFitted
fitted$quant # equal to estResult$qFitted
Run the code above in your browser using DataLab