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

Re: st: Automatic mean-centering?


From   "Clive Nicholas" <Clive.Nicholas@newcastle.ac.uk>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Automatic mean-centering?
Date   Thu, 26 Aug 2004 20:10:56 +0100 (BST)

All,

Wow - I'm overwhelmed!

Apologies to all of you who helpfully replied to this for being away. In
line with the 'rules', let me report back to you all in its simplest form.
Nick Cox can pull me up in private if I do this wrong! :)

Fred Wolfe popped up first to suggest that it was best done in a -foreach-
loop routine. Before I could get my head round how I might do this, Sarah
Mustillo provided one! Nick Winter provided a shorter version of this with
his code. Both routines provided the same (correct) results.

Next up was Scott Merryman's -clive_centered- (fame at last?), adapted
from Jeff Pitblado's -zval-. This was a bit more of a drama! I ran the
ado-file successfully, but I initially kept getting an -r(197)- invalid
syntax message when I ran the command. I closed the -wagepan- dataset that
I was testing the previous two routines on, checked it on the -auto- data
using the PRICE-TRUNK variables (which worked successfully), and then went
back to the (saved) -wagepan- dataset to run it again. This time, it
worked and produced exactly the same variables as the previous two
solutions. I'm not sure why it misbehaved the first time.

Buzz Burhans and Ben Jann (the author) provided perhaps the winner (for
me, at least): -center- (downloadable from SSC). Nice work, Ben! Needless
to say, it too provided the same results as the three previous solution. I
hate to make judgements when so many were so helpful, but this _was_ the
neatest!

Benjamin Hulley provided an off-list solution which also handled variables
containing decimal points (although it has to be said that all the other
solutions do this successfully as well). I'll be replying to him off-list.
Jeffrey Simons mentioned that he had a routine called -mcenter- which also
did the job. Yes, please - I'd like to test it.

Once again, thanks a lot to all of you who replied so generously.

CLIVE NICHOLAS        |t: 0(044)191 222 5969
Politics              |e: clive.nicholas@ncl.ac.uk
Newcastle University  |http://www.ncl.ac.uk/geps
*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index