From | Roger Newson <[email protected]> |
To | [email protected] |
Subject | Re: st: RE: prtest and fweights |
Date | Mon, 27 Sep 2004 11:21:52 +0100 |
At 12:53 22/09/2004, Ronan M Conroy wrote:
A possible way around this problem is to use -expgen-, downloadable from SSC. -expgen- is an extended version of -expand-, and does not retain observations with a zero or missing value for the expression, unless the user specifies the -zero- or -missing- options. -expgen- can also generate new variables, containing the sequence number of the duplicate observation (amongst its duplicates in the new data set) and the position of its parent observation in the old data set.Nick Cox wrote:I can't comment on why not. I guess no one asked, or no one thought of doing it.But beware of -expand-. If an observation represents a zero frequency, it will be retained. You will see a warning but it's a behaviour that you might not have anticipated.
For the moment,
preserve expand
prtest restore
I transcribe tables from papers that I am reviewing into Stata frequently, to cross-check stats, and it's easy to transcribe a zero without remembering that this will create a single observation in the expanded dataset.
© Copyright 1996–2024 StataCorp LLC | Terms of use | Privacy | Contact us | What's new | Site index |