## Standard errors and t-tests of AIDS elasticities?

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

4 REPLIES 4

## Re: Standard errors and t-tests of AIDS elasticities?

Hello Liu,

Hereby some examples :

1. The essential guide to bootstrapping in SAS
By Rick Wicklin on The DO Loop December 12, 2018
https://blogs.sas.com/content/iml/2018/12/12/essential-guide-bootstrapping-sas.html
2. The bootstrap method in SAS: A t test example
By Rick Wicklin on The DO Loop June 20, 2018
https://blogs.sas.com/content/iml/2018/06/20/bootstrap-method-example-sas.html
3. For the Delta method, see :
Usage Note 30333: FASTats: Frequently Asked-For Statistics
https://support.sas.com/kb/30/333.html

Kind regards,

Koen

## Re: Standard errors and t-tests of AIDS elasticities?

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!

## Re: Standard errors and t-tests of AIDS elasticities?

Thanks! I will try that!

## Re: Standard errors and t-tests of AIDS elasticities?

You are welcome! 🙂

Discussion stats
• 4 replies
• 272 views
• 3 likes
• 3 in conversation