Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: AW: using vector notation to simplify coding


From   "Martin Weiss" <[email protected]>
To   <[email protected]>
Subject   st: AW: using vector notation to simplify coding
Date   Tue, 11 Aug 2009 16:07:04 +0200

<> 


Welcome to the Stata community! Could you give a meaningful excerpt of your
data, then? Your task sounds easily doable w/o explicitly resorting to
vectors...



HTH
Martin


-----Ursprüngliche Nachricht-----
Von: [email protected]
[mailto:[email protected]] Im Auftrag von Dan Waldo
Gesendet: Dienstag, 11. August 2009 15:58
An: statalist
Betreff: st: using vector notation to simplify coding

Dear Statalist members,

I have data in monthly expenditures in variables ing_1 through ing_6, and
survey months in variables mes_1 through mes_6 (these vary from respondent
to respondent). I wish to adjust the monthly expenditures for inflation, and
I have deflation factors in variables def_1 through def_12.

I am pretty accomplished in SAS, but only a novice in Stata. In SAS I would
say:

array def {12} def_1 - def_12;
array ing {6} ing_1 - ing_6;
array mes {6} mes_1 - mes_6;
do t=1 to 6;
   month=mes{t};
   ing{t}=ing{t}/def{month};
   end;

I have been searching unsuccessfully for the Stata analogue to this; I am
sure it is written somewhere and I am just not using the best search terms.

Will somebody please point me to the proper place?

Thanks!

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index