Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Rép. : RE: st: Kwallis in a loop [now p-value of the Kwallis]

From   "Herve STOLOWY" <>
To   <>
Subject   Rép. : RE: st: Kwallis in a loop [now p-value of the Kwallis]
Date   Sun, 13 Nov 2005 19:32:55 +0100

Dear Nick:

Sorry to bother you. I tried without the spaces and I get the same error message.

Anyway, I perfectly understand your message. The program you designed works perfectly and solved the problem.

(One more word on -makematrix-. Again, I understand what you say. Please, don't be at a loss because of me. I simply liked -makematrix- because I feel more independent - including from statalisters - with this command and I can adapt it to many descriptive statistics and univariate tests, which are very important in my field, financial accounting. With the solution of already designed commands, I don't have the same freedom, because I don't know how to program and modify them, if would like to. That's all).

Thanks again for your time.

Best regards


Coordinateur du Département/Head of Department
HEC Paris
Département Comptabilité Contrôle de gestion / Dept of Accounting and Management Control
1, rue de la Liberation
78351 - Jouy-en-Josas
Tel: +33 1 39 67 94 42 - Fax: +33 1 39 67 70 86
>>> 13/11/05 18:24 >>>
Your answer strengthens my previous argument.

-makematrix- just cannot fulfil all the expectations
you have of it. If you omit the spaces in 

max(chiprob(r(df), r(chi2_adj) + 1e-20),.0001) 



you might get -makematrix- to behave the way you want, 
as the argument of -from()- is parsed on spaces, 
but you are still ignoring my strong advice not to do it
this way. 

I am at a loss to see why you prefer this route to 
that of a program designed to tackle your problem 
directly. No programming on your part is required. 


> Dear Nick:
> Sorry for this late reply. I tried your program and it works 
> perfectly. I thank you very much.
> Although I perfectly read what you wrote about -makematrix-, 
> I still like this command and my level of programming is not 
> good enough to write the program you designed for me.
> So, I would have an additional question, hopefully more simple.
> With a ranksum test, I learnt from prior postings how to get a matrix:
> makematrix m1, from(r(z) 2*normprob(-abs(r(z)))) label : 
> ranksum prov_ass, by( sodas2cl)
> I woud like to do the same with -kwallis-. In your program, I 
> found the following formula which seems to be the computation 
> of the p-value of the kwallis: 
> max(chiprob(r(df), r(chi2_adj) + 1e-20),.0001) 
> Then, I wrote the following command with -makematrix-: 
> makematrix m2, from(r(chi2_adj)   max(chiprob(r(df), 
> r(chi2_adj) + 1e-20),.0001) ) label : kwallis prov_ass, by(sodas3cl)
> Unfortunately, it does not work. I get the following error message:
> invalid '.0001' 
> r(198);
> I obviously did something wrong.

*   For searches and help try:

*   For searches and help try:

© Copyright 1996–2017 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index