Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: RE: Re: qnorm with by option


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: Re: qnorm with by option
Date   Thu, 3 Dec 2009 17:14:38 -0000

You have almost argued yourself into a corner in ruling out -graph
combine- and insisting on the use of a -by()- option, as -qnorm- does
not support -by()-. 

Your options appear to be: 

1. Clone -qnorm- and change the code so that -by()- is supported. 

2. Use -graph combine- after all. I don't think it is as difficult as
you imply. 

Given 

sysuse auto 

and a wish to 

go

qnorm mpg, by(foreign)  <--- won't work 

An alternative is something like 

levelsof foreign, local(levels)
foreach l of local levels { 
	tempname graph 
	qnorm mpg if foreign == `l', name(`graph') 
	local graphs `graphs' `graph' 
}
graph combine `graphs' 

3. -qplot- from SJ supports -by()-. 

qplot mpg, by(foreign) trscale(invnormal(@)) 

is similar to the result of #2. It is not identical, and does not claim
to be. That's a price of the generality of -qplot- 

Nick 
[email protected] 


-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Babak Oskooei
Sent: 03 December 2009 16:20
To: Stata List
Subject: st: Re: qnorm with by option

Dear Stata Users,

I was wondering how I can use the qnorm command with the "by" option. I
have carried out extensive simulations with different assumptions and
sample sizes. The statistics of interest is normally distributed and I
would like to show graphically that as the sample size increases the
distribution of the statistic of interest gets closer and closer to that
of the normal distribution in all conditions. I would like to avoid the
combine command and use the by option since, if possible, it makes my
life much easier - I do not have to save and maintain dozens of graphs.

Any suggestions on how I can achieve this task.

Many thanks in advance

Babak Oskooei
MRC CTU


      
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   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