From | Ernest Berkhout <[email protected]> |
To | [email protected], <[email protected]> |
Subject | Re: st: Re: RE: expand an agrregated file |
Date | Thu, 28 Aug 2003 10:16:26 +0200 |
At 23:59 27-8-2003, Scott Merryman wrote:
> ann fitzmauriceJust for curiosity: Scott, what is the exact difference between your approach with the loop and a simple "expand pop_lgd" without a loop?
>
> > i have a file in the following format
> >
> > region lgd pop_lgd pop_region
> > 1 1 20 65
> > 1 2 45 65
> > 2 1 10 25
> > 2 2 15 25
> > There are other variables and populations with the
> > variables but this is
> > just a small example
> >
> > i would like to create a data set that is case based so
> > instead of 4 lines
> > in the above example will have 90 lines - i have looked at
> > expand but am
> > not sure if this is the command to use
>
> Yes, it is.
>
> Nick
> [email protected]
>
Ann,
I take it when you say you want 90 observations, you want to expand each region
+ lgd by its population?
If so, one way would be to:
forvalue i = 1/4 {
local num = pop_lgd[`i']
expand `num' in `i'
}
© Copyright 1996–2024 StataCorp LLC | Terms of use | Privacy | Contact us | What's new | Site index |