Description Usage Arguments Value Author(s) References See Also Examples
These functions calculate the utility level given prices and total expenditure using the indirect utility function of the Almost Ideal Demand System and the partial derivatives of this indirect utility function with repect to prices and total expenditure.
1 2 3 | aidsUtility( priceNames, totExpName, coef, data )
aidsUtilityDeriv( priceNames, totExpName, coef, data, rel = FALSE )
|
priceNames |
a vector of strings containing the names of the prices. |
totExpName |
a string containing the variable name of total expenditure. |
coef |
a list containing the coefficients in elements alpha0 (scalar), alpha (vector), beta (vector), gamma (matrix), and possibly beta0 (scalar, if not given, it is assumed to be 1). |
data |
a data frame containing the data. |
rel |
logical. If |
aidsUtility
returns a numeric vector
that contains the utility levels;
aidsUtilityDeriv
returns a data.frame
that contains the partial derivatives
of the indirect utility function
with repect to prices and total expenditure.
Arne Henningsen
Deaton, A.S. and J. Muellbauer (1980) An Almost Ideal Demand System. American Economic Review, 70, p. 312-326.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | 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" )
## estimate the (non-linear) AIDS
estResult <- aidsEst( priceNames, shareNames, "xFood",
data = Blanciforti86, method = "IL" )
# calculate the utility levels of each year
utility <- aidsUtility( priceNames, "xFood", coef = coef( estResult ),
data = Blanciforti86 )
utilityDeriv <- aidsUtilityDeriv( priceNames, "xFood",
coef = coef( estResult ), data = Blanciforti86 )
utilityEla <- aidsUtilityDeriv( priceNames, "xFood",
coef = coef( estResult ), data = Blanciforti86, rel = TRUE )
|
Loading required package: lmtest
Loading required package: zoo
Attaching package: 'zoo'
The following objects are masked from 'package:base':
as.Date, as.Date.numeric
Loading required package: micEcon
If you have questions, suggestions, or comments regarding one of the 'micEcon' packages, please use a forum or 'tracker' at micEcon's R-Forge site:
https://r-forge.r-project.org/projects/micecon/
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.