Notice: On March 31, it was **announced** that Statalist is moving from an email list to a **forum**. The old list will shut down on April 23, and its replacement, **statalist.org** is already up and running.

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

I get two lines, which one I use and how can I interpret it then? I mean how can I say that the distribution is more or less similar to student with 8 degrees? Houda GUESSAB -----Original Message----- From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Nick Cox Sent: mardi 21 aoÃ»t 2012 11:27 To: statalist@hsphsun2.harvard.edu Subject: Re: st: ksmirnov When you say the qnormal function, I presume you mean the -qnorm- command. There is no one way to do it. With the normal distribution, most people regard matching means and SDs to be the way to do it, but there is a good case for fitting a more robust line. In the case of t with 8 d.f. (henceforth t(8)) the case is even stronger. By my calculation t(8) has SD = sqrt(8/6) = sqrt(4/3), but you could use the IQR or any other pair of quantiles. Similarly, although t(8) has mean, median and any other measure of level all 0, it is open for discussion how the data should be summarized. It may even be that 0 is a natural reference for whatever your data are. The straight lines come from manipulating (observed y - level for y) / (expected x - level for x) = (spread for y) / (spread for x) where in practice level for x is always 0. Example code: sysuse auto, clear egen rank = rank(mpg), unique su rank, meanonly gen expected = -invttail(8, (rank - 0.5) / `r(max)') su mpg, detail local mean = r(mean) local sd = r(sd) local median = r(p50) local iqr = r(p75) - r(p25) scatter mpg expected /// || function t_8 = `mean' + x * `sd' / sqrt(4/3), ra(exp) /// || function t_8_2 = `median' + x * `iqr' / (2 * invttail(8, 0.25)), ra(exp) On Tue, Aug 21, 2012 at 9:41 AM, Guessab Houda <houda.guessab@gre.generali.com> wrote: > OK you are right. Then I will use the program you sent me. > > sysuse auto, clear >>> egen rank = rank(mpg), unique >>> su mpg, meanonly >>> local N = r(N) >>> gen tquantile = -invttail(8, (rank - 0.5) / `N') >>> scatter mpg tquantile > > I just need to draw 45 degree reference line like the qnormal function does; can you help me with that? * * 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/ Â Ai sensi del D.Lgs. 196/2003 si precisa che le informazioni contenute in questo messaggio sono riservate ed a uso esclusivo del destinatario. Qualora il messaggio in parola Le fosse pervenuto per errore, La invitiamo ad eliminarlo senza copiarlo e a non inoltrarlo a terzi, dandocene gentilmente comunicazione. Grazie. Pursuant to Legislative Decree No. 196/2003, you are hereby informed that this message contains confidential information intended only for the use of the addressee. If you are not the addressee, and have received this message by mistake, please delete it and immediately notify us. You may not copy or disseminate this message to anyone. Thank you. * * 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/

- Prev by Date:
**RE: st: ksmirnov** - Next by Date:
**Re: st: Bar colors in graph** - Previous by thread:
**st: Bar colors in graph** - Next by thread:
**st: Post-estimation after MI** - Index(es):