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

st: Re: Adding sample sizes to graph


From   Friedrich Huebler <[email protected]>
To   [email protected]
Subject   st: Re: Adding sample sizes to graph
Date   Wed, 14 Jan 2004 12:52:58 -0800 (PST)

--- "Wagner, Joseph" <[email protected]> wrote:
> Unfortunately this method didn't work for me, I did not get sample
> sizes:
> 
> count if bmi<. & age<. & hivst==1
> gen sample = r(N) if hivst==1
> count if bmi<. & age<. & hivst==2
> replace sample = r(N) if hivst==1
> sum age if bmi<. & hivst<.
> gen xpos = r(max)
> sum bmi if age<. & hivst<.
> gen ypos = r(max)
> twoway (scatter bmi age) (scatter ypos xpos, mlabel(sample)
> msymbol(i)), by(hivst, legend(off))

Joseph,

The command

. replace sample = r(N) if hivst==1

should be

. replace sample = r(N) if hivst==2

You can replace the contents of the variable "sample" by a string to
get something like "n = 22".

Friedrich Huebler

__________________________________
Do you Yahoo!?
Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes
http://hotjobs.sweepstakes.yahoo.com/signingbonus
*
*   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