Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

st: FW: Stored Data after the calculation


From   "Martin Weiss" <[email protected]>
To   <[email protected]>
Subject   st: FW: Stored Data after the calculation
Date   Sun, 28 Mar 2010 14:19:15 +0200

<>

Forwarded on behalf of Calchas. I would kindly ask that you switch to
text-only messages and send them to the list.

Re your query, you should restate the purpose and I am sure there is an easy
solution. There is no "stored values" command as far as I can see. Stata
operates on the entire column automatically, no additional input required.
Say -gen sumplusone=ttl_sum+1- and it adds 1 to every value in the column...


HTH
Martin

From: keeler james [mailto:[email protected]] 
Sent: Sonntag, 28. März 2010 14:00
To: [email protected]
Subject: RE: Stored Data after the calculation

Thanks for the message, Martin.

But what I want is to recall the calculated values after the -gen- command
and use them for further calculations. It is something to do with the
'stored values' command: sth=r(N). How can I do it for an entire column of
values?

Calchas 

> From: [email protected]
> To: [email protected]
> CC: [email protected]
> Subject: FW: Stored Data after the calculation
> Date: Sun, 28 Mar 2010 13:01:09 +0200
> 
> 
> 
> <>
> 
> 
> Forwarded on behalf of Calchas. The original post to Statalist was
probably
> html, hence the bounce.
> 
> 
> The -gen- statement gives Calchas a column of values with the desired sum,
> so if Calchas wanted to, say, square those:
> 
> *******
> gen sqttl_sum= ttl_sum*ttl_sum
> *******
> 
> 
> If this is not the intention, please state!
> 
> 
> HTH
> Martin
> 
> From: keeler james [mailto:[email protected]] 
> Sent: Sonntag, 28. März 2010 12:48
> To: [email protected]
> Subject: Stored Data after the calculation
> 
> Dear Martin,
> 
> I send the following question to Statalist, but got bounced back. I then
> search the list and found that you answered a similar Q before and hence I
> wonder if you can help. Many thanks.
> 
> Calchas
> ________________________________________
> From: [email protected]
> To: [email protected]
> Subject: Stored Data after the calculation
> Date: Sat, 27 Mar 2010 18:59:04 +0000
> 
> Dear Statalist,
>  
> I use the command: 
>  
> gen ttl_sum= hse_expend + grocery + child_expend
>  
> This will give me the calculated values of ttl_sum, but how can I reuse
the
> calculated values of ttl_sum to do further calculations?
>  
> I know it is something relating to the command of stored data, i.e.:
>  
> local sth=r(N)
>  
> but this is only for a one value, what about saving and reusing the entire
> column of ttl_sum? Really stuck at the moment and any help will be
> appreciated.
>  
> Ta,
> Calchas
> 
> 
> ________________________________________
> Do you have a story that started on Hotmail? Tell us now 
> ________________________________________
> Do you want a Hotmail account? Sign-up now - Free 
> ________________________________________
> Do you have a story that started on Hotmail? Tell us now 
> ________________________________________
> Do you want a Hotmail account? Sign-up now - Free 
> ________________________________________
> Not got a Hotmail account? Sign-up now - Free 
> ________________________________________
> We want to hear all your funny, exciting and crazy Hotmail stories. Tell
us
> now
> 
________________________________________
Do you have a story that started on Hotmail? Tell us now


*
*   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index