Description Usage Arguments Details Value Author(s) References See Also Examples
These functions calculate and print the demand elasticities of an AIDS model.
1 2 3 4 5 6 7 8 9 | aidsElas( coef, prices = NULL, shares = NULL, totExp = NULL,
method = "AIDS", priceIndex = "TL", basePrices = NULL, baseShares = NULL,
quantNames = NULL, priceNames = NULL, coefCov = NULL, df = NULL )
## S3 method for class 'aidsEst'
elas( object, method = NULL, observedShares = FALSE, ... )
## S3 method for class 'aidsElas'
print( x, ... )
|
coef |
a list containing the coefficients alpha, beta and gamma. |
prices |
a vector of the prices at which the elasticities should be calculated. |
shares |
a vector of the shares at which the elasticities should be calculated. |
totExp |
total expenditure at which the elasticities should be calculated. |
method |
the elasticity formula to be used (see details). |
priceIndex |
the price index (see details). |
basePrices |
a vector specifying the base prices for the Paasche, Laspeyres, and Tornqvist price index. |
baseShares |
a vector specifying the base expenditure shares for the Laspeyres, simplified Laspeyres, and Tornqvist index. |
quantNames |
an optional vector of strings containing the names of the quantities to label elasticities. |
priceNames |
an optional vector of strings containing the names of the prices to label elasticities. |
coefCov |
variance covariance matrix of the coefficients (optional). |
df |
degrees of freedom to calculate P-values of the elasticities (optional). |
object |
an object of class |
observedShares |
logical. Using observed shares for calculating the demand elasticities? |
x |
an object of class |
... |
additional arguments of |
Currently, aidsElas
and elas.aidsEst
can calculate
elasticities only for models without demand shifters.
However, the user can calculate elasticies for models with demand shifters
by removing the coefficients of the demand shifters
(delta_ij, coef$delta
),
adjusting the coefficients alpha_i (coef$alpha
)
‘by hand’,
and then calling aidsElas
.
The alpha_i coefficients should be adjusted by
alpha_i^* = alpha_i + sum(j=1 to m) delta_ij z_j for all i=1,...,n,
where alpha_i^* are the adjusted alpha_i coefficients, n is the number of goods, m is the number of demand shifters, delta_ij are the coefficients of the demand shifters, and z_j is the j's demand shifter. Hence, the adjusted coefficients alpha_i^* depend on the values of the demand shifters z; you could, e.g., calculate different sets of elasticities for different values of z or you could use the means, medians, or modal values of z.
Argument priceIndex
has two effects:
first it determines the price index that is used
for calculating (fitted) expenditure shares,
if argument shares
is not provided (see aidsCalc
);
second it determines which version of the formulas for calculating
demand elasticities of the LA-AIDS are used,
because formulas B1
/LA
, B2
, and Go
/Ch
have different versions depending on the price index.
elas.aidsEst
is a wrapper function to aidsElas
that extracts the
estimated coefficients (coef
),
mean expenditure shares (wMeans
),
mean prices (pMeans
),
names of the prices (priceNames
),
estimated coefficient variance covariance matrix (coef$allcov
), and
degrees of freedom (est$df
)
from the object of class aidsEst
and passes them to aidsElas
.
If argument method
in elas.aidsEst
is not specified,
the default value depends on the estimation method.
If the demand system was estimated by the linear approximation (LA),
the default method is 'Ch'.
If the demand system was estimated by the iterative linear least squares
estimator (ILLE),
the default method is 'AIDS'.
At the moment the elasticity formulas of the orginal AIDS (AIDS
),
the formula of Goddard (1983) or Chalfant (1987) (Go
or Ch
),
the formula of Eales and Unnevehr (1988) (EU
),
the formula of Green and Alston (1990) or the first of Buse (1994)
(GA
or B1
) and
the second formula of Buse (1994) (B2
)
are implemented.
The variance covariance matrices of the elasticities are calculated using the formula of Klein (1953, p. 258) (also known as the delta method). At the moment this is implemented only for the elasticity formulas of the orginal AIDS.
a list of class aidsElas
containing following elements:
method |
the elasticity formula used to calculate these elasticities. |
priceIndex |
the price index used (see details). |
df |
degrees of freedom to calculate P-values of the elasticities
(only if argument |
exp |
vector of expenditure elasticities. |
hicks |
matrix of Hicksian (compensated) price elasticities. |
marshall |
matrix of Marshallian (uncompensated) price elasticities. |
allVcov |
variance covariance matrix of all elasticities. |
expVcov |
variance covariance matrix of the expenditure elasticities. |
hicksVcov |
variance covariance matrix of the Hicksian (compensated) price elasticities. |
marshallVcov |
variance covariance matrix of the Marshallian (uncompensated) price elasticities. |
expStEr |
standard errors of the expenditure elasticities. |
hicksStEr |
standard errors of the Hicksian (compensated) price elasticities. |
marshallStEr |
standard errors of the Marshallian (uncompensated) price elasticities. |
expTval |
t-values of the expenditure elasticities. |
hicksTval |
t-values of the Hicksian (compensated) price elasticities. |
marshallTval |
t-values of the Marshallian (uncompensated) price elasticities. |
expPval |
P-values of the expenditure elasticities. |
hicksPval |
P-values of the Hicksian (compensated) price elasticities. |
marshallPval |
P-values of the Marshallian (uncompensated) price elasticities. |
Arne Henningsen
Chalfant, J.A. (1987) A Globally Flexible, Almost Ideal Demand System. Journal of Business and Economic Statistics, 5, p. 233-242.
Deaton, A.S. and J. Muellbauer (1980) An Almost Ideal Demand System. American Economic Review, 70, p. 312-326.
Eales J.S. and L.J. Unnevehr (1988) Demand for beef and chicken products: separability and structural change. American Journal of Agricultural Economics, 70, p. 521-532.
Klein L.R. (1953) A Textbook of Econometrics. Row, Petersen and Co., New York.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | data( Blanciforti86 )
# Data on food consumption are available only for the first 32 years
Blanciforti86 <- Blanciforti86[ 1:32, ]
estResult <- aidsEst( c( "pFood1", "pFood2", "pFood3", "pFood4" ),
c( "wFood1", "wFood2", "wFood3", "wFood4" ), "xFood",
data = Blanciforti86 )
wMeans <- colMeans( Blanciforti86[ , c( "wFood1", "wFood2",
"wFood3", "wFood4" ) ] )
aidsElas( estResult$coef, shares = wMeans, method = "Ch",
priceIndex = "S" )
## Repeating the evaluation of different elasticity formulas of
## Green & Alston (1990)
priceNames <- c( "pFood1", "pFood2", "pFood3", "pFood4" )
shareNames <- c( "wFood1", "wFood2", "wFood3", "wFood4" )
# AIDS estimation and elasticities
estResultA <- aidsEst( priceNames, shareNames, "xFood",
data = Blanciforti86[ -1, ],
method = "IL", maxiter = 100 )
diag( elas( estResultA, method = "AIDS" )$marshall )
summary( elas( estResultA, method = "AIDS" ) )
# LA-AIDS estimation
estResultLA <- aidsEst( priceNames, shareNames, "xFood",
data = Blanciforti86, priceIndex = "SL", maxiter = 100 )
# LA-AIDS + formula of AIDS
diag( elas( estResultLA, method = "AIDS" )$marshall )
# LA-AIDS + formula of Eales + Unnevehr
diag( elas( estResultLA, method = "EU" )$marshall )
# LA-AIDS + formula of Goddard or Chalfant:
diag( elas( estResultLA, method = "Go" )$marshall )
diag( elas( estResultLA, method = "Ch" )$marshall )
# LA-AIDS + formula of Green + Alston (= 1st of Buse):
diag( elas( estResultLA, method = "GA" )$marshall )
|
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/
Demand Elasticities (formulas of Goddard / Chalfant for Stone price index)
Expenditure Elasticities
q_wFood1 q_wFood2 q_wFood3 q_wFood4
2.0475321 1.2400486 0.3919594 0.1789822
Marshallian (uncompensated) Price Elasticities
pFood1 pFood2 pFood3 pFood4
q_wFood1 -1.0318077 -0.6793370 -0.171537214 -0.1649484
q_wFood2 -0.8018146 -0.2568308 -0.002550292 -0.1788754
q_wFood3 0.1168988 0.1661000 -0.822337733 0.1474366
q_wFood4 0.4358390 0.1117010 0.084230391 -0.8106756
Hicksian (compensated) Price Elasticities
pFood1 pFood2 pFood3 pFood4
q_wFood1 -0.3963049 -0.269126765 0.1030880 0.5624374
q_wFood2 -0.4169345 -0.008394809 0.1637712 0.2616518
q_wFood3 0.2385532 0.244626591 -0.7697662 0.2866801
q_wFood4 0.4913906 0.147558925 0.1082364 -0.7470921
[1] -0.9952247 -0.2790095 -0.8083945 -0.7721528
Estimate Std. Error t value Pr(>|t|)
Ex q_wFood1 2.046444 0.125286 16.3342 < 2.2e-16 ***
Ex q_wFood2 1.292882 0.211109 6.1242 3.109e-08 ***
Ex q_wFood3 0.458094 0.207799 2.2045 0.030326 *
Ex q_wFood4 0.101533 0.177168 0.5731 0.568171
Eh q_wFood1 pFood1 -0.354888 0.063545 -5.5849 3.034e-07 ***
Eh q_wFood1 pFood2 -0.241324 0.049673 -4.8583 5.693e-06 ***
Eh q_wFood1 pFood3 0.103318 0.033862 3.0511 0.003082 **
Eh q_wFood1 pFood4 0.492894 0.068842 7.1598 3.309e-10 ***
Eh q_wFood2 pFood1 -0.371299 0.076471 -4.8554 5.757e-06 ***
Eh q_wFood2 pFood2 -0.016077 0.165880 -0.0969 0.923032
Eh q_wFood2 pFood3 0.104534 0.112666 0.9278 0.356257
Eh q_wFood2 pFood4 0.282842 0.122046 2.3175 0.023000 *
Eh q_wFood3 pFood1 0.242085 0.079115 3.0599 0.003002 **
Eh q_wFood3 pFood2 0.159194 0.171532 0.9281 0.356127
Eh q_wFood3 pFood3 -0.747220 0.146645 -5.0954 2.230e-06 ***
Eh q_wFood3 pFood4 0.345941 0.105567 3.2770 0.001546 **
Eh q_wFood4 pFood1 0.440416 0.061466 7.1652 3.231e-10 ***
Eh q_wFood4 pFood2 0.164259 0.071040 2.3122 0.023305 *
Eh q_wFood4 pFood3 0.131922 0.040449 3.2615 0.001623 **
Eh q_wFood4 pFood4 -0.736597 0.105996 -6.9493 8.448e-10 ***
Em q_wFood1 pFood1 -0.995225 0.060963 -16.3251 < 2.2e-16 ***
Em q_wFood1 pFood2 -0.657509 0.061203 -10.7430 < 2.2e-16 ***
Em q_wFood1 pFood3 -0.169967 0.039906 -4.2592 5.492e-05 ***
Em q_wFood1 pFood4 -0.223743 0.085002 -2.6322 0.010155 *
Em q_wFood2 pFood1 -0.775845 0.073088 -10.6153 < 2.2e-16 ***
Em q_wFood2 pFood2 -0.279009 0.192925 -1.4462 0.151977
Em q_wFood2 pFood3 -0.068119 0.114783 -0.5935 0.554526
Em q_wFood2 pFood4 -0.169908 0.114438 -1.4847 0.141501
Em q_wFood3 pFood1 0.098746 0.095879 1.0299 0.306120
Em q_wFood3 pFood2 0.066032 0.196295 0.3364 0.737447
Em q_wFood3 pFood3 -0.808394 0.142590 -5.6693 2.134e-07 ***
Em q_wFood3 pFood4 0.185522 0.101849 1.8216 0.072215 .
Em q_wFood4 pFood1 0.408646 0.076427 5.3469 8.080e-07 ***
Em q_wFood4 pFood2 0.143611 0.091443 1.5705 0.120197
Em q_wFood4 pFood3 0.118363 0.053113 2.2285 0.028616 *
Em q_wFood4 pFood4 -0.772153 0.105370 -7.3280 1.559e-10 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
[1] -0.3819016 -0.2435919 -0.7386565 -0.2857317
[1] -0.6463780 -0.2141288 -0.8822695 -1.0705700
[1] -0.9750631 -0.2697492 -0.8085958 -0.7599383
[1] -0.9750631 -0.2697492 -0.8085958 -0.7599383
[1] -0.9829150 -0.2698707 -0.8069601 -0.7556619
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.