Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


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

Re: st: basic question


From   Eric Booth <ebooth@ppri.tamu.edu>
To   "<statalist@hsphsun2.harvard.edu>" <statalist@hsphsun2.harvard.edu>
Subject   Re: st: basic question
Date   Wed, 24 Aug 2011 14:05:54 +0000

<>

On Aug 22, 2011, at 9:46 PM, Nadine Brooks wrote:

> First of all: thanks for the help
> Second: I did not know about the rules in the Statalist. I had bought
> a book to make my life esier to deal with this program but Stata has a
> lot tricks (missing is bigger than zero?!). I was in a hurry to solve
> the problem, so I signed the list and sent the email without reading
> all instructions. Sorry, this will not happen again.
> 

SL is a great resource, but the closer you stick to the SL FAQ that was mentioned in the email you got when you signed up and at the bottom of all messages on SL, the better answers you'll get.

>  I had bought
> a book to make my life esier to deal with this program but Stata has a
> lot tricks (missing is bigger than zero?!).

> The worse part is that now I solve the problem but I did not learned
> what was wrong….

The biggest 'trick' to learning Stata is to become comfortable with opening and reading the help files.  All the things you asked about in your original posts (including the sum() function, -egen-, and the description of -missing-s) are in the help files (and I referred you to them in my posts).  The part about missings being greater than zero is not a  trick, it's a documented behavior of Stata in -help missing-.


> I rename the variables v9532=sal1, v9932=sal2, v1022=sal3. But before
> that I change the type from float to double. Why? I do not know "trial
> and error + despair".
> And after that I used egen sal= rowtotal (sal1 sal2 sal3), missing.
> By the way: egen sal= rowtotal (v9532 v9932 v1022), missing is also working...
> 
> Does it has anything to do with float/ double type? Or I mised something?

As Nick already mentioned, the variable type (float/double) has nothing to do with resolving your issue, nor was it suggested as a solution in any post in this thread.  Additionally,  the variable name change from v9532 to sal1 was not intended to solve your row total issue --  Phil was suggesting a more informative variable name for data management purposes.  The two -egen- commands you describe above are equivalent because all you've done is -rename- the variable.  

The rational for why the "egen sal= rowtotal (v9532 v9932 v1022), missing"  is your solution is spelled out in both my and Phil's posting.  We also show, by example, why the commands you describe trying in your original post do not work (and point you to further reading in the help files).    If that explanation is still not clear, please spell out exactly what you don't understand.  Simply throwing your hands up and saying that you  'still don't understand what was wrong'  doesn't inspire us with a new way to help explain it to you.

- Eric
__
Eric A. Booth
Public Policy Research Institute
Texas A&M University
ebooth@ppri.tamu.edu
Office: +979.845.6754



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