Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

RE: st: ksmirnov


From   "Guessab Houda" <[email protected]>
To   <[email protected]>
Subject   RE: st: ksmirnov
Date   Tue, 21 Aug 2012 13:59:21 +0200

Nick told me that it's not correct to use kormogolv smirnov to compare the shape of series with a student distribution, is there another numerical method (not graphical)to do that?

Thank you very much maarten for you help!

Houda GUESSAB

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Maarten Buis
Sent: mardi 21 août 2012 12:27
To: [email protected]
Subject: Re: st: ksmirnov

On Tue, Aug 21, 2012 at 11:40 AM, Guessab Houda wrote:
> I mean how can I say that the distribution is more or less similar to student with 8 degrees?

For that I typically like to add a portfolio of simulated variables
that were drawn from the distribution of interest. That way you can
get an informal idea of how much variation on can reasonably expect if
your model (a student t-distribution with 8 degrees of freedom) is
true.

*------------------ begin example -------------------
sysuse auto, clear
egen rank = rank(mpg), unique
su rank, meanonly
gen expected = -invttail(8, (rank - 0.5) / `r(max)')
su mpg
local mean = r(mean)
local sd = r(sd)

 mata
 void function dangerous_sort(string scalar var,
                              string scalar touse) {
	real matrix x
	st_view(x =., ., var, touse)
	x[.,.] = x[order(x,1)]
}
end
gen byte touse = 1

sort expected
forvalues i = 1/10 {
	gen sim`i' = rt(8)*`sd'/sqrt(4/3) + `mean'
	mata: dangerous_sort("sim`i'", "touse")
	local lpattern "`lpattern' solid"
	local lcolor "`lcolor' gs8"
}
local lpattern "lpattern(`lpattern')"
local lcolor "lcolor(`lcolor')"

twoway line sim* expected,                    ///
    `lcolor' `lpattern'                    || ///
scatter mpg expected, mstyle(p1)           || ///
function t_8 = `mean' + x * `sd' / sqrt(4/3), ///
    ra(expected) lstyle(refline)              ///
    legend(order(1  "simulation"              ///
                 11 "observed"                ///
                 12 "reference"))
*------------------- end example --------------------
(For more on examples I sent to the Statalist see:
http://www.maartenbuis.nl/example_faq )

Hope this helps,
Maarten

---------------------------------
Maarten L. Buis
WZB
Reichpietschufer 50
10785 Berlin
Germany

http://www.maartenbuis.nl
---------------------------------
*
*   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/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index