aidsCalc               package:micEcon               R Documentation

_S_h_a_r_e_s _a_n_d _Q_u_a_n_t_i_t_i_e_s _o_f _t_h_e _A_l_m_o_s_t _I_d_e_a_l _D_e_m_a_n_d _S_y_s_t_e_m

_D_e_s_c_r_i_p_t_i_o_n:

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

_U_s_a_g_e:

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

_A_r_g_u_m_e_n_t_s:

  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.

_V_a_l_u_e:

     'aidsCalc' returns a list with following elements: 

  shares: a data frame containing the calculated expenditure shares

quantities: a data frame containing the calculated quantites

_A_u_t_h_o_r(_s):

     Arne Henningsen ahenningsen@agric-econ.uni-kiel.de

_R_e_f_e_r_e_n_c_e_s:

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

_S_e_e _A_l_s_o:

     'aidsEst', 'aidsPx'

_E_x_a_m_p_l_e_s:

        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

