Hi SAS Community,
I'm working on demand estimation for foods using Almost Ideal Demand System (AIDS). I looked at these two examples and they have been extremely helpful:
https://support.sas.com/rnd/app/ets/examples/aids/index.htm
https://support.sas.com/rnd/app/ets/examples/elasticity/index.htm
Up to now I have got the parameters from the AIDS model, and the calculated income elasticities and price elasticities. But the examples do not have instructions on how to calculate the standard errors of these elasticities. I'd like to conduct t-tests to see which elasticities are statistically significant, so calculating s.e. is necessary.
I know theoretically how to calculate the s.e. using either the Delta method, or using bootstrap, but I'm not sure how to realize it in SAS. Could someone give me some instruction on that? It would be greatly helpful if someone could use the example data in the SAS support pages above to illustrate it.
Thanks very much!
Liu
Hello Liu,
Hereby some examples :
Kind regards,
Koen
Hello, @liu6200
If you look at the example code in
Calculating Elasticities in an Almost Ideal Demand System (sas.com)
it already shows an example how to obtain elasticities and their standard errors and t statistics and their p values using the ESTIMATE statement in PROC MODEL.
estimate 'elasticity beef' (gbb - bb*(.5 - bb*9.0))/.5 - 1;
The following section of documentation discusses how the standard errors of functions of parameters are computed in PROC MODEL:
https://go.documentation.sas.com/doc/en/pgmsascdc/v_017/etsug/etsug_model_sect034.htm
The above code example is the simplest case where you know exactly at what specific value of w_beef and Ln(X/P) you want to compute the elasticity. If you need to compute elasticities at the mean point of the variables in the data set as is done in the IML code in the example, then you will need to compute the w_beef and Ln(X/P) values at the mean values in the data set, then substitute those values in the elasticity formula in the ESTIMATE statement. The mean of w_i's are already computed in the PROC MEANS step in the example, the Ln(X/P) term at the mean point in the nonlinear AIDS model is more involved, but in the end, it is still just a function of parameters in the model and mean values of variables in the data set as shown in the PROC IML code. You just need to extract those mean values and specify the elasticities in terms of functions of the parameters and constants in the ESTIMATE statement. You may find it helpful to follow the PROC IML code in the example to write out the explicit expression of the elasticities in terms of parameters and variables(at the means) for each element of the elasticity matrix, then specify the expressions which are functions of the parameters and constants in the ESTIMATE statement.
You may also find it the easiest to work with income elasticities first since the income elasticity formula only involves b_i and w_i, (e_i = b_i/w_i + 1), where b_i's are parameters in the model, and w_i's are computed in the PROC MEANS step in the example code.
I hope this helps. Good luck!
Thanks! I will try that!
You are welcome! 🙂
Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.