[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: st: AW: ksmirnov
"Nick Cox" <email@example.com>
RE: st: AW: ksmirnov
Tue, 29 Sep 2009 19:18:25 +0100
I don't know why I said that because it isn't true. In fact, I was
overlooking my own work...
In terms of the original example,
g returns = D.ln_wpi
and given a download of -qplot- from the Stata Journal site, you can go
qplot returns, trscale(invttail(6, 1 - @)) xli(0) yli(0)
Alternatively, you can do it from first principles
count if !missing(returns)
local N = r(N)
gen quantilet = invttail(6, 1 - (_n - 0.5) / `N')
scatter returns quantilet , xli(0) yli(0)
For (_n - 0.5) / `N', substitute any other plotting position formula.
For "6" substitute any other desired df.
In this example, the fit is lousy: the mean is a long way from zero and
the distribution is not even symmetric.
See also for a meant-to-be-encouraging note
SJ-7-2 gr0027 . . Stata tip 47: Quantile-quantile plots without
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . N.
Q2/07 SJ 7(2):275--279 (no
tip on producing various quantile-quantile (Q-Q) plots
That and 75 other tips have just been reprinted in
Seventy-six Stata Tips, 2nd Edition
Publisher: Stata Press
Pages: 177; paperback
You'd need to clone one or more existing programs, e.g. -qnorm-, -pnorm-
and replace code there with code specific to the t-distribution.
I am not familiar with the etiquette on fitting t-distributions. Isn't
the df in effect a parameter to be estimated? Otherwise, there would
need to be some justification for using a particular df.
Thanks for your replies Martin & Nick.
Martin: My question was actually simpler - was my procedure correct?
That is, should the data be standardised by an estimate of the scale
before using the Kolmogorov-Smirnov procedure or is that not
Also, from the help file for chi2fit by Stas Kolenikov I could not
figure out how to implement it for a t-distribution. Any help will be
Nick: I am particularly interested in deviation from a t-distribution.
My data is almost certainly non-normal. I agree about the merits of
plotting it, but am not aware of any tools for my particular case. Any
* For searches and help try: