Statalist


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

Re: st:easy way to deal with "paired" variables?


From   Mandy fu <[email protected]>
To   [email protected]
Subject   Re: st:easy way to deal with "paired" variables?
Date   Sun, 1 Feb 2009 10:02:33 -0500

Dear Mr. Buis,

Thanks for your suggestion! I  find it is easier to reshape the data
as you said. It saves lots of time than my inital way. I'm very happy
to know this better method to deal with this kind of work.
Thanks again!
Mandy


On 2/1/09, Maarten buis <[email protected]> wrote:
> --- Mandy fu <[email protected]> wrote:
> > The data set I'm working on includes 100 variables measuring the time
> > spell of gaps between jobs. And for each gap there's a variable
> > explaining why the person does not work during that gap. I want to
> > calculate the total length of  any gaps caused by being in
> > prison(reason=4) .
>
> Problems like these can sometimes become a lot easier when the data is
> transformed from a wide format to a long format. As you seem to want to
> avoid creating a prison dummy, I used in the example below a logical
> statement (reason==4) inside the -total- command. Logical statements
> evaluate to 1 if true and 0 if false, so this statement plays the same
> role as the dummies in your method.
>
*
*   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