Dear Scholars,

I have household expenditure datasets and I am using Quadratic AIDS model to analyze it. My first step is calculating price index for each commodity groups. To do this, I have calculated unit values and budget shares of each expenditure items. Now, I need to construct Stone Price Index using weighted geometric mean method. I have to weight unit values with budget shares but I could not find a proper way to do it. May I ask the codes for this calculation?

Thank you very much in advance.

This is the small sample of my dataset. The variables starting with "l" are log unit values of the items and the variables ending with "w" are budget shares of the items, and clave represents households.)

Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input long clave float(retireinsw otinsurance safedepositw savbanksmcw creditcchargew ordertransferw    l_retireinsP    l_otinsuranceP    l_safedepositP    l_savbanksmcP    l_creditcchargeP    l_ordertransferP)
1000011 0            0 0           0           0 0 .         . .         .         . .
1000031 0            0 0           0           0 0 .         . .         .         . .
1000051 0            0 0           0           0 0 .         . .         .         . .
1000061 0            0 0           0           0 0 .         . .         .         . .
1000091 0            0 0           0           0 0 .         . .         .         . .
1000111 0            0 0           0           0 0 .         . .         .         . .
1000161 0            0 0           0           0 0 .         . .         .         . .
1000181 0            0 0           0           0 0 .         . .         .         . .
1000231 0            0 0           0           0 0 .         . .         .         . .
1000261 0            0 0           0           0 0 .         . .         .         . .
1000281 0            0 0           0           0 0 .         . .         .         . .
1000301 0            0 0           0           0 0 .         . .         .         . .
1000321 0            0 0           0           0 0 .         . .         .         . .
1000361 0            0 0           0           0 0 .         . .         .         . .
1000411 0            0 0           0           0 0 .         . .         .         . .
1000421 0            0 0           0           0 0 .         . .         .         . .
1000431 0            0 0           0           0 0 .         . .         .         . .
1000441 0            0 0           0           0 0 .         . .         .         . .
1000451 0            0 0           0           0 0 .         . .         .         . .
1000461 0            0 0           0           0 0 .         . .         .         . .
1000481 0            0 0           0           0 0 .         . .         .         . .
1000491 0            0 0           0           0 0 .         . .         .         . .
1000501 0            0 0           0           0 0 .         . .         .         . .
1000511 0            0 0           0           0 0 .         . .         .         . .
1000521 0            0 0           0           0 0 .         . .         .         . .
1000541 0            0 0           0           0 0 .         . .         .         . .
1000561 0            0 0           0           0 0 .         . .         .         . .
1000571 0            0 0           0           0 0 .         . .         .         . .
1000601 0            0 0           0           0 0 .         . .         .         . .
1000631 0            0 0           0           0 0 .         . .         .         . .
1000641 0            0 0           0           0 0 .         . .         .         . .
1000651 0            0 0           0           0 0 .         . .         .         . .
1000671 0            0 0           0           0 0 .         . .         .         . .
1000681 0            0 0           0           0 0 .         . .         .         . .
1000691 0            0 0           0           0 0 .         . .         .         . .
1000701 0            0 0           0           0 0 .         . .         .         . .
1000711 0            0 0           0           0 0 .         . .         .         . .
1000731 0            0 0           0           0 0 .         . .         .         . .
1000751 0            0 0           0           0 0 .         . .         .         . .
1000761 0            0 0           0           0 0 .         . .         .         . .
1000771 0 .00009854772 0           0           0 0 . 1.1755192 .         .         . .
1000791 0            0 0           0           0 0 .         . .         .         . .
1000801 0            0 0           0           0 0 .         . .         .         . .
1000821 0            0 0           0           0 0 .         . .         .         . .
1000831 0            0 0           0           0 0 .         . .         .         . .
1000832 0            0 0           0           0 0 .         . .         .         . .
1000851 0            0 0           0           0 0 .         . .         .         . .
1000861 0            0 0           0           0 0 .         . .         .         . .
1000931 0            0 0           0           0 0 .         . .         .         . .
1000941 0            0 0           0           0 0 .         . .         .         . .
1000961 0            0 0           0           0 0 .         . .         .         . .
1001051 0            0 0           0           0 0 .         . .         .         . .
1001061 0            0 0           0           0 0 .         . .         .         . .
1001111 0            0 0           0           0 0 .         . .         .         . .
1001121 0            0 0 .0005988227           0 0 .         . . 1.7917395         . .
1001131 0            0 0           0           0 0 .         . .         .         . .
1001141 0            0 0           0           0 0 .         . .         .         . .
1001151 0            0 0           0           0 0 .         . .         .         . .
1001161 0            0 0           0           0 0 .         . .         .         . .
1001171 0            0 0           0           0 0 .         . .         .         . .
1001181 0            0 0           0           0 0 .         . .         .         . .
1001231 0            0 0           0           0 0 .         . .         .         . .
1001261 0            0 0  .001496486           0 0 .         . . 2.1972246         . .
1001281 0            0 0           0           0 0 .         . .         .         . .
1001291 0            0 0           0           0 0 .         . .         .         . .
1001301 0            0 0           0           0 0 .         . .         .         . .
1001321 0            0 0           0           0 0 .         . .         .         . .
1001351 0            0 0           0           0 0 .         . .         .         . .
1001361 0            0 0           0           0 0 .         . .         .         . .
1001381 0            0 0           0           0 0 .         . .         .         . .
1001391 0            0 0           0           0 0 .         . .         .         . .
1001431 0            0 0           0           0 0 .         . .         .         . .
1001441 0            0 0           0           0 0 .         . .         .         . .
1001451 0            0 0           0           0 0 .         . .         .         . .
1001471 0            0 0           0 .0044313557 0 .         . .         . 2.0794415 .
1001501 0            0 0           0           0 0 .         . .         .         . .
1001511 0            0 0           0           0 0 .         . .         .         . .
1001521 0            0 0           0           0 0 .         . .         .         . .
1001531 0            0 0           0           0 0 .         . .         .         . .
1001571 0            0 0 .0009541479           0 0 .         . .   2.70803         . .
1001581 0            0 0 .0008366265           0 0 .         . . 1.7917395         . .
1001591 0            0 0           0  .013871377 0 .         . .         .  5.010615 .
1001601 0            0 0           0           0 0 .         . .         .         . .
1001611 0            0 0           0           0 0 .         . .         .         . .
1001621 0            0 0  .003841384           0 0 .         . .   3.73765         . .
1001631 0            0 0           0           0 0 .         . .         .         . .
1001641 0            0 0           0           0 0 .         . .         .         . .
1001642 0            0 0           0           0 0 .         . .         .         . .
1001651 0            0 0           0           0 0 .         . .         .         . .
1001671 0            0 0           0           0 0 .         . .         .         . .
1001681 0            0 0           0           0 0 .         . .         .         . .
1001711 0            0 0           0           0 0 .         . .         .         . .
1001721 0            0 0           0           0 0 .         . .         .         . .
1001731 0            0 0           0           0 0 .         . .         .         . .
1001761 0            0 0  .009845003  .010632602 0 .         . .  5.010615  3.988984 .
1001771 0            0 0           0           0 0 .         . .         .         . .
1001841 0            0 0           0           0 0 .         . .         .         . .
1001871 0            0 0           0           0 0 .         . .         .         . .
1001891 0            0 0           0           0 0 .         . .         .         . .
1001901 0            0 0           0           0 0 .         . .         .         . .
end