Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: Re: Lots of date vars, more FU qx for Eric Wruck


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: Re: Lots of date vars, more FU qx for Eric Wruck
Date   Sun, 13 Nov 2005 19:23:45 -0000

On the contrary, it is very easy to imagine that getting 
your data into analyzable shape first takes a great deal 
of effort. 

Questions are easiest to answer if we can see the simplest
cut-down version of your data that shows the problem, e.g. 
a listing of 6 or so variables and 12 or so observations, 
and so idea whatever naming scheme has been used. 

Nick 
[email protected] 

Clare L Maxwell
 
> Hello again, Eric.  And thanks again.
> 
> >No, foreach won't work that way.  Here's an example using forvalues 
> >that might help:
> >
> >      +-----------------------------------------------------------+
> >      | mo1   day1    yr1   mo2   day2    yr2   mo3   day3    yr3 |
> >      |-----------------------------------------------------------|
> >   1. |   1      1   1960    12     25   1965     6      7   1968 |
> >   2. |  11     12   1907     6     29   1957     3      3   2002 |
> >      +-----------------------------------------------------------+
> >
> >. forvalues i=1/3 {
> >   2.   gen date`i' = mdy(mo`i', day`i', yr`i')
> >   3. }
> 
> Sadly, the variables are not strictly numbered, and it would not be a 
> good idea to rename them, especially in the other tasks I do with 
> series of coordinated variables.  In your first letter, you mentioned 
> that people might find it easier to respond if I gave a better 
> description of the problem.  Can you think how this might be put so 
> that old hand Stata data manipulators would know what I am talking 
> about?  Sorry that this is not exactly a statistical problem.  I need 
> to get my data into analyzable shape first, which seems to take so 
> much more effort than one would imagine.
> 

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   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