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

st: RE: transposing info worked need help with obs Array


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: transposing info worked need help with obs Array
Date   Tue, 6 Sep 2005 21:29:30 +0100

I am not clear where you are starting from, but 
two tips are to master -by:- and to look at -egen, seq()-. 

Explanations of -by:- appear in various places in 
the manual, so start with the Index. An overview 
was given in 

How to move step by: step. Stata Journal 2(1): 86-102 (2002) 
      explains the use of the by varlist : construct to tackle
      a variety of problems with group structure, ranging from
      simple calculations for each of several groups to more
      advanced manipulations that use the built-in _n and _N

Nick 
n.j.cox@durham.ac.uk 

Jeff NASTERNAK
 
> Thank you to Steve B., Clint T., & Nick C. for all of your 
> very informative 
> help on the transposing from long to wide. I have another 
> question regarding 
> an obs array. Is there an easier way to write the number of 
> obs for an ID 
> when the ID's obs vary in frequency. With a list of over a 
> hundred IDs, I 
> was thinking there must be a way to make an array to fill them in.
> EX:   ID     obs     prate
>         1      1         .2
>         1      2         .6
>         1      3         .4
>         2      1         .7
>         2      2         .7
>         3      1         .4
>         3      2         .6
>         3      3         .9
>         3      4         .2
>         3      5         .6

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