Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

RE: st: different result everytime - something strange


From   philippe van kerm <[email protected]>
To   "[email protected]" <[email protected]>
Subject   RE: st: different result everytime - something strange
Date   Fri, 20 Jun 2008 12:30:18 +0200

OK, I see. With a more recent update of -glcurve- you should not experience what you observed -- as -glcurve- now uses -sort .., stable- internally.

-glcurve- is not an official command, but a user-written package (by Stephen Jenkins and myself), so it is not picked up by -update query-. Use -adoupdate- instead. The general advice when you use user-written software is to look for the source and make sure you have the most recent updates -- with several sources available (SJ, STB, SSC, personal pages) not always as easy as with official Stata commands, I admit.

In short, an -ssc install glcurve, replace- should resolve your problem.

Philippe


-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Shehzad Ali
Sent: Friday, June 20, 2008 11:52 AM
To: [email protected]
Subject: RE: st: different result everytime - something strange

Thanks, Philippe. You are right, I think I am using an older version. Here
is what I get:

. which glcurve
*! 3.0.0 Philippe Van Kerm - Stephen P. Jenkins 26 October 2004 (SJ 4-4:
gr0001_1)
*! 2.0 Philippe Van Kerm - Stephen P. Jenkins, 19 Feb 2001 (TSJ-1: gr0001)
*! 1.2 Stephen P. Jenkins - Philippe Van Kerm, Apr 1999 STB-49 sg107.1

Whats the best way to update because my update query doesn't pick this up?

Thank you,

Shehzad



Shehzad,

Just to be sure: Are you using an up-to-date version of -glcurve- (from the
SSC archive)?

. which glcurve
*! 3.2.0 Philippe Van Kerm - Stephen P. Jenkins 07 February 2007

Philippe


-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Shehzad Ali
Sent: 19 June 2008 18:43
To: [email protected]
Subject: RE: st: different result everytime - something strange

You are a genius, Maarten! This solves the problem.

Thank you,

Shehzad


-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Maarten buis
Sent: 19 June 2008 18:24
To: [email protected]
Subject: Re: st: different result everytime - something strange

-glcurve- sorts y. How should Stata decide which row should come first
if two rows have the same value on y? By default it does that
(pseudo-)randomly, which is reasonalble, but I think this is what is
causing you to get different results each time you call that do-file.
If that is the problem, than it should be solved when you replace the
first line with:

sort y, stable
gen sortorder _n
glcurve y [aw=weight], pvar(rank) replace nograph sortvar(sortorder)

-- Maarten

--- Shehzad Ali <[email protected]> wrote:

> Hi listers,
>
> I have encountered a funny problem, which maybe due to something
> wrong with
> my codes or with stata. I am trying to calculate concentration index
> using
> convenient regression method but everytime I run my do file, I get
> different results using exactly the same data. I am sure someone can
> help.
>
> Here is what I am doing:
>
> glcurve y [aw=weight], pvar(rank) replace nograph
> qui sum x [fw=weight]
> scalar mean=r(mean)
> qui sum rank [fw=weight]
> sca var_rank=r(Var)
> gen lhs=2*var_rank*(x/mean)
> regr lhs rank [pw=weight], cluster(commune)
> sca CI=_b[rank]
> display "concentration index", CI
>
> Any help would be appreciated.
>
> Shehzad
>
> *
> *   For searches and help try:
> *   http://www.stata.com/support/faqs/res/findit.html
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/
>


-----------------------------------------
Maarten L. Buis
Department of Social Research Methodology
Vrije Universiteit Amsterdam
Boelelaan 1081
1081 HV Amsterdam
The Netherlands

visiting address:
Buitenveldertselaan 3 (Metropolitan), room Z434

+31 20 5986715

http://home.fsw.vu.nl/m.buis/
-----------------------------------------


      __________________________________________________________
Sent from Yahoo! Mail.
A Smarter Email http://uk.docs.yahoo.com/nowyoucan.html
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



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