Learn R Programming

micEcon (version 0.1-3)

aidsCalc: Shares and Quantities of the Almost Ideal Demand System

Description

Given prices, total expenditure and coefficients this function calculates the demanded expenditure shares and quantities based on the Almost Ideal Demand System.

Usage

aidsCalc( pNames, xtName, data = NULL, px = "TL", lnp = NULL,
      coef = NULL, alpha0 = ifelse( is.null( coef$alpha0 ), 0, coef$alpha0 ) )

Arguments

pNames
vector containing the names of the prices.
xtName
name of the total expenditure variable.
data
data frame containing the variables.
px
prices index (see aidsPx)
lnp
log of the price index.
coef
a list containing the coefficients alpha, beta and gamma.
alpha0
coefficient $\alpha_0$ in the translog price index.

Value

  • aidsCalc returns a list with following elements:
  • sharesa data frame containing the calculated expenditure shares
  • quantitiesa data frame containing the calculated quantites

References

Deaton, A.S. and J. Muellbauer (1980) An Almost Ideal Demand System. American Economic Review, 70, p. 312-326.

See Also

aidsEst, aidsPx

Examples

Run this code
data( Blanciforti86 )
   pNames <- c( "pFood1", "pFood2", "pFood3", "pFood4" )
   wNames <- c( "wFood1", "wFood2", "wFood3", "wFood4" )

   ## LA-AIDS
   estResult <- aidsEst( pNames, wNames, "xFood",
      data = Blanciforti86, method = "LA:L" )

   lnp <- aidsPx( "L", pNames, wNames, Blanciforti86 )

   fitted <- aidsCalc( pNames, "xFood", Blanciforti86,
      coef = estResult$coef, lnp = lnp )

   fitted$shares  # equal to estResult$wFitted
   fitted$quant   # equal to estResult$qFitted

   ## AIDS
   estResult <- aidsEst( pNames, wNames, "xFood",
      data = Blanciforti86, method = "MK:L" )

   fitted <- aidsCalc( pNames, "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