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   Maarten Buis <[email protected]>
To   [email protected]
Subject   Re: st: ksmirnov
Date   Thu, 14 Nov 2013 21:03:27 +0100

On Thu, Nov 14, 2013 at 6:18 PM, PAPANIKOLAOU P. wrote:
> I want to run ksmirnov. When I use the 1st syntax, it produces the error
> statement.
> When I replace the mean and standard deviation with their sample values,
> it produces the results. Following this, I ask for the histogram and
> stata produces 2 missing values.
>
> ksmirnov  MS_REGISTER  = normal((x-r(mean))/r(sd)) error (450)
>
> ksmirnov  UK_BIRTHS=normal( ( UK_BIRTHS-65561.72 ) / (2468.91))

In principle you could use -ksmirnov- to test for normality: here is an example:

*------------------ begin example ------------------
sysuse auto, clear
sum price
ksmirnov price = normal((price- r(mean))/r(sd))
*------------------- end example -------------------
* (For more on examples I sent to the Statalist see:
* http://www.maartenbuis.nl/example_faq )

However, this is a very bad idea. To quote the help-file of
-ksmirnov-: "When testing for normality, please see [R] sktest and [R]
swilk." Also see -ssc desc asl_norm- for bootstrap tests of normality.

I don't understand your remark concerning the histogram and missing
values. What did you do exactly, and what did Stata tell you in
return?

Also, in order to graphically evaluate normality a histogram with a
normal density curve overlaid is usually a bad idea. A similar but
better graph would be a hanging or suspended rootogram, see -ssc desc
hangroot- and <http://www.maartenbuis.nl/software/hangroot.html>.
Another alternative is the quantile-quantile plot, see -help qnorm-.

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/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


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