priceIndex              package:micEcon              R Documentation

_C_a_l_c_u_l_a_t_e _P_r_i_c_e _I_n_d_i_c_e_s

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

     Calculates a Laspeyres, Paasche or Fisher price index.

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

        priceIndex( prices, quantities, base, data, method = "Laspeyres",
           na.rm = FALSE, na.0 = FALSE )

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

  prices: Vector that contains the names of the prices.

quantities: Vector that contains the names of the quantities that
          belong to the 'prices'.

    base: The base period(s) to calculate the indices (see details).

    data: Dataframe that contains the prices and quantities.

  method: Which price index: "Laspeyres", "Paasche" or "Fisher".

   na.rm: a logical value passed to ''mean()'' when calculating the
          'base'.

    na.0: logical. Setting all NA values to 0 (after calculating the
          base)?

_D_e_t_a_i_l_s:

     The argument 'base' can be either 
      (a) a single number: the row number of the base prices and
     quantities, 
      (b) a vector indicating several observations: The means of these
     observations are used as base prices and quantities, or 
      (c) a logical vector with the same length as the 'data': The
     means of the observations indicated as 'TRUE' are used as base
     prices and quantities.

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

     a vector containing the price indices.

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

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

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

     'quantityIndex'.

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

        data( Missong77 )
        # Laspeyres Price Indices
        priceIndex( c( "p.beef", "p.veal", "p.pork" ),
           c( "q.beef", "q.veal", "q.pork" ), 1, Missong77 )
        # Paasche Price Indices
        priceIndex( c( "p.beef", "p.veal", "p.pork" ),
           c( "q.beef", "q.veal", "q.pork" ), 1, Missong77, "Paasche" )

        data( Bleymueller251 )
        # Laspeyres Price Indices
        priceIndex( c( "p.A", "p.B", "p.C", "p.D" ), c("q.A", "q.B", "q.C", "q.D" ),
           1, Bleymueller251 )
        # Paasche Price Indices
        priceIndex( c( "p.A", "p.B", "p.C", "p.D" ), c("q.A", "q.B", "q.C", "q.D" ),
           1, Bleymueller251, "Paasche" )

