Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

RE: st: Display of missing by groups


From   Fred Wolfe <[email protected]>
To   [email protected], <[email protected]>
Subject   RE: st: Display of missing by groups
Date   Wed, 08 Feb 2006 09:16:45 -0600

I used the summarize program as an example that would be understandable to all, but the issue is broader as it affects many programs, including the one that follows:

. bys ranada,rc0:fsum age sex haq_ difhaq_,s(mean sd)


-> ranada = 0

Variable | N Mean SD
-------------------------------------+---------------------------
Age (years) | 4627 2.18 0.65
Sex (% male) | 4631 24.29
HAQ (0-3) | 4608 1.06 0.67
HAQ (0-3) (difference) | 4600 0.17 0.41

-----------------------------------------------------------------------------------------------------------> ranada = 1

Variable | N Mean SD
-------------------------------------+---------------------------
Age (years) | 4898 2.21 0.66
Sex (% male) | 4907 19.81
HAQ (0-3) | 4876 1.08 0.70
HAQ (0-3) (difference) | 4869 0.18 0.40

-----------------------------------------------------------------------------------------------------------> ranada = .

Variable | N Mean SD
-------------------------------------+---------------------------
Age (years) | 83 2.20 0.64
Sex (% male) | 83 31.33
HAQ (0-3) | 79 1.22 0.73
HAQ (0-3) (difference) | 0


-rc0- doesn't fix the problem because there is no error (see above).

-tabstat- is a superb program, but doesn't allow the kind of variable formatting I need for publication quality tables without a lot of extra work.

In answer to Nick's question about what missing implies, in this analysis of a controlled clinical trial it implies that some subjects were not randomized [ranada is randomized to a treatment called ADA]. In the example above -ranada- is dummied in, a place holder for when the randomization code is available.

So I guess my wish was just to have a simple way to drop the missing group in a Stata command option.

For my current use, preserve, drop, and restore work best and are easiest because I want to retain all subjects in the data set for other analyses.

Fred


At 08:56 AM 2/8/2006, Nick Cox wrote:

<snip>

Also, missing on some but not all of the variables
implies what?

Nick
[email protected]


David Harrison

> I don't see why this would be a problem, as -by- already has
> the options
> -sort- and -rc0-.
>
> Still, I would go with -tabstat, by()- anyway, as the output is
> formatted much more attractively.

Fred Wolfe
National Data Bank for Rheumatic Diseases
Wichita, Kansas
Tel (316) 263-2125     Fax (316) 263-0761
[email protected]


*
*   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