<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-15088145</id><updated>2011-08-16T23:09:39.918-04:00</updated><title type='text'>Statalist</title><subtitle type='html'>RSS syndicated content from Statalist, a discussion listserv generated by users of StataCorp Stata statistical analysis software.  Subscribe to the RSS feed using the links provided in the sidebar.  You must join the listserv in order to respond to, or add, new posts.  For more information on Statalist, click on the 'Statalist FAQ' link in the sidebar.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://statalist.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://statalist.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default?start-index=101&amp;max-results=100'/><author><name>statalist member</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>6798</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-15088145.post-114736540352947923</id><published>2006-05-11T12:36:00.000-04:00</published><updated>2006-05-11T12:36:43.600-04:00</updated><title type='text'>test post</title><content type='html'>&lt;p class="mobile-post"&gt;Testing&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15088145-114736540352947923?l=statalist.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114736540352947923'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114736540352947923'/><link rel='alternate' type='text/html' href='http://statalist.blogspot.com/2006/05/test-post.html' title='test post'/><author><name>statalist member</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-15088145.post-114307824859994832</id><published>2006-03-22T20:44:00.000-05:00</published><updated>2006-03-22T20:44:08.710-05:00</updated><title type='text'>Re: st: RE: RE: RE: list subjects with a similar value</title><content type='html'>&lt;p class="mobile-post"&gt;&amp;gt;Personally if you want to be able to revert to older versions of files
&amp;gt;I'd recommend simply creating a copy before doing major revisions and
&amp;gt;simply append a date in numeric format at some point to the filename
&amp;gt;(before '.' would be most appropriate).&lt;/p&gt;&lt;p class="mobile-post"&gt;Thank you Neil. Are there resources for systematic and efficient "best 
practices" in do-file colding, that beginning Stata users can emulate and 
integrate into their own work?
Michael&lt;/p&gt;&lt;p class="mobile-post"&gt;*
*   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/&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15088145-114307824859994832?l=statalist.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114307824859994832'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114307824859994832'/><link rel='alternate' type='text/html' href='http://statalist.blogspot.com/2006/03/re-st-re-re-re-list-subjec_114307824859994832.html' title='Re: st: RE: RE: RE: list subjects with a similar value'/><author><name>statalist member</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-15088145.post-114307818253558091</id><published>2006-03-22T20:43:00.000-05:00</published><updated>2006-03-22T20:43:02.650-05:00</updated><title type='text'>st: simultaneous equation with qualitative variables</title><content type='html'>&lt;p class="mobile-post"&gt;how can i use stata to estimate  simultaneous equations with qualitative variables as follows:
y1=a1+b1y2+c1x1+e1
y2=a2+b2y1+c2x2+e2
y1*=1 if y1&amp;gt;0
y1*=0 if y1&amp;lt;=0
y2*=1 if y2&amp;gt;0
y2*=0 if y2&amp;lt;=0&lt;/p&gt;&lt;p class="mobile-post"&gt;*
*   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/&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15088145-114307818253558091?l=statalist.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114307818253558091'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114307818253558091'/><link rel='alternate' type='text/html' href='http://statalist.blogspot.com/2006/03/st-simultaneous-equation-with.html' title='st: simultaneous equation with qualitative variables'/><author><name>statalist member</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-15088145.post-114307702685109277</id><published>2006-03-22T20:23:00.000-05:00</published><updated>2006-03-22T20:23:46.956-05:00</updated><title type='text'>RE: st: RE: RE: RE: list subjects with a similar value</title><content type='html'>&lt;p class="mobile-post"&gt;MS-Word I understand to be a word processor. Recall
that many members of Statalist do not use and certainly
are not expert in Windows or Microsoft products generally. &lt;/p&gt;&lt;p class="mobile-post"&gt;In Vim, the way that seems to be most natural 
is a Unix way. You can have two files open in two 
windows and set it so that differences are highlighted. 
So, one could be a previous version and the other a working 
version. &lt;/p&gt;&lt;p class="mobile-post"&gt;I gather that Word behaves differently. &lt;/p&gt;&lt;p class="mobile-post"&gt;In general, good text editors will have something loosely
similar. None that I know of regards it as a virtue to 
emulate Word. &lt;/p&gt;&lt;p class="mobile-post"&gt;Nick 
n.j.cox@durham.ac.uk &lt;/p&gt;&lt;p class="mobile-post"&gt;Michael McCulloch
 
&amp;gt; Sorry; I was referring to changes in coding that one writes 
&amp;gt; in a do-file.
 
&amp;gt; &amp;gt;Changes to what?&lt;/p&gt;&lt;p class="mobile-post"&gt;&amp;gt; &amp;gt; &amp;gt; Jennifer response brings to mind a question that recently
&amp;gt; &amp;gt; &amp;gt; occurred to me:
&amp;gt; &amp;gt; &amp;gt; Is there a Stata-compatible text editor that, like MS-WORD,
&amp;gt; &amp;gt; &amp;gt; can highlight changes?
&amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt;Whoops, of course you're right. When I play with things to
&amp;gt; &amp;gt; &amp;gt; work out code
&amp;gt; &amp;gt; &amp;gt; &amp;gt;I usually don't keep the changes, so I mangle working datasets
&amp;gt; &amp;gt; &amp;gt; &amp;gt;willy-nilly and didn't think to change the conditioned keep to a
&amp;gt; &amp;gt; &amp;gt; &amp;gt;conditioned list.
&amp;gt; &amp;gt; &amp;gt; &amp;gt;The use of bysorting and _N is much neater and more flexible.&lt;/p&gt;&lt;p class="mobile-post"&gt;*
*   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/&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15088145-114307702685109277?l=statalist.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114307702685109277'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114307702685109277'/><link rel='alternate' type='text/html' href='http://statalist.blogspot.com/2006/03/re-st-re-re-re-list-subjec_114307702685109277.html' title='RE: st: RE: RE: RE: list subjects with a similar value'/><author><name>statalist member</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-15088145.post-114307657687675970</id><published>2006-03-22T20:16:00.000-05:00</published><updated>2006-03-22T20:16:16.983-05:00</updated><title type='text'>Re: st: RE: RE: RE: list subjects with a similar value</title><content type='html'>&lt;p class="mobile-post"&gt;On 3/23/06, Michael McCulloch &amp;lt;mm@pinest.org&amp;gt; wrote:
&amp;gt; Jennifer response brings to mind a question that recently occurred to me:
&amp;gt; Is there a Stata-compatible text editor that, like MS-WORD, can highlight
&amp;gt; changes?&lt;/p&gt;&lt;p class="mobile-post"&gt;Although I don't use it myself there are version control features in
Emacs.  These work with programming control systems such as CVS or
SVN, and I'm not sure what your mileage would be writing do/ado files
under such schemas, but I suspect it is possible (don't quote me on
that though :).&lt;/p&gt;&lt;p class="mobile-post"&gt;This isn't exactly the same as M$-words document tracking (which
personally I find hideously hard to follow, particularly when there
are multiple authors making revisions, I've seen some docs that end up
looking like the old TV-test screens :-), but it does allow you to
track the changes that you are making.  One of the main problems (as I
see it) is that to write do/ado-files you need a _text_ editor, and
word is not a text-editor, but a word-processor, so all the colour
changes that you see are essentially mark-ups of the original text,
and such mark-ups would render the Stata code uninterpretable.&lt;/p&gt;&lt;p class="mobile-post"&gt;See http://www.gnu.org/software/emacs/manual/html_node/Version-Control.html
for more on Emacs' VC system.&lt;/p&gt;&lt;p class="mobile-post"&gt;Personally if you want to be able to revert to older versions of files
I'd recommend simply creating a copy before doing major revisions and
simply append a date in numeric format at some point to the filename
(before '.' would be most appropriate).&lt;/p&gt;&lt;p class="mobile-post"&gt;HTH's&lt;/p&gt;&lt;p class="mobile-post"&gt;Neil
--
"The best safety device in climbing is always situated between your
ears" - Ross Weiter, Perth Rock Climbing Guide (2002)&lt;/p&gt;&lt;p class="mobile-post"&gt;Email - nshephard@gmail.com / neilshep@cyllene.uwa.edu.au
Website - http://slack.ser.man.ac.uk/
Blog - http://slack---line.blogspot.com/
Flickr - http://www.flickr.com/photos/slackline/&lt;/p&gt;&lt;p class="mobile-post"&gt;*
*   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/&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15088145-114307657687675970?l=statalist.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114307657687675970'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114307657687675970'/><link rel='alternate' type='text/html' href='http://statalist.blogspot.com/2006/03/re-st-re-re-re-list-subjec_114307657687675970.html' title='Re: st: RE: RE: RE: list subjects with a similar value'/><author><name>statalist member</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-15088145.post-114307594339484716</id><published>2006-03-22T20:05:00.000-05:00</published><updated>2006-03-22T20:05:43.503-05:00</updated><title type='text'>RE: st: RE: RE: RE: list subjects with a similar value</title><content type='html'>&lt;p class="mobile-post"&gt;Sorry; I was referring to changes in coding that one writes in a do-file.&lt;/p&gt;&lt;p class="mobile-post"&gt;At 04:47 PM 3/22/2006, you wrote:
&amp;gt;Changes to what?
&amp;gt;
&amp;gt;Nick
&amp;gt;n.j.cox@durham.ac.uk
&amp;gt;
&amp;gt;Michael McCulloch
&amp;gt;
&amp;gt; &amp;gt; Jennifer response brings to mind a question that recently
&amp;gt; &amp;gt; occurred to me:
&amp;gt; &amp;gt; Is there a Stata-compatible text editor that, like MS-WORD,
&amp;gt; &amp;gt; can highlight changes?
&amp;gt;
&amp;gt; &amp;gt; &amp;gt;Whoops, of course you're right. When I play with things to
&amp;gt; &amp;gt; work out code
&amp;gt; &amp;gt; &amp;gt;I usually don't keep the changes, so I mangle working datasets
&amp;gt; &amp;gt; &amp;gt;willy-nilly and didn't think to change the conditioned keep to a
&amp;gt; &amp;gt; &amp;gt;conditioned list.
&amp;gt; &amp;gt; &amp;gt;The use of bysorting and _N is much neater and more flexible.
&amp;gt;
&amp;gt;*
&amp;gt;*   For searches and help try:
&amp;gt;*   http://www.stata.com/support/faqs/res/findit.html
&amp;gt;*   http://www.stata.com/support/statalist/faq
&amp;gt;*   http://www.ats.ucla.edu/stat/stata/&lt;/p&gt;&lt;p class="mobile-post"&gt;Best wishes,
Michael&lt;/p&gt;&lt;p class="mobile-post"&gt;____________________________________&lt;/p&gt;&lt;p class="mobile-post"&gt;Michael McCulloch
Pine Street Clinic
124 Pine Street, San Anselmo, CA 94960-2674
tel     415.407.1357
fax     415.485.1065
email:  mm@pinest.org
web:    www.pinest.org
         www.pinestreetfoundation.org&lt;/p&gt;&lt;p class="mobile-post"&gt;*
*   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/&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15088145-114307594339484716?l=statalist.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114307594339484716'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114307594339484716'/><link rel='alternate' type='text/html' href='http://statalist.blogspot.com/2006/03/re-st-re-re-re-list-subjects-with_22.html' title='RE: st: RE: RE: RE: list subjects with a similar value'/><author><name>statalist member</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-15088145.post-114307498609466726</id><published>2006-03-22T19:49:00.000-05:00</published><updated>2006-03-22T19:49:47.290-05:00</updated><title type='text'>RE: st: RE: RE: RE: list subjects with a similar value</title><content type='html'>&lt;p class="mobile-post"&gt;Changes to what? &lt;/p&gt;&lt;p class="mobile-post"&gt;Nick 
n.j.cox@durham.ac.uk &lt;/p&gt;&lt;p class="mobile-post"&gt;Michael McCulloch
 
&amp;gt; Jennifer response brings to mind a question that recently 
&amp;gt; occurred to me:
&amp;gt; Is there a Stata-compatible text editor that, like MS-WORD, 
&amp;gt; can highlight changes?
 
&amp;gt; &amp;gt;Whoops, of course you're right. When I play with things to 
&amp;gt; work out code
&amp;gt; &amp;gt;I usually don't keep the changes, so I mangle working datasets
&amp;gt; &amp;gt;willy-nilly and didn't think to change the conditioned keep to a
&amp;gt; &amp;gt;conditioned list.
&amp;gt; &amp;gt;The use of bysorting and _N is much neater and more flexible.&lt;/p&gt;&lt;p class="mobile-post"&gt;*
*   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/&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15088145-114307498609466726?l=statalist.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114307498609466726'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114307498609466726'/><link rel='alternate' type='text/html' href='http://statalist.blogspot.com/2006/03/re-st-re-re-re-list-subjects-with.html' title='RE: st: RE: RE: RE: list subjects with a similar value'/><author><name>statalist member</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-15088145.post-114306910109994810</id><published>2006-03-22T18:11:00.000-05:00</published><updated>2006-03-22T18:11:41.103-05:00</updated><title type='text'>st: RE: RE: RE: Macro display format</title><content type='html'>&lt;p class="mobile-post"&gt;It's a good question. &lt;/p&gt;&lt;p class="mobile-post"&gt;I guess: 
 
	-scatter- calls -graph- calls ... something that 
	clears your r-class results. &lt;/p&gt;&lt;p class="mobile-post"&gt;	-graph- needs all sorts of little calculations to work 
	out what to show. It tends to do this on the fly, but 
	either way, you can lose your r-class results. &lt;/p&gt;&lt;p class="mobile-post"&gt;Whatever it is, it is quite deep down. &lt;/p&gt;&lt;p class="mobile-post"&gt;Nick 
n.j.cox@durham.ac.uk &lt;/p&gt;&lt;p class="mobile-post"&gt;Alex Ogan&lt;/p&gt;&lt;p class="mobile-post"&gt;&amp;gt; Sorry if this is a silly question.  
&amp;gt; 
&amp;gt; I did the following sequence of commands.  I closed the 
&amp;gt; scatter as soon
&amp;gt; as it opened.  No other commands.  
&amp;gt; 
&amp;gt; Why does r(mean) go away after you use it in the scatter with the
&amp;gt; formatting extended function?
&amp;gt; 
&amp;gt; . sysuse auto, clear
&amp;gt; (1978 Automobile Data)
&amp;gt; 
&amp;gt; . quietly summ length
&amp;gt; 
&amp;gt; . di `r(mean)'
&amp;gt; 187.93243
&amp;gt; 
&amp;gt; .  di `: di %9.1f `r(mean)''
&amp;gt; 187.9
&amp;gt; 
&amp;gt; .  di `: di %9.1f `r(mean)''
&amp;gt; 187.9
&amp;gt; 
&amp;gt; . twoway scatter length mpg, text(200 35 "The mean of length is:`: di
&amp;gt; %2.1f `r(mean)''")
&amp;gt; 
&amp;gt; .  di `: di %9.1f `r(mean)''
&amp;gt; 
&amp;gt; 
&amp;gt; . di `r(mean)'
&amp;gt; 
&amp;gt; 
&amp;gt; .
&amp;gt; &lt;/p&gt;&lt;p class="mobile-post"&gt;*
*   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/&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15088145-114306910109994810?l=statalist.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114306910109994810'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114306910109994810'/><link rel='alternate' type='text/html' href='http://statalist.blogspot.com/2006/03/st-re-re-re-macro-display-format.html' title='st: RE: RE: RE: Macro display format'/><author><name>statalist member</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-15088145.post-114306868054889387</id><published>2006-03-22T18:04:00.000-05:00</published><updated>2006-03-22T18:04:40.640-05:00</updated><title type='text'>st: "sureg" with long-format data</title><content type='html'>&lt;p class="mobile-post"&gt;Hello all,&lt;/p&gt;&lt;p class="mobile-post"&gt;I have searched the web and available Stata faqs and helpfiles for an
answer to an
sureg question and am unable to find one on my own. Much obliged if
anyone can help me through this particular puzzle.&lt;/p&gt;&lt;p class="mobile-post"&gt;I have a dataset oriented lengthwise where observations are grouped by
country and year. I would like to run sureg using this vertical
orientation. For example, in the sureg syntax, I would like to write
"sureg (yvar xvar)" as equation 1 representing the first 35
observations, followed by "(yvar xvar)" as equation 2 representing the
next 35 observations, and so on. My difficulty is that without
re-orienting the data width-wise (which creates a cumbersome heap of
newly-named X and Y variables and stops me from being able to tweak the
regressions around the edges) I have no way to distinguish for Stata
that instead of each equation having different Y and X variable names,
each equation has the same variable names but should contain a different
set of 35
observations. My abbreviated dataset looks like:&lt;/p&gt;&lt;p class="mobile-post"&gt;Country                   Year   Yvar    Xvar
Australia                 2004   .5      14      
Australia                 2003   .6      17
....                        ..
Australia                 1970   .2      10&lt;/p&gt;&lt;p class="mobile-post"&gt;Austria                   2004   .9      35
Austria                   2003   .8      14
....                        ..
Austria                   1970   .15     14&lt;/p&gt;&lt;p class="mobile-post"&gt;Belgium                   2004   .13     7
....
(and so on for approximately 100 countries)&lt;/p&gt;&lt;p class="mobile-post"&gt;Ideally, the sureg command would allow something like "by country: sureg
(Yvar Xvar)" but instead, I have to reorient the data widthwise and
write "sureg (YvarAustralia XvarAustralia) (YvarAustria XvarAustria)..."
for about one-hundred different equations (and change all 100 when I
make adjustments). Requiring this horizontal orientation to make sureg
work seems remarkably inefficient in the command line, but I can't seem
to find another way around it. Many thanks for any and all ideas.&lt;/p&gt;&lt;p class="mobile-post"&gt;Cheers,
Eric&lt;/p&gt;&lt;p class="mobile-post"&gt;Eric K. Bielke
Regulatory Economics Advisor
www.telecom.co.nz
Level 2, Telecom House, 68-86 Jervois Quay,
P O Box 570, Wellington, New Zealand&lt;/p&gt;&lt;p class="mobile-post"&gt;This communication, including any attachments, is confidential. If you are not the intended recipient, you should not read it - please contact me immediately, destroy it, and do not copy or use any part of this communication or disclose anything about it. Thank you. Please note that this communication does not designate an information system for the purposes of the Electronic Transactions Act 2002.&lt;/p&gt;&lt;p class="mobile-post"&gt;*
*   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/&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15088145-114306868054889387?l=statalist.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114306868054889387'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114306868054889387'/><link rel='alternate' type='text/html' href='http://statalist.blogspot.com/2006/03/st-sureg-with-long-format-data.html' title='st: &quot;sureg&quot; with long-format data'/><author><name>statalist member</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-15088145.post-114306835943567580</id><published>2006-03-22T17:59:00.000-05:00</published><updated>2006-03-22T17:59:19.560-05:00</updated><title type='text'>st: RE: RE: Macro display format</title><content type='html'>&lt;p class="mobile-post"&gt;Sorry if this is a silly question.  &lt;/p&gt;&lt;p class="mobile-post"&gt;I did the following sequence of commands.  I closed the scatter as soon
as it opened.  No other commands.  &lt;/p&gt;&lt;p class="mobile-post"&gt;Why does r(mean) go away after you use it in the scatter with the
formatting extended function?&lt;/p&gt;&lt;p class="mobile-post"&gt;. sysuse auto, clear
(1978 Automobile Data)&lt;/p&gt;&lt;p class="mobile-post"&gt;. quietly summ length&lt;/p&gt;&lt;p class="mobile-post"&gt;. di `r(mean)'
187.93243&lt;/p&gt;&lt;p class="mobile-post"&gt;.  di `: di %9.1f `r(mean)''
187.9&lt;/p&gt;&lt;p class="mobile-post"&gt;.  di `: di %9.1f `r(mean)''
187.9&lt;/p&gt;&lt;p class="mobile-post"&gt;. twoway scatter length mpg, text(200 35 "The mean of length is:`: di
%2.1f `r(mean)''")&lt;/p&gt;&lt;p class="mobile-post"&gt;.  di `: di %9.1f `r(mean)''&lt;/p&gt;&lt;p class="mobile-post"&gt;. di `r(mean)'&lt;/p&gt;&lt;p class="mobile-post"&gt;.&lt;/p&gt;&lt;p class="mobile-post"&gt;-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Nick Cox
Sent: Wednesday, March 22, 2006 5:51 PM
To: statalist@hsphsun2.harvard.edu
Subject: st: RE: Macro display format&lt;/p&gt;&lt;p class="mobile-post"&gt;No. You should try &lt;/p&gt;&lt;p class="mobile-post"&gt;` : di %9.1f `r(mean)'' &lt;/p&gt;&lt;p class="mobile-post"&gt;See help extended_fcn. &lt;/p&gt;&lt;p class="mobile-post"&gt;Tip: I would go `: di %2.1f `r(mean)'' even 
if you are sure that format is too restrictive. 
You're likely to be wrong, as Stata will stretch the space to 
avoid damage. However, with %9.1f you are likely to get the ugly 
spaces that are a consequence of what you asked
for. &lt;/p&gt;&lt;p class="mobile-post"&gt;Nick 
n.j.cox@durham.ac.uk &lt;/p&gt;&lt;p class="mobile-post"&gt;Thomas Speidel
 
&amp;gt; I am trying to include the content of a macro within a graph, but I'm
&amp;gt; having problems with the display format.  
&amp;gt; 
&amp;gt; For example:
&amp;gt; 
&amp;gt; sysuse auto, clear
&amp;gt; qui: summ length
&amp;gt; twoway scatter length mpg, text(200 35 "The mean of length is:
&amp;gt; `r(mean)'")
&amp;gt; 
&amp;gt; How do I change the format of the macro to display something 
&amp;gt; like %9.2f?
&amp;gt; 
&amp;gt; I tried:
&amp;gt; ... , text(200 35 "The mean of length is: `%9.1f `r(mean)''")
&amp;gt; 
&amp;gt; Am I missing some triple compound quote? :-)&lt;/p&gt;&lt;p class="mobile-post"&gt;*
*   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/&lt;/p&gt;&lt;p class="mobile-post"&gt;This message is intended solely for the designated recipient(s). It may contain confidential or proprietary information and may be subject to confidentiality protections. If you are not a designated recipient, you may not review, copy, or distribute this message. If you receive this in error, please notify the sender by reply e-mail and delete this message. &lt;/p&gt;&lt;p class="mobile-post"&gt;Arrowstreet Capital, L.P. is an Equal Opportunity Employer. &lt;/p&gt;&lt;p class="mobile-post"&gt;*
*   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/&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15088145-114306835943567580?l=statalist.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114306835943567580'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114306835943567580'/><link rel='alternate' type='text/html' href='http://statalist.blogspot.com/2006/03/st-re-re-macro-display-format.html' title='st: RE: RE: Macro display format'/><author><name>statalist member</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-15088145.post-114306794758145144</id><published>2006-03-22T17:52:00.000-05:00</published><updated>2006-03-22T17:52:27.686-05:00</updated><title type='text'>st: RE: Macro display format</title><content type='html'>&lt;p class="mobile-post"&gt;No. You should try &lt;/p&gt;&lt;p class="mobile-post"&gt;` : di %9.1f `r(mean)'' &lt;/p&gt;&lt;p class="mobile-post"&gt;See help extended_fcn. &lt;/p&gt;&lt;p class="mobile-post"&gt;Tip: I would go `: di %2.1f `r(mean)'' even 
if you are sure that format is too restrictive. 
You're likely to be wrong, as Stata will stretch the space to 
avoid damage. However, with %9.1f you are likely to get the ugly 
spaces that are a consequence of what you asked
for. &lt;/p&gt;&lt;p class="mobile-post"&gt;Nick 
n.j.cox@durham.ac.uk &lt;/p&gt;&lt;p class="mobile-post"&gt;Thomas Speidel
 
&amp;gt; I am trying to include the content of a macro within a graph, but I'm
&amp;gt; having problems with the display format.  
&amp;gt; 
&amp;gt; For example:
&amp;gt; 
&amp;gt; sysuse auto, clear
&amp;gt; qui: summ length
&amp;gt; twoway scatter length mpg, text(200 35 "The mean of length is:
&amp;gt; `r(mean)'")
&amp;gt; 
&amp;gt; How do I change the format of the macro to display something 
&amp;gt; like %9.2f?
&amp;gt; 
&amp;gt; I tried:
&amp;gt; ... , text(200 35 "The mean of length is: `%9.1f `r(mean)''")
&amp;gt; 
&amp;gt; Am I missing some triple compound quote? :-)&lt;/p&gt;&lt;p class="mobile-post"&gt;*
*   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/&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15088145-114306794758145144?l=statalist.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114306794758145144'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114306794758145144'/><link rel='alternate' type='text/html' href='http://statalist.blogspot.com/2006/03/st-re-macro-display-format.html' title='st: RE: Macro display format'/><author><name>statalist member</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-15088145.post-114306771494352633</id><published>2006-03-22T17:48:00.000-05:00</published><updated>2006-03-22T17:48:34.946-05:00</updated><title type='text'>st: RE: RE: RE: list subjects with a similar value</title><content type='html'>&lt;p class="mobile-post"&gt;Whoops, of course you're right. When I play with things to work out code
I usually don't keep the changes, so I mangle working datasets
willy-nilly and didn't think to change the conditioned keep to a
conditioned list.  
The use of bysorting and _N is much neater and more flexible. &lt;/p&gt;&lt;p class="mobile-post"&gt;N.J.Cox wrote:
&amp;gt;Whoa! The question was just about _listing_. 
&amp;gt;You just changed Raoul's dataset by throwing 
&amp;gt;much of it away. &lt;/p&gt;&lt;p class="mobile-post"&gt;*
*   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/&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15088145-114306771494352633?l=statalist.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114306771494352633'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114306771494352633'/><link rel='alternate' type='text/html' href='http://statalist.blogspot.com/2006/03/st-re-re-re-list-subjects-with-similar.html' title='st: RE: RE: RE: list subjects with a similar value'/><author><name>statalist member</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-15088145.post-114306742273101766</id><published>2006-03-22T17:43:00.000-05:00</published><updated>2006-03-22T17:43:42.830-05:00</updated><title type='text'>st: Macro display format</title><content type='html'>&lt;p class="mobile-post"&gt;I am trying to include the content of a macro within a graph, but I'm
having problems with the display format.  &lt;/p&gt;&lt;p class="mobile-post"&gt;For example:&lt;/p&gt;&lt;p class="mobile-post"&gt;sysuse auto, clear
qui: summ length
twoway scatter length mpg, text(200 35 "The mean of length is:
`r(mean)'")&lt;/p&gt;&lt;p class="mobile-post"&gt;How do I change the format of the macro to display something like %9.2f?&lt;/p&gt;&lt;p class="mobile-post"&gt;I tried:
... , text(200 35 "The mean of length is: `%9.1f `r(mean)''")&lt;/p&gt;&lt;p class="mobile-post"&gt;Am I missing some triple compound quote? :-)&lt;/p&gt;&lt;p class="mobile-post"&gt;Thanks,
Thomas&lt;/p&gt;&lt;p class="mobile-post"&gt;--
Thomas Speidel
Statistical Associate
Clinical Trials Unit
Tom Baker Cancer Centre
1331 - 29th Street N.W.
Calgary, AB, T2N 4N4&lt;/p&gt;&lt;p class="mobile-post"&gt;Tel. (403) 521-3370
Email: thomassp@cancerboard.ab.ca&lt;/p&gt;&lt;p class="mobile-post"&gt;This e-mail and any attachments may contain confidential and
privileged information. If you are not the intended recipient,
please notify the sender immediately by return e-mail, delete this
e-mail and destroy any copies. Any dissemination or use of this
information by a person other than the intended recipient is
unauthorized and may be illegal.&lt;/p&gt;&lt;p class="mobile-post"&gt;*
*   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/&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15088145-114306742273101766?l=statalist.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114306742273101766'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114306742273101766'/><link rel='alternate' type='text/html' href='http://statalist.blogspot.com/2006/03/st-macro-display-format.html' title='st: Macro display format'/><author><name>statalist member</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-15088145.post-114306710875303074</id><published>2006-03-22T17:38:00.000-05:00</published><updated>2006-03-22T17:38:28.936-05:00</updated><title type='text'>RE: st: list subjects with a similar value</title><content type='html'>&lt;p class="mobile-post"&gt;You are avoiding the command -duplicates-
and doing it from first principles. That 
is a very good idea. -duplicates- is 
just a wrapper for stuff like this. &lt;/p&gt;&lt;p class="mobile-post"&gt;But the three steps here can be cut to two. &lt;/p&gt;&lt;p class="mobile-post"&gt;bysort date_of_birth : gen dob_duplicate = _N 
list id date_of_birth if dob_duplicate &amp;gt;= 2 &lt;/p&gt;&lt;p class="mobile-post"&gt;Nick 
n.j.cox@durham.ac.uk &lt;/p&gt;&lt;p class="mobile-post"&gt;clinton.thompson@summitllc.us
 
&amp;gt; there may be a more elegant way to do this, albeit this is 
&amp;gt; but one attempt:
&amp;gt; 
&amp;gt;     * obtain the number of duplicates w/in date of birth
&amp;gt; bysort date_of_birth:  gen dob_duplicate = _N
&amp;gt;     * tag each combination of DOB &amp;amp; the duplicates therein
&amp;gt; egen dob_tag = tag(date_of_birth dob_duplicate)
&amp;gt;      * list the ID &amp;amp; DOB associated w/ each repeated DOB...
&amp;gt; list id date_of_birth dob_tag if dob_tag
 
&amp;gt; &amp;gt; I have a large database and would like to list the idnumber of all
&amp;gt; &amp;gt; subjects with the same date of birth. How do I do this? I have tried
&amp;gt; &amp;gt; .duplicate, but can figure out how to do it. Thanks.&lt;/p&gt;&lt;p class="mobile-post"&gt;*
*   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/&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15088145-114306710875303074?l=statalist.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114306710875303074'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114306710875303074'/><link rel='alternate' type='text/html' href='http://statalist.blogspot.com/2006/03/re-st-list-subjects-with-similar-value_22.html' title='RE: st: list subjects with a similar value'/><author><name>statalist member</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-15088145.post-114306691145332027</id><published>2006-03-22T17:35:00.000-05:00</published><updated>2006-03-22T17:35:11.456-05:00</updated><title type='text'>st: RE: RE: list subjects with a similar value</title><content type='html'>&lt;p class="mobile-post"&gt;Whoa! The question was just about _listing_. 
You just changed Raoul's dataset by throwing 
much of it away. &lt;/p&gt;&lt;p class="mobile-post"&gt;duplicates tag dateofbirth, gen(tag)
sort dateofbirth
list id dateofbirth if tag &lt;/p&gt;&lt;p class="mobile-post"&gt;Nick 
n.j.cox@durham.ac.uk &lt;/p&gt;&lt;p class="mobile-post"&gt;Marino, Jennifer
 
&amp;gt; Maybe try something along these lines:
&amp;gt; 
&amp;gt; duplicates tag dateofbirth, gen(tag)
&amp;gt; drop if tag==0
&amp;gt; sort dateofbirth
&amp;gt; by dateofbirth: list id&lt;/p&gt;&lt;p class="mobile-post"&gt;Raoul C Reulen
  
&amp;gt; I have a large database and would like to list the idnumber of all
&amp;gt; subjects with the same date of birth. How do I do this? I have tried
&amp;gt; .duplicate, but can figure out how to do it. Thanks.&lt;/p&gt;&lt;p class="mobile-post"&gt;*
*   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/&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15088145-114306691145332027?l=statalist.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114306691145332027'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114306691145332027'/><link rel='alternate' type='text/html' href='http://statalist.blogspot.com/2006/03/st-re-re-list-subjects-with-similar.html' title='st: RE: RE: list subjects with a similar value'/><author><name>statalist member</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-15088145.post-114306665394911081</id><published>2006-03-22T17:30:00.000-05:00</published><updated>2006-03-22T17:30:54.090-05:00</updated><title type='text'>Re: st: list subjects with a similar value</title><content type='html'>&lt;p class="mobile-post"&gt;there may be a more elegant way to do this, albeit this is but one attempt:&lt;/p&gt;&lt;p class="mobile-post"&gt;    * obtain the number of duplicates w/in date of birth
bysort date_of_birth:  gen dob_duplicate = _N
    * tag each combination of DOB &amp;amp; the duplicates therein
egen dob_tag = tag(date_of_birth dob_duplicate)
     * list the ID &amp;amp; DOB associated w/ each repeated DOB...
list id date_of_birth dob_tag if dob_tag&lt;/p&gt;&lt;p class="mobile-post"&gt;note that i didn't subject this to a rigorous test...but i think it works,
nonetheless.
--clint&lt;/p&gt;&lt;p class="mobile-post"&gt;&amp;gt; Hi,
&amp;gt;
&amp;gt; I have a large database and would like to list the idnumber of all
&amp;gt; subjects with the same date of birth. How do I do this? I have tried
&amp;gt; .duplicate, but can figure out how to do it. Thanks.
&amp;gt;
&amp;gt; Raoul
&amp;gt;
&amp;gt; *
&amp;gt; *   For searches and help try:
&amp;gt; *   http://www.stata.com/support/faqs/res/findit.html
&amp;gt; *   http://www.stata.com/support/statalist/faq
&amp;gt; *   http://www.ats.ucla.edu/stat/stata/
&amp;gt;&lt;/p&gt;&lt;p class="mobile-post"&gt;*
*   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/&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15088145-114306665394911081?l=statalist.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114306665394911081'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114306665394911081'/><link rel='alternate' type='text/html' href='http://statalist.blogspot.com/2006/03/re-st-list-subjects-with-similar-value.html' title='Re: st: list subjects with a similar value'/><author><name>statalist member</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-15088145.post-114306635609788494</id><published>2006-03-22T17:25:00.000-05:00</published><updated>2006-03-22T17:25:56.213-05:00</updated><title type='text'>st: RE: list subjects with a similar value</title><content type='html'>&lt;p class="mobile-post"&gt;Maybe try something along these lines:&lt;/p&gt;&lt;p class="mobile-post"&gt;duplicates tag dateofbirth, gen(tag)
drop if tag==0
sort dateofbirth
by dateofbirth: list id&lt;/p&gt;&lt;p class="mobile-post"&gt;Jen Marino&lt;/p&gt;&lt;p class="mobile-post"&gt;-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Raoul C
Reulen
Sent: Wednesday, March 22, 2006 2:14 PM
To: statalist@hsphsun2.harvard.edu
Subject: st: list subjects with a similar value&lt;/p&gt;&lt;p class="mobile-post"&gt;Hi,
 
I have a large database and would like to list the idnumber of all
subjects with the same date of birth. How do I do this? I have tried
.duplicate, but can figure out how to do it. Thanks.
 
Raoul &lt;/p&gt;&lt;p class="mobile-post"&gt;*
*   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/&lt;/p&gt;&lt;p class="mobile-post"&gt;*
*   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/&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15088145-114306635609788494?l=statalist.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114306635609788494'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114306635609788494'/><link rel='alternate' type='text/html' href='http://statalist.blogspot.com/2006/03/st-re-list-subjects-with-similar-value.html' title='st: RE: list subjects with a similar value'/><author><name>statalist member</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-15088145.post-114306573887562444</id><published>2006-03-22T17:15:00.000-05:00</published><updated>2006-03-22T17:15:40.350-05:00</updated><title type='text'>st: list subjects with a similar value</title><content type='html'>&lt;p class="mobile-post"&gt;Hi,
 
I have a large database and would like to list the idnumber of all subjects with the same date of birth. How do I do this? I have tried .duplicate, but can figure out how to do it. Thanks.
 
Raoul &lt;/p&gt;&lt;p class="mobile-post"&gt;*
*   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/&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15088145-114306573887562444?l=statalist.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114306573887562444'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114306573887562444'/><link rel='alternate' type='text/html' href='http://statalist.blogspot.com/2006/03/st-list-subjects-with-similar-value.html' title='st: list subjects with a similar value'/><author><name>statalist member</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-15088145.post-114305771480677052</id><published>2006-03-22T15:01:00.000-05:00</published><updated>2006-03-22T15:01:55.020-05:00</updated><title type='text'>Re: st: monte carlo study</title><content type='html'>&lt;p class="mobile-post"&gt;Rudy,&lt;/p&gt;&lt;p class="mobile-post"&gt;here is an example based on the help file for -simulate-&lt;/p&gt;&lt;p class="mobile-post"&gt;-------------------------
capture program drop mcarlols
program define mcarlols, rclass
syntax [, obs(integer 1)  ]
drop _all
set obs `obs'
drawnorm eps x
g y=1+x+eps
reg y x
return scalar beta = _b[x]
end&lt;/p&gt;&lt;p class="mobile-post"&gt;simulate beta=r(beta) , reps(1000): mcarlols, obs(100)&lt;/p&gt;&lt;p class="mobile-post"&gt;su beta, de
kdensity beta, norm
--------------------------------&lt;/p&gt;&lt;p class="mobile-post"&gt;le 22/03/2006 20:10, Rudy Fichtenbaum a ecrit :
&amp;gt; Stata Users:
&amp;gt;
&amp;gt; I am still learning my way around Stata after many years of using SAS.
&amp;gt; In SAS it is fairly easy to write a program to do a simple Monte Carlo
&amp;gt; study to illustrate the properties of least squares estimators.
&amp;gt;
&amp;gt; Is there anyone that has a simple example of a Monte Carlo Study for OLS?
&amp;gt;
&amp;gt; Thanks,
&amp;gt;
&amp;gt; Rudy
&amp;gt; *
&amp;gt; *   For searches and help try:
&amp;gt; *   http://www.stata.com/support/faqs/res/findit.html
&amp;gt; *   http://www.stata.com/support/statalist/faq
&amp;gt; *   http://www.ats.ucla.edu/stat/stata/
&amp;gt;&lt;/p&gt;&lt;p class="mobile-post"&gt;*
*   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/&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15088145-114305771480677052?l=statalist.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114305771480677052'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114305771480677052'/><link rel='alternate' type='text/html' href='http://statalist.blogspot.com/2006/03/re-st-monte-carlo-study_22.html' title='Re: st: monte carlo study'/><author><name>statalist member</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-15088145.post-114305728589321247</id><published>2006-03-22T14:54:00.000-05:00</published><updated>2006-03-22T14:54:53.286-05:00</updated><title type='text'>Re: st: monte carlo study</title><content type='html'>&lt;p class="mobile-post"&gt;In the unlikely event that you have not, do check out -findit monte carlo-. The example in STB reprints Vol 4, pg 207 
may be helpful&lt;/p&gt;&lt;p class="mobile-post"&gt;TITLE
       STB-20 ssi6.  Simplified Monte Carlo simulations.&lt;/p&gt;&lt;p class="mobile-post"&gt;Rudy Fichtenbaum wrote:
&amp;gt; Stata Users:
&amp;gt; 
&amp;gt; I am still learning my way around Stata after many years of using SAS. 
&amp;gt; In SAS it is fairly easy to write a program to do a simple Monte Carlo 
&amp;gt; study to illustrate the properties of least squares estimators.
&amp;gt; 
&amp;gt; Is there anyone that has a simple example of a Monte Carlo Study for OLS?
&amp;gt; 
&amp;gt; Thanks,
&amp;gt; 
&amp;gt; Rudy
&amp;gt; *
&amp;gt; *   For searches and help try:
&amp;gt; *   http://www.stata.com/support/faqs/res/findit.html
&amp;gt; *   http://www.stata.com/support/statalist/faq
&amp;gt; *   http://www.ats.ucla.edu/stat/stata/
&amp;gt; 
*
*   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/&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15088145-114305728589321247?l=statalist.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114305728589321247'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114305728589321247'/><link rel='alternate' type='text/html' href='http://statalist.blogspot.com/2006/03/re-st-monte-carlo-study.html' title='Re: st: monte carlo study'/><author><name>statalist member</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-15088145.post-114305496477945957</id><published>2006-03-22T14:16:00.000-05:00</published><updated>2006-03-22T14:16:04.783-05:00</updated><title type='text'>st: Chou-Talalay method</title><content type='html'>&lt;p class="mobile-post"&gt;Dear all,&lt;/p&gt;&lt;p class="mobile-post"&gt;Does anyone have or know of a Stata program to compute
the various Chou-Talalay statistics of dose-effect
relationship?&lt;/p&gt;&lt;p class="mobile-post"&gt;Thank you,
Ricardo
  &lt;/p&gt;&lt;p class="mobile-post"&gt;Ricardo Ovaldia, MS
Statistician 
Oklahoma City, OK&lt;/p&gt;&lt;p class="mobile-post"&gt;__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
*
*   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/&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15088145-114305496477945957?l=statalist.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114305496477945957'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114305496477945957'/><link rel='alternate' type='text/html' href='http://statalist.blogspot.com/2006/03/st-chou-talalay-method.html' title='st: Chou-Talalay method'/><author><name>statalist member</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-15088145.post-114305471761852258</id><published>2006-03-22T14:11:00.000-05:00</published><updated>2006-03-22T14:12:00.976-05:00</updated><title type='text'>st: monte carlo study</title><content type='html'>&lt;p class="mobile-post"&gt;Stata Users:&lt;/p&gt;&lt;p class="mobile-post"&gt;I am still learning my way around Stata after many years of using SAS. 
In SAS it is fairly easy to write a program to do a simple Monte Carlo 
study to illustrate the properties of least squares estimators.&lt;/p&gt;&lt;p class="mobile-post"&gt;Is there anyone that has a simple example of a Monte Carlo Study for OLS?&lt;/p&gt;&lt;p class="mobile-post"&gt;Thanks,&lt;/p&gt;&lt;p class="mobile-post"&gt;Rudy
*
*   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/&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15088145-114305471761852258?l=statalist.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114305471761852258'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114305471761852258'/><link rel='alternate' type='text/html' href='http://statalist.blogspot.com/2006/03/st-monte-carlo-study.html' title='st: monte carlo study'/><author><name>statalist member</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-15088145.post-114305389131537738</id><published>2006-03-22T13:58:00.000-05:00</published><updated>2006-03-22T13:58:11.450-05:00</updated><title type='text'>RE: st: functions for computing prob</title><content type='html'>&lt;p class="mobile-post"&gt;Thanks a lot, Gary!&lt;/p&gt;&lt;p class="mobile-post"&gt;Lei&lt;/p&gt;&lt;p class="mobile-post"&gt;-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Gary Longton
Sent: Wednesday, March 22, 2006 12:47 PM
To: statalist@hsphsun2.harvard.edu
Subject: Re: st: functions for computing prob&lt;/p&gt;&lt;p class="mobile-post"&gt;It appears that I was mistaken about -tprob()-, that it does exist and
appear to 
work, though undocumented and apparently obsolete.  It looks to be the
2-tailed 
version of -ttail()-&lt;/p&gt;&lt;p class="mobile-post"&gt;. di tprob(30,1.8)
.08192507&lt;/p&gt;&lt;p class="mobile-post"&gt;. di ttail(30,1.8)
.04096253&lt;/p&gt;&lt;p class="mobile-post"&gt;- GL&lt;/p&gt;&lt;p class="mobile-post"&gt;Gary Longton wrote:
&amp;gt; Lei Xuan wrote:
&amp;gt; 
&amp;gt;&amp;gt; I am computing probabilities for t-test and z-test.
&amp;gt;&amp;gt; I want to know if the functions -tprob- and -normprob- are out-of-date
&amp;gt;&amp;gt; since no help files explain these functions. Are -ttail(n,t)- and 
&amp;gt;&amp;gt; -normal(z)
&amp;gt;&amp;gt;
&amp;gt;&amp;gt; right functions to compute probs?
&amp;gt; 
&amp;gt; 
&amp;gt; see -help density functions-
&amp;gt; or -help functions-
&amp;gt; 
&amp;gt; Yes, the cumulative normal density function, normprob(), still works but 
&amp;gt; is out of date, no longer documented, and has been replaced by 
&amp;gt; normal().  Am not sure whether tprob() ever existed? - doesn't seem to 
&amp;gt; work and is not documented in any case.  ttail(n,t) is documented under 
&amp;gt; help for functions.
&amp;gt; 
&amp;gt; - Gary
*
*   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/&lt;/p&gt;&lt;p class="mobile-post"&gt;*
*   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/&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15088145-114305389131537738?l=statalist.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114305389131537738'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114305389131537738'/><link rel='alternate' type='text/html' href='http://statalist.blogspot.com/2006/03/re-st-functions-for-comput_114305389131537738.html' title='RE: st: functions for computing prob'/><author><name>statalist member</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-15088145.post-114305332955373724</id><published>2006-03-22T13:48:00.000-05:00</published><updated>2006-03-22T13:48:50.190-05:00</updated><title type='text'>Re: st: functions for computing prob</title><content type='html'>&lt;p class="mobile-post"&gt;It appears that I was mistaken about -tprob()-, that it does exist and appear to 
work, though undocumented and apparently obsolete.  It looks to be the 2-tailed 
version of -ttail()-&lt;/p&gt;&lt;p class="mobile-post"&gt;. di tprob(30,1.8)
.08192507&lt;/p&gt;&lt;p class="mobile-post"&gt;. di ttail(30,1.8)
.04096253&lt;/p&gt;&lt;p class="mobile-post"&gt;- GL&lt;/p&gt;&lt;p class="mobile-post"&gt;Gary Longton wrote:
&amp;gt; Lei Xuan wrote:
&amp;gt; 
&amp;gt;&amp;gt; I am computing probabilities for t-test and z-test.
&amp;gt;&amp;gt; I want to know if the functions -tprob- and -normprob- are out-of-date
&amp;gt;&amp;gt; since no help files explain these functions. Are -ttail(n,t)- and 
&amp;gt;&amp;gt; -normal(z)
&amp;gt;&amp;gt;
&amp;gt;&amp;gt; right functions to compute probs?
&amp;gt; 
&amp;gt; 
&amp;gt; see -help density functions-
&amp;gt; or -help functions-
&amp;gt; 
&amp;gt; Yes, the cumulative normal density function, normprob(), still works but 
&amp;gt; is out of date, no longer documented, and has been replaced by 
&amp;gt; normal().  Am not sure whether tprob() ever existed? - doesn't seem to 
&amp;gt; work and is not documented in any case.  ttail(n,t) is documented under 
&amp;gt; help for functions.
&amp;gt; 
&amp;gt; - Gary
*
*   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/&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15088145-114305332955373724?l=statalist.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114305332955373724'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114305332955373724'/><link rel='alternate' type='text/html' href='http://statalist.blogspot.com/2006/03/re-st-functions-for-computing-prob_22.html' title='Re: st: functions for computing prob'/><author><name>statalist member</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-15088145.post-114305237616751129</id><published>2006-03-22T13:32:00.000-05:00</published><updated>2006-03-22T13:33:19.903-05:00</updated><title type='text'>Re: st: functions for computing prob</title><content type='html'>&lt;p class="mobile-post"&gt;Lei Xuan wrote:&lt;/p&gt;&lt;p class="mobile-post"&gt;&amp;gt; I am computing probabilities for t-test and z-test.
&amp;gt; I want to know if the functions -tprob- and -normprob- are out-of-date
&amp;gt; since no help files explain these functions. Are -ttail(n,t)- and -normal(z)
&amp;gt; 
&amp;gt; right functions to compute probs?&lt;/p&gt;&lt;p class="mobile-post"&gt;see -help density functions-
or -help functions-&lt;/p&gt;&lt;p class="mobile-post"&gt;Yes, the cumulative normal density function, normprob(), still works but is out 
of date, no longer documented, and has been replaced by normal().  Am not sure 
whether tprob() ever existed? - doesn't seem to work and is not documented in 
any case.  ttail(n,t) is documented under help for functions.&lt;/p&gt;&lt;p class="mobile-post"&gt;- Gary&lt;/p&gt;&lt;p class="mobile-post"&gt;*
*   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/&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15088145-114305237616751129?l=statalist.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114305237616751129'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114305237616751129'/><link rel='alternate' type='text/html' href='http://statalist.blogspot.com/2006/03/re-st-functions-for-computing-prob.html' title='Re: st: functions for computing prob'/><author><name>statalist member</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-15088145.post-114305140471966609</id><published>2006-03-22T13:16:00.000-05:00</published><updated>2006-03-22T13:16:46.900-05:00</updated><title type='text'>st: functions for computing prob</title><content type='html'>&lt;p class="mobile-post"&gt;Hi,&lt;/p&gt;&lt;p class="mobile-post"&gt;I am computing probabilities for t-test and z-test.
I want to know if the functions -tprob- and -normprob- are out-of-date
since no help files explain these functions. Are -ttail(n,t)- and -normal(z)&lt;/p&gt;&lt;p class="mobile-post"&gt;right functions to compute probs?&lt;/p&gt;&lt;p class="mobile-post"&gt;Thanks,&lt;/p&gt;&lt;p class="mobile-post"&gt;Lei Xuan
 &lt;/p&gt;&lt;p class="mobile-post"&gt;*
*   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/&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15088145-114305140471966609?l=statalist.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114305140471966609'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114305140471966609'/><link rel='alternate' type='text/html' href='http://statalist.blogspot.com/2006/03/st-functions-for-computing-prob.html' title='st: functions for computing prob'/><author><name>statalist member</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-15088145.post-114304970906037657</id><published>2006-03-22T12:48:00.000-05:00</published><updated>2006-03-22T12:48:30.070-05:00</updated><title type='text'>Re: st: STATA syntax colouring in TextWrangler</title><content type='html'>&lt;p class="mobile-post"&gt;Cool! Works w/ BBEdit, too. You just have to create a "Languages  
Module" folder.&lt;/p&gt;&lt;p class="mobile-post"&gt;See this as well:
http://dataninja.wordpress.com/2006/03/03/send-to-stata-applescript- 
for-textwrangler/&lt;/p&gt;&lt;p class="mobile-post"&gt;-- 
Danielle H Ferry&lt;/p&gt;&lt;p class="mobile-post"&gt;On Mar 22, 2006, at 9:12 AM, Ronán Conroy wrote:&lt;/p&gt;&lt;p class="mobile-post"&gt;&amp;gt; On 22 Márta 2006, at 12:47, Taavi Lai wrote:
&amp;gt;
&amp;gt;&amp;gt; Google search "TextWrangler stata syntax" gave several hits and  
&amp;gt;&amp;gt; one of those directed to a file Stata.plist which downloaded ok.  
&amp;gt;&amp;gt; I'm not a Mac user and have no acquaintance to TextWrangler so you  
&amp;gt;&amp;gt; have to experiment further
&amp;gt;&amp;gt; the link is http://dataninja.wordpress.com/2006/02/28/stata- 
&amp;gt;&amp;gt; language-module-for-textwrangler/
&amp;gt;&amp;gt;
&amp;gt;&amp;gt; Regards,
&amp;gt;&amp;gt; Taavi
&amp;gt;
&amp;gt;
&amp;gt; Splended hunting. I've installed it and it works fine, except that  
&amp;gt; it fails to recognise the single open quote correctly. You need to  
&amp;gt; fix these lines
&amp;gt;
&amp;gt; 		&amp;lt;key&amp;gt;Open Strings 2&amp;lt;/key&amp;gt;
&amp;gt; 		&amp;lt;string&amp;gt;&amp;lt;/string&amp;gt;
&amp;gt;
&amp;gt; to read
&amp;gt; 		&amp;lt;key&amp;gt;Open Strings 2&amp;lt;/key&amp;gt;
&amp;gt; 		&amp;lt;string&amp;gt;`&amp;lt;/string&amp;gt;
&amp;gt;
&amp;gt;
&amp;gt;
&amp;gt; I have also made a couple of personal tweaks: it now recognises all  
&amp;gt; SSC packages. I've emailed this version to DataNinja so hopefully  
&amp;gt; it will be posted on his/her site.
&amp;gt;
&amp;gt; Ronán Conroy
&amp;gt; rconroy@rcsi.ie
&amp;gt;
&amp;gt;
&amp;gt;
&amp;gt;
&amp;gt; *
&amp;gt; *   For searches and help try:
&amp;gt; *   http://www.stata.com/support/faqs/res/findit.html
&amp;gt; *   http://www.stata.com/support/statalist/faq
&amp;gt; *   http://www.ats.ucla.edu/stat/stata/&lt;/p&gt;&lt;p class="mobile-post"&gt;*
*   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/&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15088145-114304970906037657?l=statalist.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114304970906037657'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114304970906037657'/><link rel='alternate' type='text/html' href='http://statalist.blogspot.com/2006/03/re-st-stata-syntax-colouri_114304970906037657.html' title='Re: st: STATA syntax colouring in TextWrangler'/><author><name>statalist member</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-15088145.post-114304847898506454</id><published>2006-03-22T12:27:00.000-05:00</published><updated>2006-03-22T12:28:00.406-05:00</updated><title type='text'>Re: st: GOOGLE ANSWERS FORWARDED</title><content type='html'>&lt;p class="mobile-post"&gt;I could not agree more--in this case, it seems as though someone is
charging for help that they are soliciting from a free source, and
   http://answers.google.com/answers/
says "Researchers are ready to answer your question for as little as
$2.50 -- usually within 24 hours" which I suppose is why "It's pretty
urgent."&lt;/p&gt;&lt;p class="mobile-post"&gt;This is at least as objectionable as students seeking help on graded
problem sets.&lt;/p&gt;&lt;p class="mobile-post"&gt;On 3/22/06, n j cox &amp;lt;n.j.cox@durham.ac.uk&amp;gt; wrote:
&amp;gt; What is this?
&amp;gt;
&amp;gt; I propose three simple principles:
&amp;gt;
&amp;gt; 1. If someone wants to join Statalist and post to it, they should
&amp;gt; feel welcome, and they should read the FAQ to see how we operate.
&amp;gt; Nothing new there.
&amp;gt;
&amp;gt; 2. If someone wants to post something to Statalist on behalf of someone
&amp;gt; else, that's OK so long as they explicitly undertake to answer
&amp;gt; subsidiary questions and forward the answers.
&amp;gt;
&amp;gt; 3. Otherwise I see zero point in answering questions like this, as
&amp;gt; we have no assurances of an answer being seen, or "someone" or "Martin"
&amp;gt; answering any questions it raises. The appeal to urgency is also
&amp;gt; objectionable.
&amp;gt;
&amp;gt; Nick
&amp;gt; n.j.cox@durham.ac.uk
&amp;gt;
&amp;gt; --------------------------------------------------------------------------------
&amp;gt; From: noah_kauffman@prusec.com
&amp;gt; Subject: st: GOOGLE ANSWERS FORWARDED
&amp;gt; Date: Wed, 22 Mar 2006 10:34:11 -0500
&amp;gt;
&amp;gt; Someone @ google answers asks:
&amp;gt;
&amp;gt;
&amp;gt;   Ok, I'm trying to run a
&amp;gt;   fixed-effects panel in stata.
&amp;gt;   My regression: (where var1 is the
&amp;gt;   depend. variable)
&amp;gt;
&amp;gt;   (PLEASE SEE DATA AT END) - Data
&amp;gt;   pasted from excel into stata via
&amp;gt;   editor
&amp;gt;   Stata commands were as follows:
&amp;gt;
&amp;gt;   "tsset id year"
&amp;gt;   "gen var1 = ln(x3)"
&amp;gt;   "gen var2 = ln(var 1[_n-1])"   ie.
&amp;gt;   require ln(x3 i,t-1)
&amp;gt;   "gen var3 = ln(x2)"
&amp;gt;   "gen var4 = ln(5 +x1)"
&amp;gt;
&amp;gt;   xtreg var1 var2 var3 var4, i(id), fe
&amp;gt;
&amp;gt;   Now for the coefficient on var2 I
&amp;gt;   get 0.177, and I'm looking for
&amp;gt;   something around the 0.5 region.
&amp;gt;   I've gone wrong somewhere -  can
&amp;gt;   someone please help???
&amp;gt;   It's pretty urgent as I need this by
&amp;gt;   Thursday morning at latest. If it
&amp;gt;   helps, I'm trying to estiamte the
&amp;gt;   model on page 1146 for OECD
&amp;gt;   countries, (but with my own data) in
&amp;gt;   Islam's paper: "Growth Empirics:
&amp;gt;   A Panel Data Approach" (1995)
&amp;gt;   I'm online all the time, so if
&amp;gt;   necessarty, I can clarify things
&amp;gt;   beforehand.
&amp;gt;
&amp;gt; &amp;lt;zap&amp;gt;&lt;/p&gt;&lt;p class="mobile-post"&gt;*
*   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/&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15088145-114304847898506454?l=statalist.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114304847898506454'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114304847898506454'/><link rel='alternate' type='text/html' href='http://statalist.blogspot.com/2006/03/re-st-google-answers-forwarded_22.html' title='Re: st: GOOGLE ANSWERS FORWARDED'/><author><name>statalist member</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-15088145.post-114304446099649835</id><published>2006-03-22T11:21:00.000-05:00</published><updated>2006-03-22T11:21:01.920-05:00</updated><title type='text'>RE: st: Naming convention, Ideas?</title><content type='html'>&lt;p class="mobile-post"&gt;Thank you Nick(s)!  I hadn't thought of the colon approach or the major minor subcommand route.  And one module certainly *is* easier to maintain, document, and support.&lt;/p&gt;&lt;p class="mobile-post"&gt;I am glad I posted for a query I thought might seem trivial.&lt;/p&gt;&lt;p class="mobile-post"&gt;pj&lt;/p&gt;&lt;p class="mobile-post"&gt;Nick Winter
&amp;gt; Maybe something that works off the notion of "generalized."
&amp;gt; 
&amp;gt; One option would be to use the prefix approach, to create a 
&amp;gt; syntax like:
&amp;gt; 
&amp;gt;    . genmanip : merge ...
&amp;gt; 
&amp;gt;    . genmanip : append ...
&amp;gt; 
&amp;gt; and so on.  Then you have only one .ado file to maintain, easily 
&amp;gt; allowing options that apply to your command (distinct from the 
&amp;gt; append, merge, etc. options), etc.
&amp;gt; 
&amp;gt; See -help _on_colon_parse- for a Stata command that helps 
&amp;gt; parsing that syntax.
&amp;gt; 
&amp;gt; I'm not sure -genmanip- is a great name, but something like that?
&amp;gt; 
&amp;gt; --Nick Winter
&amp;gt; 
&amp;gt; 
&amp;gt; 
&amp;gt; At 10:10 AM 3/22/2006, you wrote:
&amp;gt; &amp;gt;I am looking into writing a suite of wrapper data management 
&amp;gt; &amp;gt;commands around merge, mmerge, append, joinby, and cross that can 
&amp;gt; &amp;gt;either take a stata data file, gzip compressed data file or simply a 
&amp;gt; &amp;gt;comma or tab delimited text file as the -using- argument, e.g. 
&amp;gt; &amp;gt;&amp;lt;cmd_name&amp;gt; using *.dta | *.dta.gz | *.dgz | *.txt | *.cvs [, * ].
&amp;gt; &amp;gt;
&amp;gt; &amp;gt;Two questions:
&amp;gt; &amp;gt;1) Any ideas w/ regard to a consistent naming convention that could 
&amp;gt; &amp;gt;be used? as I'd like to get it right the first time. I am not very 
&amp;gt; &amp;gt;fond of using an integer as a suffix a la cf2, cf3 for various 
&amp;gt; &amp;gt;reasons (e.g not very informative, unclear if integers imply 
&amp;gt; &amp;gt;incremental functionality, can conflict with others' names).  So far 
&amp;gt; &amp;gt;I thought of:
&amp;gt; &amp;gt;
&amp;gt; &amp;gt;- mmergeplus, appendplus, joinbyplus (but rather long)
&amp;gt; &amp;gt;- aappend, jjoinby, (but look like typos, besides mmerge 
&amp;gt; already exists)
&amp;gt; &amp;gt;
&amp;gt; &amp;gt;2) Would anyone find these useful, i.e. should they be posted on SSC?
 &lt;/p&gt;&lt;p class="mobile-post"&gt;*
*   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/&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15088145-114304446099649835?l=statalist.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114304446099649835'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114304446099649835'/><link rel='alternate' type='text/html' href='http://statalist.blogspot.com/2006/03/re-st-naming-convention-id_114304446099649835.html' title='RE: st: Naming convention, Ideas?'/><author><name>statalist member</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-15088145.post-114304333134806058</id><published>2006-03-22T11:02:00.000-05:00</published><updated>2006-03-22T11:02:11.493-05:00</updated><title type='text'>Re: st: Mata function stata() within program</title><content type='html'>&lt;p class="mobile-post"&gt;Many thanks for this. I will carefully look at it. It seems that this will 
make the program much faster, which would be _very_ important. The snippet 
will often run more than a million times ...&lt;/p&gt;&lt;p class="mobile-post"&gt;William Gould, Stata wrote:
&amp;gt; Ulrich Kohler &amp;lt;kohler@wz-berlin.de&amp;gt; wrote,
&amp;gt;
&amp;gt; &amp;gt; I have a Mata function which looks as follows:
&amp;gt; &amp;gt;
&amp;gt; &amp;gt; -------------------------------------lsq.mata--
&amp;gt; &amp;gt; (...)
&amp;gt; &amp;gt; // Mata Function to extract the substitution costs from subcost-matrix
&amp;gt; &amp;gt; void showhash(real rowvector R)
&amp;gt; &amp;gt; {
&amp;gt; &amp;gt;        string scalar key1
&amp;gt; &amp;gt;        st_local("key1",key1)
&amp;gt; &amp;gt;        key1 = strofreal(R[1,2])
&amp;gt; &amp;gt;        st_local("key1",key1)
&amp;gt; &amp;gt;        stata("local hash1 = mod(`key1',197)")
&amp;gt; &amp;gt; }
&amp;gt; &amp;gt;
&amp;gt; &amp;gt; (...)
&amp;gt; &amp;gt;------------------------------------------------
&amp;gt;
&amp;gt; and Uli notes that when he runs it, he gets an error,
&amp;gt;
&amp;gt; &amp;gt; : R = 2,3,5,4
&amp;gt; &amp;gt; : showhash(R)
&amp;gt; &amp;gt;
&amp;gt; &amp;gt; invalid syntax
&amp;gt; &amp;gt;                  stata():  3598  Stata returned error
&amp;gt; &amp;gt;               showhash():     -  function returned error
&amp;gt; &amp;gt;                  &amp;lt;istmt&amp;gt;:     -  function returned error
&amp;gt; &amp;gt; r(3598);
&amp;gt;
&amp;gt; Alan Riley &amp;lt;ariley@stata.com&amp;gt; has already given a solution, and suggested
&amp;gt; the line
&amp;gt;
&amp;gt;          stata("local hash1 = mod(`key1',197)")
&amp;gt;
&amp;gt; be changed to read
&amp;gt;
&amp;gt;          stata("local hash1 = mod(\`key1',197)")
&amp;gt;
&amp;gt; Alan's right, but his solution is too tricky for me.  Moreover, his
&amp;gt; solution shows he is still thinking an ado mode rather than Mata mode.
&amp;gt;
&amp;gt; My suggested solution is
&amp;gt;
&amp;gt;          stata("local hash1 = mod("  +  key1  +  ", 197)")
&amp;gt;
&amp;gt; and, with my solution, Uli's code can be simplified to read,
&amp;gt;
&amp;gt;
&amp;gt;         void showhash(real rowvector R)
&amp;gt;         {
&amp;gt;                string scalar key1
&amp;gt;
&amp;gt;                key1 = strofreal(R[1,2])
&amp;gt;                stata("local hash1 = mod("  +  key1  +  ", 197)")
&amp;gt;         }
&amp;gt;
&amp;gt; or even
&amp;gt;
&amp;gt;         void showhash(real rowvector R)
&amp;gt;         {
&amp;gt;                stata("local hash1 = mod("  +  strofreal(R[1,2])  +  ",
&amp;gt; 197)") }
&amp;gt;
&amp;gt; Let me expound on the ado versus the Mata way of thinking.
&amp;gt;
&amp;gt; Uli wanted to run the Stata command
&amp;gt;
&amp;gt;         local hash1 = mod(_______, 197)
&amp;gt;
&amp;gt; where he substituted the value from Mata matrix R[1,2] for ______.
&amp;gt; Why Uli wanted to do this, we don't know, nor care.
&amp;gt;
&amp;gt; The ado way of thinking says we substitute a macro for _____, and arrange
&amp;gt; for the macro to contain R[1,2], so when the macro is substituted by
&amp;gt; Stata, we obtrain the desired result.  Good way of thinking, when you
&amp;gt; are writing an ado-file.
&amp;gt;
&amp;gt; The Mata way of thinking is more direct:  we need to construct a string
&amp;gt;
&amp;gt;         "local hash1 = mod(_______, 197)"
&amp;gt;
&amp;gt; where where R[1,2] is substitued for _____, and we can just use the
&amp;gt; standard operators to do that,
&amp;gt;
&amp;gt;         "local hash1 = mod("  +  strofreal(R[1,2])  +  ", 197)"
&amp;gt;
&amp;gt; Here's a good rule:  It's perfectly okay to obtain input from macros, or
&amp;gt; post output to macros.  That is one way Mata can communicate with
&amp;gt; ado-files. If you have to use macros to obtain your result, however, you
&amp;gt; are thinking ado, not Mata.  There's a simpler, more direct way.
&amp;gt;
&amp;gt; -- Bill
&amp;gt; wgould@stata.com
&amp;gt; *
&amp;gt; *   For searches and help try:
&amp;gt; *   http://www.stata.com/support/faqs/res/findit.html
&amp;gt; *   http://www.stata.com/support/statalist/faq
&amp;gt; *   http://www.ats.ucla.edu/stat/stata/&lt;/p&gt;&lt;p class="mobile-post"&gt;-- 
kohler@wz-berlin.de
+49 (030) 25491-361
*
*   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/&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15088145-114304333134806058?l=statalist.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114304333134806058'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114304333134806058'/><link rel='alternate' type='text/html' href='http://statalist.blogspot.com/2006/03/re-st-mata-function-stata-_114304333134806058.html' title='Re: st: Mata function stata() within program'/><author><name>statalist member</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-15088145.post-114304309044370261</id><published>2006-03-22T10:58:00.000-05:00</published><updated>2006-03-22T10:58:10.543-05:00</updated><title type='text'>Re: st: GOOGLE ANSWERS FORWARDED</title><content type='html'>&lt;p class="mobile-post"&gt;What is this?&lt;/p&gt;&lt;p class="mobile-post"&gt;I propose three simple principles:&lt;/p&gt;&lt;p class="mobile-post"&gt;1. If someone wants to join Statalist and post to it, they should
feel welcome, and they should read the FAQ to see how we operate. 
Nothing new there.&lt;/p&gt;&lt;p class="mobile-post"&gt;2. If someone wants to post something to Statalist on behalf of someone 
else, that's OK so long as they explicitly undertake to answer 
subsidiary questions and forward the answers.&lt;/p&gt;&lt;p class="mobile-post"&gt;3. Otherwise I see zero point in answering questions like this, as
we have no assurances of an answer being seen, or "someone" or "Martin"
answering any questions it raises. The appeal to urgency is also
objectionable.&lt;/p&gt;&lt;p class="mobile-post"&gt;Nick
n.j.cox@durham.ac.uk&lt;/p&gt;&lt;p class="mobile-post"&gt;--------------------------------------------------------------------------------
From: noah_kauffman@prusec.com
Subject: st: GOOGLE ANSWERS FORWARDED
Date: Wed, 22 Mar 2006 10:34:11 -0500&lt;/p&gt;&lt;p class="mobile-post"&gt;Someone @ google answers asks:&lt;/p&gt;&lt;p class="mobile-post"&gt;   Ok, I'm trying to run a
   fixed-effects panel in stata.
   My regression: (where var1 is the
   depend. variable)&lt;/p&gt;&lt;p class="mobile-post"&gt;   (PLEASE SEE DATA AT END) - Data
   pasted from excel into stata via
   editor
   Stata commands were as follows:&lt;/p&gt;&lt;p class="mobile-post"&gt;   "tsset id year"
   "gen var1 = ln(x3)"
   "gen var2 = ln(var 1[_n-1])"   ie.
   require ln(x3 i,t-1)
   "gen var3 = ln(x2)"
   "gen var4 = ln(5 +x1)"&lt;/p&gt;&lt;p class="mobile-post"&gt;   xtreg var1 var2 var3 var4, i(id), fe&lt;/p&gt;&lt;p class="mobile-post"&gt;   Now for the coefficient on var2 I
   get 0.177, and I'm looking for
   something around the 0.5 region.
   I've gone wrong somewhere -  can
   someone please help???
   It's pretty urgent as I need this by
   Thursday morning at latest. If it
   helps, I'm trying to estiamte the
   model on page 1146 for OECD
   countries, (but with my own data) in
   Islam's paper: "Growth Empirics:
   A Panel Data Approach" (1995)
   I'm online all the time, so if
   necessarty, I can clarify things
   beforehand.&lt;/p&gt;&lt;p class="mobile-post"&gt;&amp;lt;zap&amp;gt;&lt;/p&gt;&lt;p class="mobile-post"&gt;*
*   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/&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15088145-114304309044370261?l=statalist.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114304309044370261'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114304309044370261'/><link rel='alternate' type='text/html' href='http://statalist.blogspot.com/2006/03/re-st-google-answers-forwarded.html' title='Re: st: GOOGLE ANSWERS FORWARDED'/><author><name>statalist member</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-15088145.post-114304240287768814</id><published>2006-03-22T10:46:00.000-05:00</published><updated>2006-03-22T10:46:43.023-05:00</updated><title type='text'>st: GOOGLE ANSWERS FORWARDED</title><content type='html'>&lt;p class="mobile-post"&gt;
Someone @ google answers asks:&lt;/p&gt;&lt;p class="mobile-post"&gt;  Ok, I'm trying to run a
  fixed-effects panel in stata.
  My regression: (where var1 is the
  depend. variable)&lt;/p&gt;&lt;p class="mobile-post"&gt;  (PLEASE SEE DATA AT END) - Data
  pasted from excel into stata via
  editor
  Stata commands were as follows:&lt;/p&gt;&lt;p class="mobile-post"&gt;  "tsset id year"
  "gen var1 = ln(x3)"
  "gen var2 = ln(var 1[_n-1])"   ie.
  require ln(x3 i,t-1)
  "gen var3 = ln(x2)"
  "gen var4 = ln(5 +x1)"&lt;/p&gt;&lt;p class="mobile-post"&gt;  xtreg var1 var2 var3 var4, i(id), fe&lt;/p&gt;&lt;p class="mobile-post"&gt;  Now for the coefficient on var2 I
  get 0.177, and I'm looking for
  something around the 0.5 region.
  I've gone wrong somewhere -  can
  someone please help???
  It's pretty urgent as I need this by
  Thursday morning at latest. If it
  helps, I'm trying to estiamte the
  model on page 1146 for OECD
  countries, (but with my own data) in
  Islam's paper: "Growth Empirics:
  A Panel Data Approach" (1995)
  I'm online all the time, so if
  necessarty, I can clarify things
  beforehand.&lt;/p&gt;&lt;p class="mobile-post"&gt;  Thanks for your help,&lt;/p&gt;&lt;p class="mobile-post"&gt;  Martin
  id          Year            x1
                 x2            x3
  69          1980        1.662461763
        14.98616639
  17366.351
  69          1985        1.751607907
        11.13300528
  16621.06196
  69          1990        1.687373049
        9.304076135
  27174.53416
  69          1995        1.145010297
        11.69968344
  30926.21307
  69          2000        1.287333281
        13.37070116
  30192.66929
  70          1980        0.822325571
        19.58621955
  16393.97505
  70          1985        0.810340975
        15.2813291        13144.98494
  70          1990        0.524329844
        13.18757172
  30948.48975
  70          1995        0.535188192
        16.75931281
  43827.01387
  70          2000        0.210425117
        15.7938949        35069.97475
  71          1980        0.602471123
        21.51876931
  18890.07907
  71          1985        0.450791288
        18.81103302
  12464.20844
  71          1990        0.109973609
        17.44272923
  29622.43449
  71          1995        0.188184945
        16.84773807
  41116.6454
  71          2000        0.143463565
        16.66518245
  33698.04446
  72          1980        1.793759025
        13.47103394
  15883.10011
  72          1985        1.13896003
   10.38388336            19731.97361
  72          1990        1.329878954
        10.02094259
  30365.61038
  72          1995        1.011132436
        10.51075658
  29259.80686
  72          2000        1.090468632
        12.83921854
  33940.05624
  73          1980        0.477478563
        15.80453557
  20635.75266
  73          1985        0.474309767
        14.65851051
  17595.00342
  73          1990        0.33966525
   10.00934545            38504.07008
  73          1995        0.395259882
        11.23964728
  51179.45169
  73          2000        0.16514965
   7.732210879            44379.18977
  74          1980        0.423406049
        20.10184597
  16151.36943
  74          1985        0.533425877
        17.03576594
  16286.31437
  74          1990        0.17987329
   15.98985483            40788.69617
  74          1995        0.318379132
        14.12707098
  38004.6729
  74          2000        0.300608318
        13.51151556
  34586.6218
  75          1980        0.893883928
        22.8138795        19857.92277
  75          1985        0.961587541
        19.68265195
  14615.15092
  75          1990        0.522867504
        19.65530273
  32582.27016
  75          1995        0.285397244
        15.93692676
  41063.60444
  75          2000        0.236410263
        16.32833599
  34134.14132
  76          1980        1.32316342
   20.73041017            7904.237485
  76          1985        0.922498984
        19.56876374
  6319.746039
  76          1990        0.995140916
        21.41446384
  12340.93113
  76          1995        0.903410832
        16.741426         16436.26653
  76          2000        0.442745708
        17.34889112
  15296.49573
  77          1980        1.6190352
   14.66842754            10467.50384
  77          1985        0.984051537
        13.11345854
  9644.005897
  77          1990        0.52640211
   13.47451789            22004.14509
  77          1995        1.573243946
        15.01458907
  28639.96061
  77          2000        2.010459298
        16.43950604
  37062.08373
  78          1980        0.68755784
   18.83731856            12316.87681
  78          1985        0.85343638
   17.14138777            11127.02382
  78          1990        0.326057221
        19.51414315
  28247.96617
  78          1995        0.200326573
        21.82167717
  27807.58652
  78          2000        -0.29931545
        17.18042319
  27566.33909
  79          1980        0.801608658
        22.79975178
  13501.75246
  79          1985        0.915264718
        18.50416861
  16474.29537
  79          1990        0.723636851
        19.17730187
  35344.51147
  79          1995        0.19249092
   22.90417495            60613.2475
  79          2000        -0.145385709
        19.08132976
  54827.36543
  80          1980        1.387616421
        14.94607015
  19026.16294
  80          1985        1.025591315
        11.06662356
  13313.43306
  80          1990        0.75005838
   9.991219054            28602.29705
  80          1995        0.432385881
        15.01848763
  39256.06623
  80          2000        0.500530203
        16.40487928
  34288.62992
  81          1980        0.828691467
        20.71323278
  11601.11144
  81          1985        1.311964138
        20.45743036
  10716.73514
  81          1990        1.3691672
   18.28935167            19337.00316
  81          1995        1.352106185
        19.59779156
  25288.2837
  81          2000        0.900292987
        20.21200377
  20582.89207
  82          1980        0.587584723
        15.61925349
  24668.24692
  82          1985        0.682825353
        11.2998007        23825.56852
  82          1990        0.543734919
        9.963804811
  42244.72488
  82          1995        0.525269517
        11.79609955
  52537.70169
  82          2000        0.674729984
        16.59774348
  57349.30306
  83          1980        1.462021324
        19.39049446
  4808.80038
  83          1985        0.692344139
        10.83176142
  3804.655031
  83          1990        0.24932822
   14.84951396            10872.80679
  83          1995        0.165472127
        18.03693854
  16241.68266
  83          2000        1.032193538
        18.57355586
  15384.17332
  84          1980        1.224982892
        17.50583952
  9429.244045
  84          1985        1.067391322
        14.1583388        6892.579016
  84          1990        0.755676566
        12.92168201
  19659.18951
  84          1995        0.591949849
        11.73567215
  21807.56001
  84          2000        0.647429503
        10.58827526
  20354.88874
  85          1980        0.255875886
        18.00839687
  24331.0159
  85          1985        0.220629595
        16.16479109
  19377.70035
  85          1990        0.47660532
   15.96377273            43624.07581
  85          1995        0.412345421
        15.32120281
  44019.86808
  85          2000        0.273147601
        14.41038065
  41946.34968
  86          1980        0.496489298
        15.48425823
  26419.38091
  86          1985        0.941437445
        13.88066924
  22534.61193
  86          1990        0.952530759
        14.10603859
  51114.72784
  86          1995        0.641787638
        14.00834142
  65537.35073
  86          2000        0.224554799
        17.41319943
  50647.46892
  87          1980        2.612506141
        17.82209964
  2843.972229
  87          1985        3.50641537
   15.35851228            2251.386322
  87          1990        2.741307328
        16.79774136
  4417.057814
  87          1995        2.819981075
        18.63495028
  4297.528683
  87          2000        2.376735812
        13.4780134        4493.247857
  88          1980        0.484872291
        23.73434618
  14863.17762
  88          1985        0.544248613
        21.78829843
  12241.47715
  88          1990        0.171420325
        23.40476948
  26392.5887
  88          1995        0.177399289
        17.48076441
  30017.22473
  88          2000        0.2890547
   19.05241986            37523.02325
  89          1980        1.510727766
        16.39963029
  18387.85317
  89          1985        0.907081959
        12.01908341
  26494.88105
  89          1990        0.845319833
        12.206305         35104.42998
  89          1995        1.224515978
        14.20890757
  42224.98562
  89          2000        1.382534638
        12.96683686
  52391.32554&lt;/p&gt;&lt;p class="mobile-post"&gt;*
*   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/&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15088145-114304240287768814?l=statalist.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114304240287768814'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114304240287768814'/><link rel='alternate' type='text/html' href='http://statalist.blogspot.com/2006/03/st-google-answers-forwarded.html' title='st: GOOGLE ANSWERS FORWARDED'/><author><name>statalist member</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-15088145.post-114304189706388422</id><published>2006-03-22T10:38:00.000-05:00</published><updated>2006-03-22T10:38:17.066-05:00</updated><title type='text'>Re: st: Naming convention, Ideas?</title><content type='html'>&lt;p class="mobile-post"&gt;Maybe something that works off the notion of "generalized."&lt;/p&gt;&lt;p class="mobile-post"&gt;One option would be to use the prefix approach, to create a syntax like:&lt;/p&gt;&lt;p class="mobile-post"&gt;   . genmanip : merge ...&lt;/p&gt;&lt;p class="mobile-post"&gt;   . genmanip : append ...&lt;/p&gt;&lt;p class="mobile-post"&gt;and so on.  Then you have only one .ado file to maintain, easily 
allowing options that apply to your command (distinct from the 
append, merge, etc. options), etc.&lt;/p&gt;&lt;p class="mobile-post"&gt;See -help _on_colon_parse- for a Stata command that helps parsing that syntax.&lt;/p&gt;&lt;p class="mobile-post"&gt;I'm not sure -genmanip- is a great name, but something like that?&lt;/p&gt;&lt;p class="mobile-post"&gt;--Nick Winter&lt;/p&gt;&lt;p class="mobile-post"&gt;At 10:10 AM 3/22/2006, you wrote:
&amp;gt;I am looking into writing a suite of wrapper data management 
&amp;gt;commands around merge, mmerge, append, joinby, and cross that can 
&amp;gt;either take a stata data file, gzip compressed data file or simply a 
&amp;gt;comma or tab delimited text file as the -using- argument, e.g. 
&amp;gt;&amp;lt;cmd_name&amp;gt; using *.dta | *.dta.gz | *.dgz | *.txt | *.cvs [, * ].
&amp;gt;
&amp;gt;Two questions:
&amp;gt;1) Any ideas w/ regard to a consistent naming convention that could 
&amp;gt;be used? as I'd like to get it right the first time. I am not very 
&amp;gt;fond of using an integer as a suffix a la cf2, cf3 for various 
&amp;gt;reasons (e.g not very informative, unclear if integers imply 
&amp;gt;incremental functionality, can conflict with others' names).  So far 
&amp;gt;I thought of:
&amp;gt;
&amp;gt;- mmergeplus, appendplus, joinbyplus (but rather long)
&amp;gt;- aappend, jjoinby, (but look like typos, besides mmerge already exists)
&amp;gt;
&amp;gt;2) Would anyone find these useful, i.e. should they be posted on SSC?
&amp;gt;
&amp;gt;
&amp;gt;Patrick Joly
&amp;gt;
&amp;gt;*
&amp;gt;*   For searches and help try:
&amp;gt;*   http://www.stata.com/support/faqs/res/findit.html
&amp;gt;*   http://www.stata.com/support/statalist/faq
&amp;gt;*   http://www.ats.ucla.edu/stat/stata/&lt;/p&gt;&lt;p class="mobile-post"&gt;________________________________________________________
Nicholas J. G. Winter                     607.255.8819 t
Assistant Professor                       607.255.4530 f
Department of Government              nw53@cornell.edu e
Cornell University        falcon.arts.cornell.edu/nw53 w
308 White Hall
Ithaca, NY 14853-4601 &lt;/p&gt;&lt;p class="mobile-post"&gt;*
*   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/&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15088145-114304189706388422?l=statalist.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114304189706388422'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114304189706388422'/><link rel='alternate' type='text/html' href='http://statalist.blogspot.com/2006/03/re-st-naming-convention-ideas_22.html' title='Re: st: Naming convention, Ideas?'/><author><name>statalist member</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-15088145.post-114304187704753089</id><published>2006-03-22T10:37:00.000-05:00</published><updated>2006-03-22T10:37:57.186-05:00</updated><title type='text'>Re: st: Naming convention, Ideas?</title><content type='html'>&lt;p class="mobile-post"&gt;My suggestion is none of these. Find a suitable
name, say -pjcombine-, and then write a command
with subcommands, so that your syntax is&lt;/p&gt;&lt;p class="mobile-post"&gt;pjcombine append &amp;lt;whatever&amp;gt;
pjcombine merge &amp;lt;whatever&amp;gt;
...&lt;/p&gt;&lt;p class="mobile-post"&gt;Reasoning:&lt;/p&gt;&lt;p class="mobile-post"&gt;0. There are many precedents in Stata itself.&lt;/p&gt;&lt;p class="mobile-post"&gt;1. One program is easier to keep track of than several.&lt;/p&gt;&lt;p class="mobile-post"&gt;2. -combine- is a good word, but StataCorp lay claim
to all the words in the English language. Some of us
have forgotten that in the past -- "accidentally on
purpose", perhaps -- and you might choose to forget that too.
At worst, StataCorp may grab "your" program name and either
your program has been superseded, or you need to change
the name.&lt;/p&gt;&lt;p class="mobile-post"&gt;3. -pj- would be both modest and good PR.&lt;/p&gt;&lt;p class="mobile-post"&gt;Put them on SSC!&lt;/p&gt;&lt;p class="mobile-post"&gt;P.S. on integers: there are two conventions in use. Typically
low integers (esp. 2, 3) mean versions of the command; high
integers (esp. 5, 6, 7, 8) mean versions of Stata it works
with. In practice that is less confusing than it seems, as
although many programs go through much revision, programmers
don't change names that often.&lt;/p&gt;&lt;p class="mobile-post"&gt;If &amp;lt;program&amp;gt;&amp;lt;n&amp;gt; means "works with Stata &amp;lt;n&amp;gt;", then I suggest
that should always be explicit in its help.&lt;/p&gt;&lt;p class="mobile-post"&gt;Nick
n.j.cox@durham.ac.uk&lt;/p&gt;&lt;p class="mobile-post"&gt;Joly.Patrick&lt;/p&gt;&lt;p class="mobile-post"&gt;I am looking into writing a suite of wrapper data management commands 
around merge, mmerge, append, joinby, and cross that can either take a 
stata data file, gzip compressed data file or simply a comma or tab 
delimited text file as the -using- argument, e.g. &amp;lt;cmd_name&amp;gt; using *.dta 
| *.dta.gz | *.dgz | *.txt | *.cvs [, * ].&lt;/p&gt;&lt;p class="mobile-post"&gt;Two questions:
1) Any ideas w/ regard to a consistent naming convention that could be 
used? as I'd like to get it right the first time. I am not very fond of 
using an integer as a suffix a la cf2, cf3 for various reasons (e.g not 
very informative, unclear if integers imply incremental functionality, 
can conflict with others' names).  So far I thought of:&lt;/p&gt;&lt;p class="mobile-post"&gt;- mmergeplus, appendplus, joinbyplus (but rather long)
- aappend, jjoinby, (but look like typos, besides mmerge already exists)&lt;/p&gt;&lt;p class="mobile-post"&gt;2) Would anyone find these useful, i.e. should they be posted on SSC?&lt;/p&gt;&lt;p class="mobile-post"&gt;*
*   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/&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15088145-114304187704753089?l=statalist.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114304187704753089'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114304187704753089'/><link rel='alternate' type='text/html' href='http://statalist.blogspot.com/2006/03/re-st-naming-convention-ideas.html' title='Re: st: Naming convention, Ideas?'/><author><name>statalist member</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-15088145.post-114304162777473574</id><published>2006-03-22T10:33:00.000-05:00</published><updated>2006-03-22T10:33:49.446-05:00</updated><title type='text'>st: RE: left-truncation of entry in survival analysis</title><content type='html'>&lt;p class="mobile-post"&gt;I am assuming that the covariates in the 2 models are all
time-independent. In general, the 2 models are not equivalent. However,
it is entirely possible that they might give the same parameter
estimates, in at least some specific sets of data.&lt;/p&gt;&lt;p class="mobile-post"&gt;Survival analyses (as their name suggests) are based on events whereby
one subject is observed to survive another, ie one subject at risk on a
particular day survives to the end of that day and another subject at
risk on the same day is dead by the end of that day. The two models are
different in what is meant by "the same day" for the two subjects. In
the first model, we compare the fate of Subject A on Day X of the life
of Subject A with the fate of Subject B on Day X of the life of Subject
B, for all pairs of Subjects A and B who were both under observation in
the study on Day X of their respective lives. In the second model, we
compare the fate of Subject A on Day Y of Subject A's study time
(measured from Subject A's entry into the study) with the fate of
Subject B on Day Y of Subject B's study time (measured from Subject B's
entry into the study), for all pairs of Subjects A and B who were both
under observation on Day Y of their respective study time windows.&lt;/p&gt;&lt;p class="mobile-post"&gt;In a specific study, it might be the case that, for each Subject A who
died on Day X of his/her life and Day Y of his/her study time, the set
of Subjects B who survived through the Days X of their respective lives
in the study might be the same set as the set of Subjects B who survived
through the Days Y of their respective study times in the study. This
might especially be the case if the number of subjects is small and/or
deaths in the study are sparse. For such a specific study, the two Cox
regressions will give the same parameter estimates. However, this will
not be the case for all studies. For instance, in some studies, there
will be pairs of Subjects A and B, such that Subject A dies in the study
at 100 years of age after having entered the study at 99 years of age,
whereas Subject B dies in the study at 40 years of age after having
entered the study at 30 years of age. In this case, the first model will
assume that neither patient was observed to survive the other, whereas
the second model will assume that Subject B has survived Subject A, even
though Subject B died younger.&lt;/p&gt;&lt;p class="mobile-post"&gt;I hope this helps.&lt;/p&gt;&lt;p class="mobile-post"&gt;Roger&lt;/p&gt;&lt;p class="mobile-post"&gt;Roger Newson
Lecturer in Medical Statistics
POSTAL ADDRESS:
Respiratory Epidemiology and Public Health Group
National Heart and Lung Institute at Imperial College London
St Mary's Campus
Norfolk Place
London W2 1PG
STREET ADDRESS:
Respiratory Epidemiology and Public Health Group
National Heart and Lung Institute at Imperial College London
47 Praed Street
Paddington
London W1 1NR
TELEPHONE: (+44) 020 7594 0939
FAX: (+44) 020 7594 0942
EMAIL: r.newson@imperial.ac.uk
WEBSITE: http://www.imperial.ac.uk/nhli/r.newson/
Opinions expressed are those of the author, not of the institution.&lt;/p&gt;&lt;p class="mobile-post"&gt;-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Sue Chinn
Sent: 22 March 2006 12:47
To: statalist@hsphsun2.harvard.edu
Subject: st: left-truncation of entry in survival analysis&lt;/p&gt;&lt;p class="mobile-post"&gt;Dear Statalist readers,&lt;/p&gt;&lt;p class="mobile-post"&gt;Reports of survival analysis which use age as the time scale rather than&lt;/p&gt;&lt;p class="mobile-post"&gt;time-on-study often 'adjust for delayed entry'. In Stata this is
achieved by:&lt;/p&gt;&lt;p class="mobile-post"&gt;stset age, fail(died) enter(ageatentry)&lt;/p&gt;&lt;p class="mobile-post"&gt;(see recent e-mail from Dawn Teele, or reply to st: streg from 
rgutierrez@stata.com on 19th September 2002.)&lt;/p&gt;&lt;p class="mobile-post"&gt;However, a model fitted with the above stset gives exactly the same
answer 
as one with&lt;/p&gt;&lt;p class="mobile-post"&gt;stset timeonstudy, fail(died)&lt;/p&gt;&lt;p class="mobile-post"&gt;provided timeonstudy=age-ageatentry (as it normally would, but might not&lt;/p&gt;&lt;p class="mobile-post"&gt;exactly depending how variables were calculated) and the models are
exactly 
the same. In the second model it is usual to adjust or stratify on age, 
while in the first it isn't as age is taken into account, supposedly, so&lt;/p&gt;&lt;p class="mobile-post"&gt;researchers may not have realised the equivalence.&lt;/p&gt;&lt;p class="mobile-post"&gt;So, am I missing something, or are advocates of the first model deluding&lt;/p&gt;&lt;p class="mobile-post"&gt;themselves? Can left truncation be ignored with age as the timescale?&lt;/p&gt;&lt;p class="mobile-post"&gt;Thanks&lt;/p&gt;&lt;p class="mobile-post"&gt;Sue&lt;/p&gt;&lt;p class="mobile-post"&gt;Sue Chinn
Professor of Medical Statistics
Division of Asthma, Allergy and Lung Biology
King's College London
5th Floor Capital House
42 Weston Street
London SE1 3QD&lt;/p&gt;&lt;p class="mobile-post"&gt;tel no. 020 7848 6607
fax no. 020 7848 6605&lt;/p&gt;&lt;p class="mobile-post"&gt;*
*   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/&lt;/p&gt;&lt;p class="mobile-post"&gt;*
*   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/&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15088145-114304162777473574?l=statalist.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114304162777473574'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114304162777473574'/><link rel='alternate' type='text/html' href='http://statalist.blogspot.com/2006/03/st-re-left-truncation-of-entry-in.html' title='st: RE: left-truncation of entry in survival analysis'/><author><name>statalist member</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-15088145.post-114304033045435467</id><published>2006-03-22T10:12:00.000-05:00</published><updated>2006-03-22T10:12:10.716-05:00</updated><title type='text'>st: Naming convention, Ideas?</title><content type='html'>&lt;p class="mobile-post"&gt;I am looking into writing a suite of wrapper data management commands around merge, mmerge, append, joinby, and cross that can either take a stata data file, gzip compressed data file or simply a comma or tab delimited text file as the -using- argument, e.g. &amp;lt;cmd_name&amp;gt; using *.dta | *.dta.gz | *.dgz | *.txt | *.cvs [, * ].&lt;/p&gt;&lt;p class="mobile-post"&gt;Two questions:
1) Any ideas w/ regard to a consistent naming convention that could be used? as I'd like to get it right the first time. I am not very fond of using an integer as a suffix a la cf2, cf3 for various reasons (e.g not very informative, unclear if integers imply incremental functionality, can conflict with others' names).  So far I thought of:&lt;/p&gt;&lt;p class="mobile-post"&gt;- mmergeplus, appendplus, joinbyplus (but rather long)
- aappend, jjoinby, (but look like typos, besides mmerge already exists)&lt;/p&gt;&lt;p class="mobile-post"&gt;2) Would anyone find these useful, i.e. should they be posted on SSC?&lt;/p&gt;&lt;p class="mobile-post"&gt;Patrick Joly&lt;/p&gt;&lt;p class="mobile-post"&gt;*
*   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/&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15088145-114304033045435467?l=statalist.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114304033045435467'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114304033045435467'/><link rel='alternate' type='text/html' href='http://statalist.blogspot.com/2006/03/st-naming-convention-ideas.html' title='st: Naming convention, Ideas?'/><author><name>statalist member</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-15088145.post-114303970890269978</id><published>2006-03-22T10:01:00.000-05:00</published><updated>2006-03-22T10:01:55.046-05:00</updated><title type='text'>Re: st: Mata function stata() within program</title><content type='html'>&lt;p class="mobile-post"&gt;Ulrich Kohler &amp;lt;kohler@wz-berlin.de&amp;gt; wrote, &lt;/p&gt;&lt;p class="mobile-post"&gt;&amp;gt; I have a Mata function which looks as follows:
&amp;gt; 
&amp;gt; -------------------------------------lsq.mata--
&amp;gt; (...)
&amp;gt; // Mata Function to extract the substitution costs from subcost-matrix
&amp;gt; void showhash(real rowvector R)
&amp;gt; {
&amp;gt;        string scalar key1
&amp;gt;        st_local("key1",key1)
&amp;gt;        key1 = strofreal(R[1,2])
&amp;gt;        st_local("key1",key1)
&amp;gt;        stata("local hash1 = mod(`key1',197)")
&amp;gt; }
&amp;gt;
&amp;gt; (...)
&amp;gt;------------------------------------------------&lt;/p&gt;&lt;p class="mobile-post"&gt;and Uli notes that when he runs it, he gets an error, &lt;/p&gt;&lt;p class="mobile-post"&gt;&amp;gt; : R = 2,3,5,4
&amp;gt; : showhash(R)
&amp;gt; invalid syntax
&amp;gt;                  stata():  3598  Stata returned error
&amp;gt;               showhash():     -  function returned error
&amp;gt;                  &amp;lt;istmt&amp;gt;:     -  function returned error
&amp;gt; r(3598);&lt;/p&gt;&lt;p class="mobile-post"&gt;Alan Riley &amp;lt;ariley@stata.com&amp;gt; has already given a solution, and suggested
the line &lt;/p&gt;&lt;p class="mobile-post"&gt;         stata("local hash1 = mod(`key1',197)")&lt;/p&gt;&lt;p class="mobile-post"&gt;be changed to read &lt;/p&gt;&lt;p class="mobile-post"&gt;         stata("local hash1 = mod(\`key1',197)")&lt;/p&gt;&lt;p class="mobile-post"&gt;Alan's right, but his solution is too tricky for me.  Moreover, his 
solution shows he is still thinking an ado mode rather than Mata mode.&lt;/p&gt;&lt;p class="mobile-post"&gt;My suggested solution is &lt;/p&gt;&lt;p class="mobile-post"&gt;         stata("local hash1 = mod("  +  key1  +  ", 197)")&lt;/p&gt;&lt;p class="mobile-post"&gt;and, with my solution, Uli's code can be simplified to read, &lt;/p&gt;&lt;p class="mobile-post"&gt;        void showhash(real rowvector R)
        {
               string scalar key1&lt;/p&gt;&lt;p class="mobile-post"&gt;               key1 = strofreal(R[1,2])
               stata("local hash1 = mod("  +  key1  +  ", 197)")
        }&lt;/p&gt;&lt;p class="mobile-post"&gt;or even &lt;/p&gt;&lt;p class="mobile-post"&gt;        void showhash(real rowvector R)
        {
               stata("local hash1 = mod("  +  strofreal(R[1,2])  +  ", 197)")
        }&lt;/p&gt;&lt;p class="mobile-post"&gt;Let me expound on the ado versus the Mata way of thinking.&lt;/p&gt;&lt;p class="mobile-post"&gt;Uli wanted to run the Stata command &lt;/p&gt;&lt;p class="mobile-post"&gt;        local hash1 = mod(_______, 197)&lt;/p&gt;&lt;p class="mobile-post"&gt;where he substituted the value from Mata matrix R[1,2] for ______.
Why Uli wanted to do this, we don't know, nor care.&lt;/p&gt;&lt;p class="mobile-post"&gt;The ado way of thinking says we substitute a macro for _____, and arrange 
for the macro to contain R[1,2], so when the macro is substituted by 
Stata, we obtrain the desired result.  Good way of thinking, when you 
are writing an ado-file.&lt;/p&gt;&lt;p class="mobile-post"&gt;The Mata way of thinking is more direct:  we need to construct a string &lt;/p&gt;&lt;p class="mobile-post"&gt;        "local hash1 = mod(_______, 197)"&lt;/p&gt;&lt;p class="mobile-post"&gt;where where R[1,2] is substitued for _____, and we can just use the standard
operators to do that,&lt;/p&gt;&lt;p class="mobile-post"&gt;        "local hash1 = mod("  +  strofreal(R[1,2])  +  ", 197)"&lt;/p&gt;&lt;p class="mobile-post"&gt;Here's a good rule:  It's perfectly okay to obtain input from macros, or
post output to macros.  That is one way Mata can communicate with ado-files.
If you have to use macros to obtain your result, however, you are thinking
ado, not Mata.  There's a simpler, more direct way.&lt;/p&gt;&lt;p class="mobile-post"&gt;-- Bill
wgould@stata.com
*
*   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/&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15088145-114303970890269978?l=statalist.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114303970890269978'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114303970890269978'/><link rel='alternate' type='text/html' href='http://statalist.blogspot.com/2006/03/re-st-mata-function-stata-_114303970890269978.html' title='Re: st: Mata function stata() within program'/><author><name>statalist member</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-15088145.post-114303853437959398</id><published>2006-03-22T09:42:00.000-05:00</published><updated>2006-03-22T09:42:14.520-05:00</updated><title type='text'>st: group mean pooling VAR</title><content type='html'>Dear statalist,&lt;br&gt; I'm trying to do group mean pooling of VAR regression results across an unbalanced panel (id1, year).&amp;nbsp; When I try to take the first step, creating the pool of coefficients, I used statsby, but Stata tells me I haven't tsset.&amp;nbsp; I get this:&amp;nbsp; &lt;br&gt;&lt;br&gt; &lt;font face="Courier, Courier"&gt;. tsset id1 year&lt;br&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; panel variable:&amp;nbsp; id1, 1 to 208&lt;br&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; time variable:&amp;nbsp; year, 1966 to 2002, but with a gap&lt;br&gt;&lt;br&gt; . statsby _b , by(id1) saving(varDT): varbasic ICRGliberal DirTax year, lags(1/&lt;br&gt; &amp;gt; 2)&lt;br&gt; (running varbasic on estimation sample)&lt;br&gt; time variable not set, use -tsset varname ...-&lt;br&gt; an error occurred when statsby executed varbasic&lt;br&gt; r(111);&lt;br&gt;&lt;br&gt; &lt;br&gt; &lt;/font&gt;Am I doing something wrong, and/or has someone on the list written a good routine for group mean pooling of VAR regressions across a panel?&lt;br&gt; Thanks.&lt;br&gt; Jim Mahon&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15088145-114303853437959398?l=statalist.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114303853437959398'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114303853437959398'/><link rel='alternate' type='text/html' href='http://statalist.blogspot.com/2006/03/st-group-mean-pooling-var.html' title='st: group mean pooling VAR'/><author><name>statalist member</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-15088145.post-114303795280568456</id><published>2006-03-22T09:32:00.000-05:00</published><updated>2006-03-22T09:32:33.193-05:00</updated><title type='text'>Re: st: left-truncation of entry in survival analysis</title><content type='html'>&lt;p class="mobile-post"&gt;On 22 Márta 2006, at 12:46, Sue Chinn wrote:&lt;/p&gt;&lt;p class="mobile-post"&gt;&amp;gt;
&amp;gt; So, am I missing something, or are advocates of the first model  
&amp;gt; deluding themselves? Can left truncation be ignored with age as the  
&amp;gt; timescale?&lt;/p&gt;&lt;p class="mobile-post"&gt;One powerful argument for using age as the time variable in survival  
analysis has to do with the hazard function itself. In modelling risk  
factors or prognostic factors, the shape of the hazard function is  
often treated as a high-dimensional nuisance parameter (I love that  
expression and use it as often as I can). However, in risk estimation  
the hazard function represents the absolute risk, without which the  
hazard ratios cannot be interpreted in real-life terms.&lt;/p&gt;&lt;p class="mobile-post"&gt;Using age as the time variable allows the construction of hazard  
functions spanning the age range from the youngest entry to the  
oldest exit. It allowed us, in the SCORE project, to make  
cardiovascular risk charts showing ten-year risk from datasets many  
of which contained at most 8 years of follow up.&lt;/p&gt;&lt;p class="mobile-post"&gt;Since the publication of Ed Korn's paper, there have been a number of  
papers looking to see if the modelling of risk factor effects is  
affected by the choice of time metric and the short answer seems to  
be 'not so you would notice'. I haven't been keeping up with the  
literature on this, but I don't know of a case where someone got very  
different results - does anyone else?&lt;/p&gt;&lt;p class="mobile-post"&gt;Korn's proposal appeals to my sense of elegance, as well as being a  
gift to those of us who have to deal with absolute risks.&lt;/p&gt;&lt;p class="mobile-post"&gt;Ronán Conroy
rconroy@rcsi.ie&lt;/p&gt;&lt;p class="mobile-post"&gt;*
*   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/&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15088145-114303795280568456?l=statalist.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114303795280568456'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114303795280568456'/><link rel='alternate' type='text/html' href='http://statalist.blogspot.com/2006/03/re-st-left-truncation-of-entry-in.html' title='Re: st: left-truncation of entry in survival analysis'/><author><name>statalist member</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-15088145.post-114303695120640020</id><published>2006-03-22T09:15:00.001-05:00</published><updated>2006-03-22T09:15:51.300-05:00</updated><title type='text'>Re: st: STATA syntax colouring in TextWrangler</title><content type='html'>&lt;p class="mobile-post"&gt;On 22 Márta 2006, at 12:47, Taavi Lai wrote:&lt;/p&gt;&lt;p class="mobile-post"&gt;&amp;gt; Google search "TextWrangler stata syntax" gave several hits and one  
&amp;gt; of those directed to a file Stata.plist which downloaded ok. I'm  
&amp;gt; not a Mac user and have no acquaintance to TextWrangler so you have  
&amp;gt; to experiment further
&amp;gt; the link is http://dataninja.wordpress.com/2006/02/28/stata- 
&amp;gt; language-module-for-textwrangler/
&amp;gt;
&amp;gt; Regards,
&amp;gt; Taavi&lt;/p&gt;&lt;p class="mobile-post"&gt;Splended hunting. I've installed it and it works fine, except that it  
fails to recognise the single open quote correctly. You need to fix  
these lines&lt;/p&gt;&lt;p class="mobile-post"&gt;		&amp;lt;key&amp;gt;Open Strings 2&amp;lt;/key&amp;gt;
		&amp;lt;string&amp;gt;&amp;lt;/string&amp;gt;&lt;/p&gt;&lt;p class="mobile-post"&gt;to read
		&amp;lt;key&amp;gt;Open Strings 2&amp;lt;/key&amp;gt;
		&amp;lt;string&amp;gt;`&amp;lt;/string&amp;gt;&lt;/p&gt;&lt;p class="mobile-post"&gt;I have also made a couple of personal tweaks: it now recognises all  
SSC packages. I've emailed this version to DataNinja so hopefully it  
will be posted on his/her site.&lt;/p&gt;&lt;p class="mobile-post"&gt;Ronán Conroy
rconroy@rcsi.ie&lt;/p&gt;&lt;p class="mobile-post"&gt;*
*   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/&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15088145-114303695120640020?l=statalist.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114303695120640020'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114303695120640020'/><link rel='alternate' type='text/html' href='http://statalist.blogspot.com/2006/03/re-st-stata-syntax-colouri_114303695120640020.html' title='Re: st: STATA syntax colouring in TextWrangler'/><author><name>statalist member</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-15088145.post-114303691488487860</id><published>2006-03-22T09:15:00.000-05:00</published><updated>2006-03-22T09:15:16.363-05:00</updated><title type='text'>Re: st: STATA syntax colouring in TextWrangler</title><content type='html'>&lt;p class="mobile-post"&gt;On 22 Márta 2006, at 12:47, Taavi Lai wrote:&lt;/p&gt;&lt;p class="mobile-post"&gt;&amp;gt; Google search "TextWrangler stata syntax" gave several hits and one  
&amp;gt; of those directed to a file Stata.plist which downloaded ok. I'm  
&amp;gt; not a Mac user and have no acquaintance to TextWrangler so you have  
&amp;gt; to experiment further
&amp;gt; the link is http://dataninja.wordpress.com/2006/02/28/stata- 
&amp;gt; language-module-for-textwrangler/
&amp;gt;
&amp;gt; Regards,
&amp;gt; Taavi&lt;/p&gt;&lt;p class="mobile-post"&gt;Splended hunting. I've installed it and it works fine, except that it  
fails to recognise the single open quote correctly. You need to fix  
these lines&lt;/p&gt;&lt;p class="mobile-post"&gt;		&amp;lt;key&amp;gt;Open Strings 2&amp;lt;/key&amp;gt;
		&amp;lt;string&amp;gt;&amp;lt;/string&amp;gt;&lt;/p&gt;&lt;p class="mobile-post"&gt;to read
		&amp;lt;key&amp;gt;Open Strings 2&amp;lt;/key&amp;gt;
		&amp;lt;string&amp;gt;`&amp;lt;/string&amp;gt;&lt;/p&gt;&lt;p class="mobile-post"&gt;I have also made a couple of personal tweaks: it now recognises all  
SSC packages. I've emailed this version to DataNinja so hopefully it  
will be posted on his/her site.&lt;/p&gt;&lt;p class="mobile-post"&gt;Ronán Conroy
rconroy@rcsi.ie&lt;/p&gt;&lt;p class="mobile-post"&gt;*
*   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/&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15088145-114303691488487860?l=statalist.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114303691488487860'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114303691488487860'/><link rel='alternate' type='text/html' href='http://statalist.blogspot.com/2006/03/re-st-stata-syntax-colouri_114303691488487860.html' title='Re: st: STATA syntax colouring in TextWrangler'/><author><name>statalist member</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-15088145.post-114303496513871605</id><published>2006-03-22T08:42:00.000-05:00</published><updated>2006-03-22T08:42:45.143-05:00</updated><title type='text'>st: RE: problem with the F test</title><content type='html'>&lt;p class="mobile-post"&gt;If you do this interactively, or look at a log in scml format, the
missing F-stat should be in blue, indicating a hyperlink.  If so, you
can click on it to get a description of possible causes for the missing
statistic. &lt;/p&gt;&lt;p class="mobile-post"&gt;HTH.&lt;/p&gt;&lt;p class="mobile-post"&gt;--Mark&lt;/p&gt;&lt;p class="mobile-post"&gt;&amp;gt; -----Original Message-----
&amp;gt; From: owner-statalist@hsphsun2.harvard.edu 
&amp;gt; [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of 
&amp;gt; mduque@cedes.org
&amp;gt; Sent: 21 March 2006 23:28
&amp;gt; To: statalist@hsphsun2.harvard.edu
&amp;gt; Subject: st: problem with the F test
&amp;gt; 
&amp;gt; I have a problem with the F test when I select the option 
&amp;gt; ROBUST for the estimation .
&amp;gt; 
&amp;gt; I'm just running OLS regressions and when I select "robust" 
&amp;gt; for the estimation of the variances the value of the F test 
&amp;gt; is missing !  (I have 72 obs and 6 regresors)
&amp;gt; 
&amp;gt; If I don't select that option then I don't have the problem 
&amp;gt; in the same estimation.
&amp;gt; 
&amp;gt; What can it be?
&amp;gt; 
&amp;gt; 
&amp;gt; *
&amp;gt; *   For searches and help try:
&amp;gt; *   http://www.stata.com/support/faqs/res/findit.html
&amp;gt; *   http://www.stata.com/support/statalist/faq
&amp;gt; *   http://www.ats.ucla.edu/stat/stata/
&amp;gt; 
&amp;gt; &lt;/p&gt;&lt;p class="mobile-post"&gt;*
*   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/&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15088145-114303496513871605?l=statalist.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114303496513871605'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114303496513871605'/><link rel='alternate' type='text/html' href='http://statalist.blogspot.com/2006/03/st-re-problem-with-f-test.html' title='st: RE: problem with the F test'/><author><name>statalist member</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-15088145.post-114303487356762446</id><published>2006-03-22T08:41:00.000-05:00</published><updated>2006-03-22T08:41:13.660-05:00</updated><title type='text'>Re: st: problem with the F test</title><content type='html'>&lt;p class="mobile-post"&gt;been there recently (or close)... -whelp j_robustsingular- might helpful&lt;/p&gt;&lt;p class="mobile-post"&gt;mduque@cedes.org wrote:
&amp;gt; I have a problem with the F test when I select the option ROBUST for the estimation .
&amp;gt; 
&amp;gt; I'm just running OLS regressions and when I select "robust" for the estimation of the variances the value of the F test is missing !  (I have 72 obs and 6 regresors)
&amp;gt; 
&amp;gt; If I don't select that option then I don't have the problem in the same estimation.
&amp;gt; 
&amp;gt; What can it be?
&amp;gt; 
&amp;gt; 
&amp;gt; *
&amp;gt; *   For searches and help try:
&amp;gt; *   http://www.stata.com/support/faqs/res/findit.html
&amp;gt; *   http://www.stata.com/support/statalist/faq
&amp;gt; *   http://www.ats.ucla.edu/stat/stata/
&amp;gt; 
*
*   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/&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15088145-114303487356762446?l=statalist.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114303487356762446'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114303487356762446'/><link rel='alternate' type='text/html' href='http://statalist.blogspot.com/2006/03/re-st-problem-with-f-test.html' title='Re: st: problem with the F test'/><author><name>statalist member</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-15088145.post-114303466442536073</id><published>2006-03-22T08:37:00.000-05:00</published><updated>2006-03-22T08:37:49.430-05:00</updated><title type='text'>Re: st: STATA syntax colouring in TextWrangler</title><content type='html'>&lt;p class="mobile-post"&gt;On Mar 22, 2006, at 1:47 PM, Taavi Lai wrote:&lt;/p&gt;&lt;p class="mobile-post"&gt;&amp;gt; the link is http://dataninja.wordpress.com/2006/02/28/stata- 
&amp;gt; language-module-for-textwrangler/&lt;/p&gt;&lt;p class="mobile-post"&gt;Thank you - it worked perfectly.&lt;/p&gt;&lt;p class="mobile-post"&gt;Steffen
*
*   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/&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15088145-114303466442536073?l=statalist.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114303466442536073'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114303466442536073'/><link rel='alternate' type='text/html' href='http://statalist.blogspot.com/2006/03/re-st-stata-syntax-colouri_114303466442536073.html' title='Re: st: STATA syntax colouring in TextWrangler'/><author><name>statalist member</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-15088145.post-114303177982522207</id><published>2006-03-22T07:49:00.001-05:00</published><updated>2006-03-22T07:49:39.946-05:00</updated><title type='text'>st: left-truncation of entry in survival analysis</title><content type='html'>&lt;p class="mobile-post"&gt;Dear Statalist readers,&lt;/p&gt;&lt;p class="mobile-post"&gt;Reports of survival analysis which use age as the time scale rather than 
time-on-study often 'adjust for delayed entry'. In Stata this is achieved by:&lt;/p&gt;&lt;p class="mobile-post"&gt;stset age, fail(died) enter(ageatentry)&lt;/p&gt;&lt;p class="mobile-post"&gt;(see recent e-mail from Dawn Teele, or reply to st: streg from 
rgutierrez@stata.com on 19th September 2002.)&lt;/p&gt;&lt;p class="mobile-post"&gt;However, a model fitted with the above stset gives exactly the same answer 
as one with&lt;/p&gt;&lt;p class="mobile-post"&gt;stset timeonstudy, fail(died)&lt;/p&gt;&lt;p class="mobile-post"&gt;provided timeonstudy=age-ageatentry (as it normally would, but might not 
exactly depending how variables were calculated) and the models are exactly 
the same. In the second model it is usual to adjust or stratify on age, 
while in the first it isn't as age is taken into account, supposedly, so 
researchers may not have realised the equivalence.&lt;/p&gt;&lt;p class="mobile-post"&gt;So, am I missing something, or are advocates of the first model deluding 
themselves? Can left truncation be ignored with age as the timescale?&lt;/p&gt;&lt;p class="mobile-post"&gt;Thanks&lt;/p&gt;&lt;p class="mobile-post"&gt;Sue&lt;/p&gt;&lt;p class="mobile-post"&gt;Sue Chinn
Professor of Medical Statistics
Division of Asthma, Allergy and Lung Biology
King's College London
5th Floor Capital House
42 Weston Street
London SE1 3QD&lt;/p&gt;&lt;p class="mobile-post"&gt;tel no. 020 7848 6607
fax no. 020 7848 6605&lt;/p&gt;&lt;p class="mobile-post"&gt;*
*   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/&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15088145-114303177982522207?l=statalist.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114303177982522207'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114303177982522207'/><link rel='alternate' type='text/html' href='http://statalist.blogspot.com/2006/03/st-left-truncation-of-entry-in.html' title='st: left-truncation of entry in survival analysis'/><author><name>statalist member</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-15088145.post-114303174380942170</id><published>2006-03-22T07:49:00.000-05:00</published><updated>2006-03-22T07:49:03.926-05:00</updated><title type='text'>Re: st: STATA syntax colouring in TextWrangler</title><content type='html'>&lt;p class="mobile-post"&gt;Google search "TextWrangler stata syntax" gave several hits and one of 
those directed to a file Stata.plist which downloaded ok. I'm not a Mac 
user and have no acquaintance to TextWrangler so you have to experiment 
further
the link is 
http://dataninja.wordpress.com/2006/02/28/stata-language-module-for-textwrangler/&lt;/p&gt;&lt;p class="mobile-post"&gt;Regards,
Taavi&lt;/p&gt;&lt;p class="mobile-post"&gt;Steffen Hokland wrote:
&amp;gt; I've started to do STATA programming, and have decided to use my 
&amp;gt; 'normal' text editor - TextWrangler (Apple Mac OS-X). I've been able 
&amp;gt; to track down a syntax colouring module for TextWrangler (by Ben 
&amp;gt; Hulley), but all links refering to it (e.g. 
&amp;gt; homepage.mac.com/benhulley) seem to be dead. Can anyone direct me to a 
&amp;gt; module for syntax colouring in TextWrangler (or another texteditor for 
&amp;gt; that matter)?
&amp;gt;
&amp;gt; Steffen
&amp;gt; *
&amp;gt; *   For searches and help try:
&amp;gt; *   http://www.stata.com/support/faqs/res/findit.html
&amp;gt; *   http://www.stata.com/support/statalist/faq
&amp;gt; *   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/&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15088145-114303174380942170?l=statalist.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114303174380942170'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114303174380942170'/><link rel='alternate' type='text/html' href='http://statalist.blogspot.com/2006/03/re-st-stata-syntax-colouring-in_22.html' title='Re: st: STATA syntax colouring in TextWrangler'/><author><name>statalist member</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-15088145.post-114303105963460190</id><published>2006-03-22T07:37:00.001-05:00</published><updated>2006-03-22T07:37:39.636-05:00</updated><title type='text'>st: problem with the F test</title><content type='html'>&lt;p class="mobile-post"&gt;I have a problem with the F test when I select the option ROBUST for the estimation .&lt;/p&gt;&lt;p class="mobile-post"&gt;I'm just running OLS regressions and when I select "robust" for the estimation of the variances the value of the F test is missing !  (I have 72 obs and 6 regresors)&lt;/p&gt;&lt;p class="mobile-post"&gt;If I don't select that option then I don't have the problem in the same estimation.&lt;/p&gt;&lt;p class="mobile-post"&gt;What can it be?&lt;/p&gt;&lt;p class="mobile-post"&gt;*
*   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/&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15088145-114303105963460190?l=statalist.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114303105963460190'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114303105963460190'/><link rel='alternate' type='text/html' href='http://statalist.blogspot.com/2006/03/st-problem-with-f-test.html' title='st: problem with the F test'/><author><name>statalist member</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-15088145.post-114303102151953044</id><published>2006-03-22T07:37:00.000-05:00</published><updated>2006-03-22T07:37:01.640-05:00</updated><title type='text'>Re: st: STATA syntax colouring in TextWrangler</title><content type='html'>&lt;p class="mobile-post"&gt;For "STATA" read "Stata", passim.&lt;/p&gt;&lt;p class="mobile-post"&gt;Steven Samuels asked essentially the same question on
17 January.&lt;/p&gt;&lt;p class="mobile-post"&gt;Some while ago I made a public appeal for information on this point
on Statalist and got no replies, public or privste.
Also, emails to Ben Hulley's last known email
address at NIH elicited no reply (although they
did not bounce).&lt;/p&gt;&lt;p class="mobile-post"&gt;Thus the link was removed from&lt;/p&gt;&lt;p class="mobile-post"&gt;http://fmwww.bc.edu/repec/bocode/t/textEditors.html&lt;/p&gt;&lt;p class="mobile-post"&gt;However, that FAQ does report syntax colouring for
many other text editors.&lt;/p&gt;&lt;p class="mobile-post"&gt;Nick
n.j.cox@durham.ac.uk&lt;/p&gt;&lt;p class="mobile-post"&gt;Steffen Hokland&lt;/p&gt;&lt;p class="mobile-post"&gt;--------------------------------------------------------------------------------
I've started to do STATA programming, and have decided to use my 
'normal' text editor - TextWrangler (Apple Mac OS-X). I've been able to 
track down a syntax colouring module for TextWrangler (by Ben Hulley), 
but all links refering to it (e.g. homepage.mac.com/ benhulley) seem to 
be dead. Can anyone direct me to a module for syntax colouring in 
TextWrangler (or another texteditor for that matter)?
*
*   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/&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15088145-114303102151953044?l=statalist.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114303102151953044'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114303102151953044'/><link rel='alternate' type='text/html' href='http://statalist.blogspot.com/2006/03/re-st-stata-syntax-colouring-in.html' title='Re: st: STATA syntax colouring in TextWrangler'/><author><name>statalist member</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-15088145.post-114303052443315640</id><published>2006-03-22T07:28:00.000-05:00</published><updated>2006-03-22T07:28:45.973-05:00</updated><title type='text'>st: Scandanavian Journal of Statistics Prize</title><content type='html'>&lt;p class="mobile-post"&gt;This may be of interest to Statalisters, especially those in the cold north.&lt;/p&gt;&lt;p class="mobile-post"&gt;m.p.&lt;/p&gt;&lt;p class="mobile-post"&gt;The Scandinavian Journal of Statistics Prize for Young Researchers&lt;/p&gt;&lt;p class="mobile-post"&gt;======================================&lt;/p&gt;&lt;p class="mobile-post"&gt;The Scandinavian Journal of Statistics Prize of 40.000 DKK will be given 
to the young researcher who presents the best paper at the NORDSTAT 
meeting http://blackwell-publishing.msgfocus.com/c/13qFGFJEY2hnBuR, to 
be held in Rebild Bakker, Denmark, 11-15 June 2006, provided that the 
paper is accepted (before or after the meeting) as a regular submission 
to the Scandinavian Journal of Statistics (SJS) 
http://blackwell-publishing.msgfocus.com/c/13qH4N3U4HvcDpM
(visit http://blackwell-publishing.msgfocus.com/c/13qHbpMnQUdbN6j see 
author guidelines for submission details). The editor of SJS must be 
informed that the paper is a candidate for the Scandinavian Journal of 
Statistics Prize.&lt;/p&gt;&lt;p class="mobile-post"&gt;To qualify as a candidate for the SJS Prize, the author must have 
received a Ph.D. degree at most five years before the NORDSTAT meeting 
or be younger than 35 years of age at the time of the meeting. The young 
author is preferably the sole-author of the paper, but if multiple young 
authors are involved, the paper will also be considered. There are no 
restrictions on nationality.&lt;/p&gt;&lt;p class="mobile-post"&gt;Young researchers of any nationality are strongly encouraged to present 
their work at the NORDSTAT 2006 meeting and to submit their papers to 
the SJS and for the SJS Prize competition.&lt;/p&gt;&lt;p class="mobile-post"&gt;======================================
*
*   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/&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15088145-114303052443315640?l=statalist.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114303052443315640'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114303052443315640'/><link rel='alternate' type='text/html' href='http://statalist.blogspot.com/2006/03/st-scandanavian-journal-of-statistics.html' title='st: Scandanavian Journal of Statistics Prize'/><author><name>statalist member</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-15088145.post-114301946647362117</id><published>2006-03-22T04:24:00.000-05:00</published><updated>2006-03-22T04:24:26.736-05:00</updated><title type='text'>Re: st: Mata function stata() within program</title><content type='html'>&lt;p class="mobile-post"&gt;Thank you, Alan, that solved the problem. Also thanks for the detailed 
explanation.&lt;/p&gt;&lt;p class="mobile-post"&gt;Hopefully, I can show you why I need all that next week in Mannheim&lt;/p&gt;&lt;p class="mobile-post"&gt;Uli&lt;/p&gt;&lt;p class="mobile-post"&gt;Alan Riley wrote:
&amp;gt; Ulrich Kohler asked about calling Stata (including a local macro
&amp;gt;
&amp;gt; substitution) from Mata:
&amp;gt; &amp;gt; I have a Mata function which looks as follows:
&amp;gt; &amp;gt;
&amp;gt; &amp;gt; -------------------------------------lsq.mata--
&amp;gt; &amp;gt;
&amp;gt; &amp;gt; (...)
&amp;gt; &amp;gt;
&amp;gt; &amp;gt; // Mata Function to extract the substitution costs from subcost-matrix
&amp;gt; &amp;gt; void showhash(real rowvector R)
&amp;gt; &amp;gt; {
&amp;gt; &amp;gt; 	string scalar key1
&amp;gt; &amp;gt; 	st_local("key1",key1)
&amp;gt; &amp;gt; 	key1 = strofreal(R[1,2])
&amp;gt; &amp;gt; 	st_local("key1",key1)
&amp;gt; &amp;gt; 	stata("local hash1 = mod(`key1',197)")
&amp;gt; &amp;gt; }
&amp;gt; &amp;gt;
&amp;gt; &amp;gt; (...)
&amp;gt; &amp;gt;
&amp;gt; &amp;gt; ------------------------------------------------
&amp;gt; &amp;gt;
&amp;gt; &amp;gt; The function is part of the mata-libary lsq.mlib, which compiles without
&amp;gt; &amp;gt; problems. All other function in the library works well. However, if I run
&amp;gt; &amp;gt;
&amp;gt; &amp;gt; -showhash()- from within Mata I got the following error:
&amp;gt; &amp;gt; : R = 2,3,5,4
&amp;gt; &amp;gt; : showhash(R)
&amp;gt; &amp;gt;
&amp;gt; &amp;gt; invalid syntax
&amp;gt; &amp;gt;                  stata():  3598  Stata returned error
&amp;gt; &amp;gt;               showhash():     -  function returned error
&amp;gt; &amp;gt;                  &amp;lt;istmt&amp;gt;:     -  function returned error
&amp;gt; &amp;gt; r(3598);
&amp;gt; &amp;gt;
&amp;gt; &amp;gt; Further investigation showed that the error is connected to the -stata()-
&amp;gt; &amp;gt; function. However, After running -showhash()- I can intactively run the
&amp;gt; &amp;gt; same
&amp;gt; &amp;gt;
&amp;gt; &amp;gt; -stata()- function without any problems:
&amp;gt; &amp;gt; : stata("local hash1 = mod(`key1',197)")
&amp;gt; &amp;gt; : stata("display `hash1'")
&amp;gt; &amp;gt;
&amp;gt; &amp;gt; 3
&amp;gt;
&amp;gt; `key1' is being substituted at compile time.  That is, when
&amp;gt; Stata reads the lines
&amp;gt;
&amp;gt;     void showhash(real rowvector R)
&amp;gt;     {
&amp;gt;             string scalar key1
&amp;gt;             st_local("key1",key1)
&amp;gt;             key1 = strofreal(R[1,2])
&amp;gt;             st_local("key1",key1)
&amp;gt;             stata("local hash1 = mod(`key1',197)")
&amp;gt;     }
&amp;gt;
&amp;gt; just before they are compiled by Mata, macros are substituted.
&amp;gt; This, what is compiled is
&amp;gt;
&amp;gt;     void showhash(real rowvector R)
&amp;gt;     {
&amp;gt;             string scalar key1
&amp;gt;             st_local("key1",key1)
&amp;gt;             key1 = strofreal(R[1,2])
&amp;gt;             st_local("key1",key1)
&amp;gt;             stata("local hash1 = mod(,197)")
&amp;gt;     }
&amp;gt;
&amp;gt; And,
&amp;gt;
&amp;gt;      local hash1 = mod(,197)
&amp;gt;
&amp;gt; produces a syntax error when it is executed later.
&amp;gt;
&amp;gt; The reason it works interactively afterward is that by that point
&amp;gt; the local macro 'key1' has already been defined, and thus what
&amp;gt; Mata sees is
&amp;gt;
&amp;gt;             stata("local hash1 = mod(1.234,197)")
&amp;gt;
&amp;gt; (or rather, it sees whatever number was in R[1,2] and thus
&amp;gt; was stored in `key1').
&amp;gt;
&amp;gt; You can see the advantage of this macro substitution in
&amp;gt; adoupdate.ado.  Type -which adoupdate- and then look at the
&amp;gt; file in a text editor (being careful to not modify it of course).
&amp;gt; Look for CMDNAME and the local macros after it, then search lower
&amp;gt; in the file to see how they are used.  Their values get substituted,
&amp;gt; not at run-time, but just before the lines are compiled.
&amp;gt;
&amp;gt; Ulrich needs to protect `key1' from being substituted just
&amp;gt; before compilation by coding
&amp;gt;
&amp;gt;             stata("local hash1 = mod(\`key1',197)")
&amp;gt;
&amp;gt; The string that will be compiled into the code to be passed to
&amp;gt; stata() will then literally be
&amp;gt;
&amp;gt;    local hash1 = mod(`key1',197)
&amp;gt;
&amp;gt; which is what Ulrich wants.
&amp;gt;
&amp;gt;
&amp;gt; Alan
&amp;gt; (ariley@stata.com)
&amp;gt; *
&amp;gt; *   For searches and help try:
&amp;gt; *   http://www.stata.com/support/faqs/res/findit.html
&amp;gt; *   http://www.stata.com/support/statalist/faq
&amp;gt; *   http://www.ats.ucla.edu/stat/stata/&lt;/p&gt;&lt;p class="mobile-post"&gt;-- 
kohler@wz-berlin.de
+49 (030) 25491-361
*
*   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/&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15088145-114301946647362117?l=statalist.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114301946647362117'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114301946647362117'/><link rel='alternate' type='text/html' href='http://statalist.blogspot.com/2006/03/re-st-mata-function-stata-within_22.html' title='Re: st: Mata function stata() within program'/><author><name>statalist member</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-15088145.post-114301897106201588</id><published>2006-03-22T04:16:00.000-05:00</published><updated>2006-03-22T04:16:12.056-05:00</updated><title type='text'>st: STATA syntax colouring in TextWrangler</title><content type='html'>&lt;p class="mobile-post"&gt;I've started to do STATA programming, and have decided to use my  
'normal' text editor - TextWrangler (Apple Mac OS-X). I've been able  
to track down a syntax colouring module for TextWrangler (by Ben  
Hulley), but all links refering to it (e.g. homepage.mac.com/ 
benhulley) seem to be dead. Can anyone direct me to a module for  
syntax colouring in TextWrangler (or another texteditor for that  
matter)?&lt;/p&gt;&lt;p class="mobile-post"&gt;Steffen
*
*   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/&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15088145-114301897106201588?l=statalist.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114301897106201588'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114301897106201588'/><link rel='alternate' type='text/html' href='http://statalist.blogspot.com/2006/03/st-stata-syntax-colouring-in.html' title='st: STATA syntax colouring in TextWrangler'/><author><name>statalist member</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-15088145.post-114301680071381924</id><published>2006-03-22T03:40:00.000-05:00</published><updated>2006-03-22T03:40:01.746-05:00</updated><title type='text'>st: Queries about dfl</title><content type='html'>&lt;p class="mobile-post"&gt;Dear Statalist users:
I would really appreciate any help with a couple of issues concerning the 
new dfl ssc package carried out by Pedro de Azevedo.
First, I would like to run the package with more than 140 explanatory 
variables. Yet, the logit/probit that estimates the propensity score just 
considers the first 30. Is there any way of increasing the number of 
variables?
Second, I would like to estimate some characteristics (mean, deciles or even 
inequality measures) of the counterfactual estimated density. Is it possible 
with the dfl package?
Thanks in advance.
Hipolito Simon
University of Alicante &lt;/p&gt;&lt;p class="mobile-post"&gt;*
*   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/&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15088145-114301680071381924?l=statalist.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114301680071381924'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114301680071381924'/><link rel='alternate' type='text/html' href='http://statalist.blogspot.com/2006/03/st-queries-about-dfl.html' title='st: Queries about dfl'/><author><name>statalist member</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-15088145.post-114300723091384206</id><published>2006-03-22T01:00:00.000-05:00</published><updated>2006-03-22T01:00:31.063-05:00</updated><title type='text'>st: RE: xtabond2</title><content type='html'>&lt;p class="mobile-post"&gt;It is shown in the help file. Just type -help xtabond2- if it has already
been installed.
Thuy Le&lt;/p&gt;&lt;p class="mobile-post"&gt;-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Vivian Sibbaluca
Sent: Wednesday, March 22, 2006 12:28 AM
To: statalist@hsphsun2.harvard.edu
Subject: st: xtabond2&lt;/p&gt;&lt;p class="mobile-post"&gt;Dear all:
I am working on a panel data model with lagged endogenous variables as
regressors, blundell and bond in particular. i was wondering how am i going
to incorporate lags of y in the varlist. can anyone give a syntax of this
model? thanks!&lt;/p&gt;&lt;p class="mobile-post"&gt;__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
*
*   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/&lt;/p&gt;&lt;p class="mobile-post"&gt;*
*   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/&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15088145-114300723091384206?l=statalist.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114300723091384206'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114300723091384206'/><link rel='alternate' type='text/html' href='http://statalist.blogspot.com/2006/03/st-re-xtabond2.html' title='st: RE: xtabond2'/><author><name>statalist member</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-15088145.post-114300539299401865</id><published>2006-03-22T00:29:00.000-05:00</published><updated>2006-03-22T00:29:54.806-05:00</updated><title type='text'>st: xtabond2</title><content type='html'>&lt;p class="mobile-post"&gt;Dear all:
I am working on a panel data model with lagged
endogenous variables as regressors, blundell and bond
in particular. i was wondering how am i going to
incorporate lags of y in the varlist. can anyone give
a syntax of this model? thanks!&lt;/p&gt;&lt;p class="mobile-post"&gt;__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
*
*   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/&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15088145-114300539299401865?l=statalist.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114300539299401865'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114300539299401865'/><link rel='alternate' type='text/html' href='http://statalist.blogspot.com/2006/03/st-xtabond2.html' title='st: xtabond2'/><author><name>statalist member</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-15088145.post-114299699973546998</id><published>2006-03-21T22:09:00.000-05:00</published><updated>2006-03-21T22:10:01.086-05:00</updated><title type='text'>Re: st: Re: hausman test after mlogit - negative chi-square</title><content type='html'>&lt;p class="mobile-post"&gt;Marilyn Ibara wrote:&lt;/p&gt;&lt;p class="mobile-post"&gt;&amp;gt; I estimated a Multinominal logit model with 7 choices.  I
&amp;gt; have 17 independent variables.  I specified mlogtest after I
&amp;gt; ran the mlogit command.&lt;/p&gt;&lt;p class="mobile-post"&gt;It would have been worth mentioning the _full_ command (I suspect) you
used to get the post-estimation results shown in your post: -mlogtest,
all-.&lt;/p&gt;&lt;p class="mobile-post"&gt;&amp;gt; I am not sure about my results.  Does anyone know how it is
&amp;gt; possible to get a negative Chi-square for the hausman test
&amp;gt; for IIA as I did in my results?  Also, how are the degrees
&amp;gt; of freedom calculated, it appears that I should have 17 and
&amp;gt; not what is reported.&lt;/p&gt;&lt;p class="mobile-post"&gt;This question is answered by Long and Freese (2006: 244-5) in the second
edition of their excellent textbook, cited below my signature.
Essentially, this is very common, and it is often evidence that the
independence of irrelevant alternatives (IIA) has _not_ been violated.
They also suggest a good tip to confirm your results here: choose a
different base category and run the same -mlogtest- command.&lt;/p&gt;&lt;p class="mobile-post"&gt;&amp;gt; Furthermore, my results of the hausman test differ from the
&amp;gt; small-hsiao test, they contradict each other, I read online
&amp;gt; this is common, does anyone know how one determines which
&amp;gt; one is appropriate?&lt;/p&gt;&lt;p class="mobile-post"&gt;Long and Freese (2006: 243), quoting Monte Carlo research conducted by
Cheng and Long (2005), report that neither the Hausman-McFadden (HM) nor
the Small-Hsiao (SH) test is especially useful for assessing violations of
IIA. This is largely because both have poor size properties even with some
kinds of data, even N &amp;gt; 1000 in the case of HM but also sometimes for SH
when N &amp;gt; 500. The best advice they give is only to use -mlogit- when you
can _clearly_ distinguish between the outcome categories in your dataset.
Quite frankly, I couldn't agree more.&lt;/p&gt;&lt;p class="mobile-post"&gt;In sum, buy Long and Freese!&lt;/p&gt;&lt;p class="mobile-post"&gt;CLIVE NICHOLAS        |t: 0(044)7903 397793
Politics              |e: clive.nicholas@ncl.ac.uk
Newcastle University  |http://www.ncl.ac.uk/geps&lt;/p&gt;&lt;p class="mobile-post"&gt;References:&lt;/p&gt;&lt;p class="mobile-post"&gt;Cheng S and Long JS (2005) "Testing For IIA in the Multinomial Logit
Model",  University of Connecticut, Working Paper.&lt;/p&gt;&lt;p class="mobile-post"&gt;Long JS and Freese J (2nd ed, 2006) REGRESSION MODELS FOR CATEGORICAL
DEPENDENT VARIABLES USING STATA, College Station, TX: Stata Press.&lt;/p&gt;&lt;p class="mobile-post"&gt;*
*   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/&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15088145-114299699973546998?l=statalist.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114299699973546998'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114299699973546998'/><link rel='alternate' type='text/html' href='http://statalist.blogspot.com/2006/03/re-st-re-hausman-test-after-mlogit.html' title='Re: st: Re: hausman test after mlogit - negative chi-square'/><author><name>statalist member</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-15088145.post-114298665924991130</id><published>2006-03-21T19:17:00.000-05:00</published><updated>2006-03-21T19:17:40.310-05:00</updated><title type='text'>Re: st: Mata function stata() within program</title><content type='html'>&lt;p class="mobile-post"&gt;Ulrich Kohler asked about calling Stata (including a local macro
substitution) from Mata:
&amp;gt; I have a Mata function which looks as follows:
&amp;gt; 
&amp;gt; -------------------------------------lsq.mata--
&amp;gt; 
&amp;gt; (...)
&amp;gt; 
&amp;gt; // Mata Function to extract the substitution costs from subcost-matrix
&amp;gt; void showhash(real rowvector R)
&amp;gt; {
&amp;gt; 	string scalar key1
&amp;gt; 	st_local("key1",key1)
&amp;gt; 	key1 = strofreal(R[1,2])
&amp;gt; 	st_local("key1",key1)
&amp;gt; 	stata("local hash1 = mod(`key1',197)")
&amp;gt; }
&amp;gt; 
&amp;gt; (...)
&amp;gt; 
&amp;gt; ------------------------------------------------
&amp;gt; 
&amp;gt; The function is part of the mata-libary lsq.mlib, which compiles without 
&amp;gt; problems. All other function in the library works well. However, if I run 
&amp;gt; -showhash()- from within Mata I got the following error:
&amp;gt; 
&amp;gt; : R = 2,3,5,4
&amp;gt; : showhash(R)
&amp;gt; invalid syntax
&amp;gt;                  stata():  3598  Stata returned error
&amp;gt;               showhash():     -  function returned error
&amp;gt;                  &amp;lt;istmt&amp;gt;:     -  function returned error
&amp;gt; r(3598);
&amp;gt; 
&amp;gt; Further investigation showed that the error is connected to the -stata()- 
&amp;gt; function. However, After running -showhash()- I can intactively run the same
&amp;gt; -stata()- function without any problems:
&amp;gt; 
&amp;gt; : stata("local hash1 = mod(`key1',197)")
&amp;gt; : stata("display `hash1'")
&amp;gt; 3&lt;/p&gt;&lt;p class="mobile-post"&gt;`key1' is being substituted at compile time.  That is, when
Stata reads the lines&lt;/p&gt;&lt;p class="mobile-post"&gt;    void showhash(real rowvector R)
    {
            string scalar key1
            st_local("key1",key1)
            key1 = strofreal(R[1,2])
            st_local("key1",key1)
            stata("local hash1 = mod(`key1',197)")
    }&lt;/p&gt;&lt;p class="mobile-post"&gt;just before they are compiled by Mata, macros are substituted.
This, what is compiled is&lt;/p&gt;&lt;p class="mobile-post"&gt;    void showhash(real rowvector R)
    {
            string scalar key1
            st_local("key1",key1)
            key1 = strofreal(R[1,2])
            st_local("key1",key1)
            stata("local hash1 = mod(,197)")
    }&lt;/p&gt;&lt;p class="mobile-post"&gt;And,&lt;/p&gt;&lt;p class="mobile-post"&gt;     local hash1 = mod(,197)&lt;/p&gt;&lt;p class="mobile-post"&gt;produces a syntax error when it is executed later.&lt;/p&gt;&lt;p class="mobile-post"&gt;The reason it works interactively afterward is that by that point
the local macro 'key1' has already been defined, and thus what
Mata sees is&lt;/p&gt;&lt;p class="mobile-post"&gt;            stata("local hash1 = mod(1.234,197)")&lt;/p&gt;&lt;p class="mobile-post"&gt;(or rather, it sees whatever number was in R[1,2] and thus
was stored in `key1').&lt;/p&gt;&lt;p class="mobile-post"&gt;You can see the advantage of this macro substitution in
adoupdate.ado.  Type -which adoupdate- and then look at the
file in a text editor (being careful to not modify it of course).
Look for CMDNAME and the local macros after it, then search lower
in the file to see how they are used.  Their values get substituted,
not at run-time, but just before the lines are compiled.&lt;/p&gt;&lt;p class="mobile-post"&gt;Ulrich needs to protect `key1' from being substituted just
before compilation by coding&lt;/p&gt;&lt;p class="mobile-post"&gt;            stata("local hash1 = mod(\`key1',197)")&lt;/p&gt;&lt;p class="mobile-post"&gt;The string that will be compiled into the code to be passed to
stata() will then literally be&lt;/p&gt;&lt;p class="mobile-post"&gt;   local hash1 = mod(`key1',197)&lt;/p&gt;&lt;p class="mobile-post"&gt;which is what Ulrich wants.&lt;/p&gt;&lt;p class="mobile-post"&gt;Alan
(ariley@stata.com)
*
*   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/&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15088145-114298665924991130?l=statalist.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114298665924991130'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114298665924991130'/><link rel='alternate' type='text/html' href='http://statalist.blogspot.com/2006/03/re-st-mata-function-stata-within.html' title='Re: st: Mata function stata() within program'/><author><name>statalist member</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-15088145.post-114298524536914986</id><published>2006-03-21T18:54:00.000-05:00</published><updated>2006-03-21T18:54:07.070-05:00</updated><title type='text'>st: Re: hausman test after mlogit - negative
 chi-square</title><content type='html'>&lt;p class="mobile-post"&gt;Hi all,&lt;/p&gt;&lt;p class="mobile-post"&gt;I estimated a Multinominal logit model with 7 choices.  I 
have 17 independent variables.  I specified mlogtest after I 
ran the mlogit command.  &lt;/p&gt;&lt;p class="mobile-post"&gt;I am not sure about my results.  Does anyone know how it is 
possible to get a negative Chi-square for the hausman test 
for IIA as I did in my results?  Also, how are the degrees 
of freedom calculated, it appears that I should have 17 and 
not what is reported. &lt;/p&gt;&lt;p class="mobile-post"&gt;Furthermore, my results of the hausman test differ from the 
small-hsiao test, they contradict each other, I read online 
this is common, does anyone know how one determines which 
one is appropriate?&lt;/p&gt;&lt;p class="mobile-post"&gt;Here is my output.  Thanks in advance for any help. &lt;/p&gt;&lt;p class="mobile-post"&gt;Marilyn.&lt;/p&gt;&lt;p class="mobile-post"&gt;**** Hausman tests of IIA assumption&lt;/p&gt;&lt;p class="mobile-post"&gt; Ho: Odds(Outcome-J vs Outcome-K) are independent of other 
alternatives.&lt;/p&gt;&lt;p class="mobile-post"&gt;(storing estimation results as _HAUSMAN)&lt;/p&gt;&lt;p class="mobile-post"&gt; Omitted |      chi2   df   P&amp;gt;chi2   evidence
---------+------------------------------------
       2 |     7.285   70    1.000   for Ho    
       3 |     0.057   71    1.000   for Ho    
       4 |    -4.897   69    1.000   for Ho    
       5 |     2.062   69    1.000   for Ho    
       6 |    -1.460   69    1.000   for Ho    
       7 |    -4.474   69    1.000   for Ho    
----------------------------------------------&lt;/p&gt;&lt;p class="mobile-post"&gt;**** Small-Hsiao tests of IIA assumption&lt;/p&gt;&lt;p class="mobile-post"&gt; Ho: Odds(Outcome-J vs Outcome-K) are independent of other 
alternatives.&lt;/p&gt;&lt;p class="mobile-post"&gt; Omitted |  lnL(full)  lnL(omit)    chi2   df   P&amp;gt;chi2   
evidence
---------+---------------------------------------------------
------
       2 |  -3123.828  -3080.945  85.767   17    0.000 
against Ho
       3 |  -5769.906  -5729.245  81.323   17    0.000   
against Ho
       4 |  -5647.749  -5601.483  92.532   17    0.000   
against Ho
       5 |  -5774.945  -5730.604  88.682   17    0.000   
against Ho
       6 |  -5633.140  -5594.139  78.001   17    0.000   
against Ho
       7 |  -5429.578  -5384.741  89.674   17    0.000   
against Ho
-------------------------------------------------------------
------&lt;/p&gt;&lt;p class="mobile-post"&gt;*
*   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/&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15088145-114298524536914986?l=statalist.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114298524536914986'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114298524536914986'/><link rel='alternate' type='text/html' href='http://statalist.blogspot.com/2006/03/st-re-hausman-test-after-mlogit.html' title='st: Re: hausman test after mlogit - negative&#xA; chi-square'/><author><name>statalist member</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-15088145.post-114298136535153055</id><published>2006-03-21T17:49:00.000-05:00</published><updated>2006-03-21T17:49:25.573-05:00</updated><title type='text'>st: RE: RE: RE: FW: zinb help</title><content type='html'>&lt;p class="mobile-post"&gt;You appear to be using a version other than the 
latest. The FAQ does advise making that clear. &lt;/p&gt;&lt;p class="mobile-post"&gt;Sorry; I can't tell what model you have in mind. 
But a wild guess is that you want -inflate(_cons)-. &lt;/p&gt;&lt;p class="mobile-post"&gt;Nick 
n.j.cox@durham.ac.uk &lt;/p&gt;&lt;p class="mobile-post"&gt;Rajesh Tharyan
&amp;gt; 
&amp;gt; I am seriously sorry nick I wasn't trying to be clever ... 
&amp;gt; but I did go
&amp;gt; through help and the manuals .. I was looking at the 
&amp;gt; descriptions which does
&amp;gt; not say that clearly..it says..
&amp;gt; 
&amp;gt; zinb estimates a maximum-likelihood zero-inflated negative binomial
&amp;gt; regression of depvar on varlist,where depvar is a nonnegative count
&amp;gt; variable.
&amp;gt; 
&amp;gt; Of course I didint understand the syntax diagram .. my 
&amp;gt; fault.. but now I
&amp;gt; understand that Typing [ and ] means the varlist is optional.
&amp;gt; 
&amp;gt; So the command will be zinb (var),inflate(var).. is that right?&lt;/p&gt;&lt;p class="mobile-post"&gt; &lt;/p&gt;&lt;p class="mobile-post"&gt;*
*   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/&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15088145-114298136535153055?l=statalist.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114298136535153055'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114298136535153055'/><link rel='alternate' type='text/html' href='http://statalist.blogspot.com/2006/03/st-re-re-re-fw-zinb-help.html' title='st: RE: RE: RE: FW: zinb help'/><author><name>statalist member</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-15088145.post-114298057157859899</id><published>2006-03-21T17:36:00.000-05:00</published><updated>2006-03-21T17:36:28.446-05:00</updated><title type='text'>st: RE: RE: FW: zinb help</title><content type='html'>&lt;p class="mobile-post"&gt;Hi,&lt;/p&gt;&lt;p class="mobile-post"&gt;I am seriously sorry nick I wasnt trying to be clever ... but I did go
through help and the manuals .. I was looking at the descriptions which does
not say that clearly..it says..&lt;/p&gt;&lt;p class="mobile-post"&gt;zinb estimates a maximum-likelihood zero-inflated negative binomial
regression of depvar on varlist,where depvar is a nonnegative count
variable.&lt;/p&gt;&lt;p class="mobile-post"&gt;Of course I didint understand the syntax diagram .. my fault.. but now I
understand that Typing [ and ] means the varlist is optional.&lt;/p&gt;&lt;p class="mobile-post"&gt;So the command will be zinb (var),inflate(var).. is that right?&lt;/p&gt;&lt;p class="mobile-post"&gt;Thanks 
Rajesh &lt;/p&gt;&lt;p class="mobile-post"&gt;This refers to the exchange below. &lt;/p&gt;&lt;p class="mobile-post"&gt;The syntax diagram for -zinb- 
makes it clear that independent variables 
need not be specified: thus -zinb- may be
used to fit a distribution to a response 
(dependent) variable alone. &lt;/p&gt;&lt;p class="mobile-post"&gt;So, again, do please read the help. &lt;/p&gt;&lt;p class="mobile-post"&gt;Nick
n.j.cox@durham.ac.uk &lt;/p&gt;&lt;p class="mobile-post"&gt;--------------------------- 28 February 2006 
Stata offers many commands for these distributions
and others in the same territory. &lt;/p&gt;&lt;p class="mobile-post"&gt;Please use -help-, -search- and the manual before
sending such queries to the list. &lt;/p&gt;&lt;p class="mobile-post"&gt;&amp;gt; I have a dataset which looks like the one below
&amp;gt; 
&amp;gt;            Individual 1      		individual 2
&amp;gt; Time  	count             	 count
&amp;gt; 1		0                   	  1
&amp;gt; 2		1				  0
&amp;gt; 3		0				  0	
&amp;gt; 4		0				  0
&amp;gt; 5		3				  1
&amp;gt; 6		0                         0
&amp;gt; 7		1                         0
&amp;gt; 
&amp;gt; Time represents months and count represents the occurance of 
&amp;gt; an event. I
&amp;gt; understand that count might follow a  zero inflated poisson 
&amp;gt; distribution or
&amp;gt; a negative binomial  distribution. 
&amp;gt; 
&amp;gt; Are there any stata command to check if the data fits these 
&amp;gt; distributions?
&amp;gt; (just like we have the shapiro-wilk test for normality.).
&amp;gt; 
&amp;gt; My objective is to see if there is any increase in the counts 
&amp;gt; between say
&amp;gt; period1 (time 1 to 3) and period2 (time 4 to7) for each 
&amp;gt; individual. And for
&amp;gt; all individuals taken together...&lt;/p&gt;&lt;p class="mobile-post"&gt;----------------------------------------------------------------------------
----&lt;/p&gt;&lt;p class="mobile-post"&gt;Rajesh Tharyan
 
&amp;gt; I have asked this question before but got told off... but I 
&amp;gt; am no closer to
&amp;gt; finding an answer... I know there is "nbfit"  to fit a  
&amp;gt; negative binomial
&amp;gt; distribution to a single variable by the method of maximum 
&amp;gt; likelihood. Is
&amp;gt; there something similar to fit a zero inflated negative binomial
&amp;gt; distribution to a single variable? I found nbvargr which fits 
&amp;gt; a poisson and
&amp;gt; a negbinomial dist to a variable but nothing on zero inflated 
&amp;gt; distributions.
&amp;gt; 
&amp;gt; The only commands related to zero inflated models I found were zip and
&amp;gt; zinb...
&amp;gt; 
&amp;gt; I am sorry if it is still a very dumb question.. &lt;/p&gt;&lt;p class="mobile-post"&gt;*
*   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/&lt;/p&gt;&lt;p class="mobile-post"&gt;*
*   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/&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15088145-114298057157859899?l=statalist.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114298057157859899'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114298057157859899'/><link rel='alternate' type='text/html' href='http://statalist.blogspot.com/2006/03/st-re-re-fw-zinb-help.html' title='st: RE: RE: FW: zinb help'/><author><name>statalist member</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-15088145.post-114297938737805022</id><published>2006-03-21T17:16:00.000-05:00</published><updated>2006-03-21T17:16:28.883-05:00</updated><title type='text'>st: RE: FW: zinb help</title><content type='html'>&lt;p class="mobile-post"&gt;This refers to the exchange below. &lt;/p&gt;&lt;p class="mobile-post"&gt;The syntax diagram for -zinb- 
makes it clear that independent variables 
need not be specified: thus -zinb- may be
used to fit a distribution to a response 
(dependent) variable alone. &lt;/p&gt;&lt;p class="mobile-post"&gt;So, again, do please read the help. &lt;/p&gt;&lt;p class="mobile-post"&gt;Nick
n.j.cox@durham.ac.uk &lt;/p&gt;&lt;p class="mobile-post"&gt;--------------------------- 28 February 2006 
Stata offers many commands for these distributions
and others in the same territory. &lt;/p&gt;&lt;p class="mobile-post"&gt;Please use -help-, -search- and the manual before
sending such queries to the list. &lt;/p&gt;&lt;p class="mobile-post"&gt;&amp;gt; I have a dataset which looks like the one below
&amp;gt; 
&amp;gt;            Individual 1      		individual 2
&amp;gt; Time  	count             	 count
&amp;gt; 1		0                   	  1
&amp;gt; 2		1				  0
&amp;gt; 3		0				  0	
&amp;gt; 4		0				  0
&amp;gt; 5		3				  1
&amp;gt; 6		0                         0
&amp;gt; 7		1                         0
&amp;gt; 
&amp;gt; Time represents months and count represents the occurance of 
&amp;gt; an event. I
&amp;gt; understand that count might follow a  zero inflated poisson 
&amp;gt; distribution or
&amp;gt; a negative binomial  distribution. 
&amp;gt; 
&amp;gt; Are there any stata command to check if the data fits these 
&amp;gt; distributions?
&amp;gt; (just like we have the shapiro-wilk test for normality.).
&amp;gt; 
&amp;gt; My objective is to see if there is any increase in the counts 
&amp;gt; between say
&amp;gt; period1 (time 1 to 3) and period2 (time 4 to7) for each 
&amp;gt; individual. And for
&amp;gt; all individuals taken together...&lt;/p&gt;&lt;p class="mobile-post"&gt;--------------------------------------------------------------------------------&lt;/p&gt;&lt;p class="mobile-post"&gt;Rajesh Tharyan
 
&amp;gt; I have asked this question before but got told off... but I 
&amp;gt; am no closer to
&amp;gt; finding an answer... I know there is "nbfit"  to fit a  
&amp;gt; negative binomial
&amp;gt; distribution to a single variable by the method of maximum 
&amp;gt; likelihood. Is
&amp;gt; there something similar to fit a zero inflated negative binomial
&amp;gt; distribution to a single variable? I found nbvargr which fits 
&amp;gt; a poisson and
&amp;gt; a negbinomial dist to a variable but nothing on zero inflated 
&amp;gt; distributions.
&amp;gt; 
&amp;gt; The only commands related to zero inflated models I found were zip and
&amp;gt; zinb...
&amp;gt; 
&amp;gt; I am sorry if it is still a very dumb question.. &lt;/p&gt;&lt;p class="mobile-post"&gt;*
*   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/&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15088145-114297938737805022?l=statalist.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114297938737805022'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114297938737805022'/><link rel='alternate' type='text/html' href='http://statalist.blogspot.com/2006/03/st-re-fw-zinb-help.html' title='st: RE: FW: zinb help'/><author><name>statalist member</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-15088145.post-114297813667274285</id><published>2006-03-21T16:55:00.000-05:00</published><updated>2006-03-21T16:55:38.856-05:00</updated><title type='text'>st: FW: zinb help</title><content type='html'>&lt;p class="mobile-post"&gt;Hi all,&lt;/p&gt;&lt;p class="mobile-post"&gt;I have asked this question before but got told off... but I am no closer to
finding an answer... I know there is nbfit  to fit a  negative binomial
distribution to a single variable by the method of maximum likelihood. Is
there something similar to fit a zero inflated negative binomial
distribution to a single variable? I found nbvargr which fits a poisson and
a negbinomial dist to a variable but nothing on zero inflated distributions.&lt;/p&gt;&lt;p class="mobile-post"&gt;The only commands related to zero inflated models I found were zip and
zinb...&lt;/p&gt;&lt;p class="mobile-post"&gt;I am sorry if it is still a very dumb question.. &lt;/p&gt;&lt;p class="mobile-post"&gt; 
Regards
rajesh&lt;/p&gt;&lt;p class="mobile-post"&gt;*
*   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/&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15088145-114297813667274285?l=statalist.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114297813667274285'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114297813667274285'/><link rel='alternate' type='text/html' href='http://statalist.blogspot.com/2006/03/st-fw-zinb-help.html' title='st: FW: zinb help'/><author><name>statalist member</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-15088145.post-114297431314120723</id><published>2006-03-21T15:51:00.000-05:00</published><updated>2006-03-21T15:51:53.256-05:00</updated><title type='text'>st: RE: Meta-analysis of diagnostic tests</title><content type='html'>&lt;p class="mobile-post"&gt;How is anyone expected to respond to 
your "not convinced" comment on -metan-? &lt;/p&gt;&lt;p class="mobile-post"&gt;No argument, no evidence =&amp;gt; nothing to discuss. &lt;/p&gt;&lt;p class="mobile-post"&gt;Nick 
n.j.cox@durham.ac.uk &lt;/p&gt;&lt;p class="mobile-post"&gt;Seligman, Hilary
 
&amp;gt; Has anybody used Stata to do a meta-analysis of diagnostic tests?
&amp;gt; Specifically, I would like to generate summary positive and negative
&amp;gt; likelihood ratios with p-values, and an associated test of
&amp;gt; heterogeneity. 
&amp;gt; I am not convinced that the metan command (metan tp fn fp tn, with
&amp;gt; tp=true positive, fn=false negative, etc.), as some have suggested,
&amp;gt; produces correct results.  
&amp;gt; 
&amp;gt; As a (less desirable) alternative, I believe that I can use a logit
&amp;gt; command to generate a summary sensitivity/specificity.  However, I am
&amp;gt; unclear on how that would actually be coded.  
&amp;gt; 
&amp;gt; Any advice on either approach would be MUCH appreciated.
&amp;gt; &lt;/p&gt;&lt;p class="mobile-post"&gt;*
*   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/&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15088145-114297431314120723?l=statalist.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114297431314120723'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114297431314120723'/><link rel='alternate' type='text/html' href='http://statalist.blogspot.com/2006/03/st-re-meta-analysis-of-diagnostic.html' title='st: RE: Meta-analysis of diagnostic tests'/><author><name>statalist member</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-15088145.post-114297374148057466</id><published>2006-03-21T15:42:00.000-05:00</published><updated>2006-03-21T15:42:23.176-05:00</updated><title type='text'>st: ratio between oprobit marginal effects</title><content type='html'>&lt;p class="mobile-post"&gt;Dear Statalisters:
 
I am trying to perform a ratio of marginal effects after an ordered probit command.
That is, after
. oprobit y x1 x2 x3
where y = 0,1,2
I asked for the marginal effects
. mfx compute, predict (outcome(1))
. mfx compute, predict (outcome(2)) 
which gave me, say, "dydx1" and "dydx2". 
Now, what I need to know is "dydx2/dydx1" with its standard error.
I guess I need to use "nlcom" command, but I have no clue on how to write this last syntax statement, despite all my tries.
Does anyone have any clue on this matter?
Thanks.
 
 
 
 &lt;/p&gt;&lt;p class="mobile-post"&gt;*
*   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/&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15088145-114297374148057466?l=statalist.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114297374148057466'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114297374148057466'/><link rel='alternate' type='text/html' href='http://statalist.blogspot.com/2006/03/st-ratio-between-oprobit-marginal.html' title='st: ratio between oprobit marginal effects'/><author><name>statalist member</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-15088145.post-114296920543029462</id><published>2006-03-21T14:26:00.000-05:00</published><updated>2006-03-21T14:27:01.316-05:00</updated><title type='text'>st: Meta-analysis of diagnostic tests</title><content type='html'>&lt;p class="mobile-post"&gt;Has anybody used Stata to do a meta-analysis of diagnostic tests?
Specifically, I would like to generate summary positive and negative
likelihood ratios with p-values, and an associated test of
heterogeneity. 
I am not convinced that the metan command (metan tp fn fp tn, with
tp=true positive, fn=false negative, etc.), as some have suggested,
produces correct results.  &lt;/p&gt;&lt;p class="mobile-post"&gt;As a (less desirable) alternative, I believe that I can use a logit
command to generate a summary sensitivity/specificity.  However, I am
unclear on how that would actually be coded.  &lt;/p&gt;&lt;p class="mobile-post"&gt;Any advice on either approach would be MUCH appreciated.&lt;/p&gt;&lt;p class="mobile-post"&gt;Thanks very much,&lt;/p&gt;&lt;p class="mobile-post"&gt;Hilary Seligman
hseligman@medsfgh.ucsf.edu&lt;/p&gt;&lt;p class="mobile-post"&gt;*
*   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/&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15088145-114296920543029462?l=statalist.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114296920543029462'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114296920543029462'/><link rel='alternate' type='text/html' href='http://statalist.blogspot.com/2006/03/st-meta-analysis-of-diagnostic-tests.html' title='st: Meta-analysis of diagnostic tests'/><author><name>statalist member</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-15088145.post-114296332860413325</id><published>2006-03-21T12:48:00.000-05:00</published><updated>2006-03-21T12:48:48.823-05:00</updated><title type='text'>Re: st: SUR and random coefficients?</title><content type='html'>&lt;p class="mobile-post"&gt;If you don't have a solution to this with STATA you can do it
with AD Model builder's random effects module. In fact you can (almost) 
as easily do nonlinear SUR's with re's.&lt;/p&gt;&lt;p class="mobile-post"&gt;      Dave&lt;/p&gt;&lt;p class="mobile-post"&gt; &amp;gt;if someone has an answer to Stephan, I am a taker as well. Have been 
 &amp;gt;wanting to do SUR with RCM for a while.&lt;/p&gt;&lt;p class="mobile-post"&gt;----Message d'origine----
 &amp;gt;De: "Stephan Brunow" &amp;lt;Stephan.Brunow@mailbox.tu-dresden.de&amp;gt;
 &amp;gt;A: &amp;lt;statalist@hsphsun2.harvard.edu&amp;gt;
 &amp;gt;Sujet: st: SUR and random coefficients?
 &amp;gt;Date: Wed, 15 Mar 2006 12:33:43 +0100
 &amp;gt;
 &amp;gt;Dear all,
 &amp;gt;
 &amp;gt;we want to estimate a SUR model (Zellners seemingly unrelated regression)
 &amp;gt;but also want to consider a random coefficient approach (mixed
 &amp;gt;variables/multilevel model) in this context as well. Not only the 
intercept
 &amp;gt;but also variables should have the random coefficient.
 &amp;gt;Does anybody knows how we can do this in STATA? Possibly, does anybody 
host
 &amp;gt;an ado-file? It seems as if there is no way to do it with STATA at the
 &amp;gt;moment.
 &amp;gt;
 &amp;gt;Thanks for your help,
 &amp;gt;
 &amp;gt;Stephan Brunow
 &amp;gt;
 &amp;gt;
 &amp;gt;
 &amp;gt;
 &amp;gt;*
 &amp;gt;*   For searches and help try:
 &amp;gt;*   http://www.stata.com/support/faqs/res/findit.html
 &amp;gt;*   http://www.stata.com/support/statalist/faq
 &amp;gt;*   http://www.ats.ucla.edu/stat/stata/
 &amp;gt;
 &amp;gt;
-- 
David A. Fournier
P.O. Box 2040,
Sidney, B.C. V8l 3S3
Canada
Phone/FAX 250-655-3364
http://otter-rsch.com
*
*   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/&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15088145-114296332860413325?l=statalist.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114296332860413325'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114296332860413325'/><link rel='alternate' type='text/html' href='http://statalist.blogspot.com/2006/03/re-st-sur-and-random-coefficients_21.html' title='Re: st: SUR and random coefficients?'/><author><name>statalist member</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-15088145.post-114296301894019919</id><published>2006-03-21T12:43:00.000-05:00</published><updated>2006-03-21T12:43:40.513-05:00</updated><title type='text'>Re: st: frontier</title><content type='html'>&lt;p class="mobile-post"&gt;Might -help frontier postestimation- be helpful&lt;/p&gt;&lt;p class="mobile-post"&gt;khanna1@hei.unige.ch wrote:
&amp;gt; Dear Statalist members,
&amp;gt; 
&amp;gt; When using the "frontier" command to fit stochastic frontier production 
&amp;gt; models to estimate (in)efficiency using cross section data, how can one 
&amp;gt; view the individual inefficiecy for each unit of observation? I am 
&amp;gt; interested in viewing both the average inefficiency as well as the 
&amp;gt; producer specific inefficiency.
&amp;gt; 
&amp;gt; 
&amp;gt; 
&amp;gt; Thank you.
&amp;gt; 
&amp;gt; Ms. Gauri Khanna
&amp;gt; 
&amp;gt; *
&amp;gt; *   For searches and help try:
&amp;gt; *   http://www.stata.com/support/faqs/res/findit.html
&amp;gt; *   http://www.stata.com/support/statalist/faq
&amp;gt; *   http://www.ats.ucla.edu/stat/stata/
&amp;gt; 
*
*   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/&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15088145-114296301894019919?l=statalist.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114296301894019919'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114296301894019919'/><link rel='alternate' type='text/html' href='http://statalist.blogspot.com/2006/03/re-st-frontier.html' title='Re: st: frontier'/><author><name>statalist member</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-15088145.post-114295636376305611</id><published>2006-03-21T10:52:00.000-05:00</published><updated>2006-03-21T10:52:43.873-05:00</updated><title type='text'>st: Mata function stata() within program</title><content type='html'>&lt;p class="mobile-post"&gt;I have a Mata function which looks as follows:&lt;/p&gt;&lt;p class="mobile-post"&gt;-------------------------------------lsq.mata--&lt;/p&gt;&lt;p class="mobile-post"&gt;(...)&lt;/p&gt;&lt;p class="mobile-post"&gt;// Mata Function to extract the substitution costs from subcost-matrix
void showhash(real rowvector R)
{
	string scalar key1
	st_local("key1",key1)
	key1 = strofreal(R[1,2])
	st_local("key1",key1)
	stata("local hash1 = mod(`key1',197)")
}&lt;/p&gt;&lt;p class="mobile-post"&gt;(...)&lt;/p&gt;&lt;p class="mobile-post"&gt;------------------------------------------------&lt;/p&gt;&lt;p class="mobile-post"&gt;The function is part of the mata-libary lsq.mlib, which compiles without 
problems. All other function in the library works well. However, if I run 
-showhash()- from within Mata I got the following error:&lt;/p&gt;&lt;p class="mobile-post"&gt;: R = 2,3,5,4
: showhash(R)
invalid syntax
                 stata():  3598  Stata returned error
              showhash():     -  function returned error
                 &amp;lt;istmt&amp;gt;:     -  function returned error
r(3598);&lt;/p&gt;&lt;p class="mobile-post"&gt;Further investigation showed that the error is connected to the -stata()- 
function. However, After running -showhash()- I can intactively run the same
-stata()- function without any problems:&lt;/p&gt;&lt;p class="mobile-post"&gt;: stata("local hash1 = mod(`key1',197)")
: stata("display `hash1'")
3&lt;/p&gt;&lt;p class="mobile-post"&gt;Any thoughts on this?&lt;/p&gt;&lt;p class="mobile-post"&gt;cu
Uli&lt;/p&gt;&lt;p class="mobile-post"&gt;-- 
kohler@wz-berlin.de
+49 (030) 25491-361
*
*   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/&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15088145-114295636376305611?l=statalist.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114295636376305611'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114295636376305611'/><link rel='alternate' type='text/html' href='http://statalist.blogspot.com/2006/03/st-mata-function-stata-within-program.html' title='st: Mata function stata() within program'/><author><name>statalist member</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-15088145.post-114295567416934915</id><published>2006-03-21T10:41:00.000-05:00</published><updated>2006-03-21T10:41:22.466-05:00</updated><title type='text'>st: hausman test (FE vs RE)</title><content type='html'>&lt;p class="mobile-post"&gt;Dear statalist members:&lt;/p&gt;&lt;p class="mobile-post"&gt;I have a doubt, the Hausman test for Fixed effect verus Random effects 
should be obtained with robust and clustered corrected standard errors or 
without them.&lt;/p&gt;&lt;p class="mobile-post"&gt;thanks all&lt;/p&gt;&lt;p class="mobile-post"&gt;felipe&lt;/p&gt;&lt;p class="mobile-post"&gt;*
*   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/&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15088145-114295567416934915?l=statalist.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114295567416934915'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114295567416934915'/><link rel='alternate' type='text/html' href='http://statalist.blogspot.com/2006/03/st-hausman-test-fe-vs-re.html' title='st: hausman test (FE vs RE)'/><author><name>statalist member</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-15088145.post-114295468457074656</id><published>2006-03-21T10:24:00.000-05:00</published><updated>2006-03-21T10:24:46.580-05:00</updated><title type='text'>st: frontier</title><content type='html'>&lt;p class="mobile-post"&gt;Dear Statalist members,&lt;/p&gt;&lt;p class="mobile-post"&gt;When using the "frontier" command to fit stochastic frontier production 
models to estimate (in)efficiency using cross section data, how can one 
view the individual inefficiecy for each unit of observation? I am 
interested in viewing both the average inefficiency as well as the 
producer specific inefficiency.&lt;/p&gt;&lt;p class="mobile-post"&gt;Thank you.&lt;/p&gt;&lt;p class="mobile-post"&gt;Ms. Gauri Khanna&lt;/p&gt;&lt;p class="mobile-post"&gt;*
*   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/&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15088145-114295468457074656?l=statalist.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114295468457074656'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114295468457074656'/><link rel='alternate' type='text/html' href='http://statalist.blogspot.com/2006/03/st-frontier.html' title='st: frontier'/><author><name>statalist member</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-15088145.post-114294513782920383</id><published>2006-03-21T07:45:00.000-05:00</published><updated>2006-03-21T07:45:37.833-05:00</updated><title type='text'>Re: st: How can I change the way Stata clusters the yvars in a bar graph?</title><content type='html'>&lt;p class="mobile-post"&gt;Deb wrote:&lt;/p&gt;&lt;p class="mobile-post"&gt;I am trying to make a bar graph that contains several y variables
grouped over 1 categorical variable that has 2 levels (0, 1).
-------------------------------------------------------------&lt;/p&gt;&lt;p class="mobile-post"&gt;Stating what command gave the undesired result would be helpful,
first to other statalisters, next to yourself.&lt;/p&gt;&lt;p class="mobile-post"&gt;Try this:&lt;/p&gt;&lt;p class="mobile-post"&gt;   clear
   sysuse uslifeexp.dta
   gen halfcent = year&amp;gt;=1950
   graph bar le_wmale le_wfemale le_bmale le_bfemale, over(halfcent)&lt;/p&gt;&lt;p class="mobile-post"&gt;Is this similar to what you want? -graph bar- takes a list of
y-variables.&lt;/p&gt;&lt;p class="mobile-post"&gt;Svend
________________________________________________________&lt;/p&gt;&lt;p class="mobile-post"&gt;Svend Juul
Institut for Folkesundhed, Afdeling for Epidemiologi
(Institute of Public Health, Department of Epidemiology)
Vennelyst Boulevard 6
DK-8000 Aarhus C,  Denmark
Phone, work:  +45 8942 6090
Phone, home:  +45 8693 7796
Fax:          +45 8613 1580
E-mail:       sj@soci.au.dk
_________________________________________________________&lt;/p&gt;&lt;p class="mobile-post"&gt;*
*   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/&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15088145-114294513782920383?l=statalist.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114294513782920383'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114294513782920383'/><link rel='alternate' type='text/html' href='http://statalist.blogspot.com/2006/03/re-st-how-can-i-change-way-stata.html' title='Re: st: How can I change the way Stata clusters the yvars in a bar graph?'/><author><name>statalist member</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-15088145.post-114294509561791656</id><published>2006-03-21T07:44:00.000-05:00</published><updated>2006-03-21T07:44:58.473-05:00</updated><title type='text'>st: Question related to treatment-effects model</title><content type='html'>&lt;p class="mobile-post"&gt;Hello,
I would like to ask a question related to the Stata command to run a
treatment-effects model using a two-step consistent estimator.
I know that the Stata command "treatreg" fits the treatment-effects
model that considers the effect of an endogenously chosen binary treatment on
another endogenous continuous variable, conditional on two sets of
independent variables.&lt;/p&gt;&lt;p class="mobile-post"&gt;HOW CAN I FIT THE TREATMENT-EFFECTS MODEL OF TWO ENDOGENOUSLY CHOSEN BINARY
TRATEMENT ON ANOTHER CONTINUOUS VARIABLE?&lt;/p&gt;&lt;p class="mobile-post"&gt;Waiting for the answer, I thanks you in advance&lt;/p&gt;&lt;p class="mobile-post"&gt;Noemi Pace&lt;/p&gt;&lt;p class="mobile-post"&gt;-- 
Noemi Pace&lt;/p&gt;&lt;p class="mobile-post"&gt;Economics Department
"Tor Vergata" University
via Columbia 2
00173 Rome
Italy&lt;/p&gt;&lt;p class="mobile-post"&gt;*
*   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/&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15088145-114294509561791656?l=statalist.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114294509561791656'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114294509561791656'/><link rel='alternate' type='text/html' href='http://statalist.blogspot.com/2006/03/st-question-related-to-treatment.html' title='st: Question related to treatment-effects model'/><author><name>statalist member</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-15088145.post-114289859581430525</id><published>2006-03-20T18:49:00.000-05:00</published><updated>2006-03-20T18:49:57.300-05:00</updated><title type='text'>Re: st: Do file editor</title><content type='html'>&lt;p class="mobile-post"&gt;From what you said it seems like you're trying to do the same thing
again and again?  If this is the case using the -program define-
command will save you a lot of hassle.  E.g.:&lt;/p&gt;&lt;p class="mobile-post"&gt;program drop _all
program define repeat_codes
.
&amp;lt;insert codes that you're repeating all over the do file&amp;gt;
.
end&lt;/p&gt;&lt;p class="mobile-post"&gt;After you have done this whenever you need to refer to those codes,
you'll just need to write:&lt;/p&gt;&lt;p class="mobile-post"&gt;repeat_codes&lt;/p&gt;&lt;p class="mobile-post"&gt;Hope this helps.&lt;/p&gt;&lt;p class="mobile-post"&gt;Ada&lt;/p&gt;&lt;p class="mobile-post"&gt;On 3/18/06, Carter Rees &amp;lt;carterrees@gmail.com&amp;gt; wrote:
&amp;gt; Greetings,
&amp;gt;
&amp;gt; Working with Stata 9.1, Windows XP.
&amp;gt;
&amp;gt; When I attempt to cut and paste text from within the do-file editor to
&amp;gt; different areas of the same do-file or from another word processing program
&amp;gt; to the do-file editor I get the following error message:
&amp;gt;
&amp;gt; "You will exceed the maximum number of characters the Do-file Editor can
&amp;gt; hold (131071 bytes) if text is pasted".
&amp;gt;
&amp;gt; So, this leaves me with the option of re-typing a lot of redundant code.  A
&amp;gt; search of the archives and FAQ has not produced an answer.  I have checked
&amp;gt; to make sure that I am not unknowingly pasting a large amount of text left
&amp;gt; on my clipboard.
&amp;gt;
&amp;gt; Thanks.
&amp;gt;
&amp;gt; Carter
&amp;gt;
&amp;gt;
&amp;gt; *
&amp;gt; *   For searches and help try:
&amp;gt; *   http://www.stata.com/support/faqs/res/findit.html
&amp;gt; *   http://www.stata.com/support/statalist/faq
&amp;gt; *   http://www.ats.ucla.edu/stat/stata/
&amp;gt;&lt;/p&gt;&lt;p class="mobile-post"&gt;--
Ada Ma
Research Fellow
Health Economics Research Unit
University of Aberdeen, UK.
http://www.abdn.ac.uk/heru/
Tel: +44 (0) 1224 553863
Fax: +44 (0) 1224 550926&lt;/p&gt;&lt;p class="mobile-post"&gt;*
*   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/&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15088145-114289859581430525?l=statalist.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114289859581430525'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114289859581430525'/><link rel='alternate' type='text/html' href='http://statalist.blogspot.com/2006/03/re-st-do-file-editor_20.html' title='Re: st: Do file editor'/><author><name>statalist member</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-15088145.post-114289577564298373</id><published>2006-03-20T18:02:00.000-05:00</published><updated>2006-03-20T18:02:55.820-05:00</updated><title type='text'>RE: st: question on gllamm (multilevel logit)</title><content type='html'>&lt;p class="mobile-post"&gt;I'm wrong. It does, currently, say "Author". This is a bit of 
a legal fiction. I certainly didn't write it all. &lt;/p&gt;&lt;p class="mobile-post"&gt;Nick 
n.j.cox@durham.ac.uk &lt;/p&gt;&lt;p class="mobile-post"&gt;&amp;gt; -----Original Message-----
&amp;gt; From: owner-statalist@hsphsun2.harvard.edu
&amp;gt; [mailto:owner-statalist@hsphsun2.harvard.edu]On Behalf Of Nick Cox
&amp;gt; Sent: 20 March 2006 22:52
&amp;gt; To: statalist@hsphsun2.harvard.edu
&amp;gt; Subject: RE: st: question on gllamm (multilevel logit)
&amp;gt; 
&amp;gt; 
&amp;gt; When Stas says "Nick Cox FAQ" I think he means
&amp;gt; the Statalist FAQ mentioned at the end of every 
&amp;gt; Statalist posting. 
&amp;gt; 
&amp;gt; The Statalist FAQ is not attributed to authors 
&amp;gt; -- only its official maintainer is mentioned -- 
&amp;gt; but includes the work of Kit Baum, Bill Gould, 
&amp;gt; Ken Higbee, Marcello Pagano, David Wormuth and 
&amp;gt; various others over the years. 
&amp;gt; 
&amp;gt; Nick 
&amp;gt; n.j.cox@durham.ac.uk 
&amp;gt; 
&amp;gt; Stas Kolenikov
&amp;gt;  
&amp;gt; &amp;gt; Without any further information, nobody on this list will
&amp;gt; &amp;gt; be able to help you -- Nick Cox FAQ makes all sorts of 
&amp;gt; suggestions as
&amp;gt; &amp;gt; to what should be included in your posting.
&amp;gt;  
&amp;gt; 
&amp;gt; *
&amp;gt; *   For searches and help try:
&amp;gt; *   http://www.stata.com/support/faqs/res/findit.html
&amp;gt; *   http://www.stata.com/support/statalist/faq
&amp;gt; *   http://www.ats.ucla.edu/stat/stata/
&amp;gt; &lt;/p&gt;&lt;p class="mobile-post"&gt;*
*   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/&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15088145-114289577564298373?l=statalist.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114289577564298373'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114289577564298373'/><link rel='alternate' type='text/html' href='http://statalist.blogspot.com/2006/03/re-st-question-on-gllamm-m_114289577564298373.html' title='RE: st: question on gllamm (multilevel logit)'/><author><name>statalist member</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-15088145.post-114289556957395495</id><published>2006-03-20T17:59:00.000-05:00</published><updated>2006-03-20T17:59:29.680-05:00</updated><title type='text'>st: RE: How can I change the way Stata clusters the yvars in a bar graph?</title><content type='html'>&lt;p class="mobile-post"&gt;You do not specify exactly what you typed or even what 
command you are using. That almost always helps 
and never hinders. &lt;/p&gt;&lt;p class="mobile-post"&gt;I don't know an automated way to do what you want, 
but it is not too difficult to knit your own. Here
is a dopey example: &lt;/p&gt;&lt;p class="mobile-post"&gt;u auto, clear
set scheme s1color 
graph bar turn, over(foreign) saving(turn_foreign, replace) asyvars /* 
	*/ yla(, ang(h)) legend(off) b2title(turn) ytitle(mean values)
graph bar trunk, over(foreign) saving(trunk_foreign, replace) asyvars /* 
	*/ yla(, ang(h)) ysc(off) legend(off) b2title(trunk)
graph combine "turn_foreign" "trunk_foreign", imargin(zero) ycommon row(1) ysize(4) xsize(6) &lt;/p&gt;&lt;p class="mobile-post"&gt;The first graph should 
	specify a -ytitle()- 
	
The second and subsequent graphs should 
	suppress the -yscale()- &lt;/p&gt;&lt;p class="mobile-post"&gt;All graphs should 
	suppress the -legend()- 
	specify the -b2title()-
	specify -saving()- &lt;/p&gt;&lt;p class="mobile-post"&gt;The -graph combine- should 
	join the graphs compactly 
	insist on a common y axis &lt;/p&gt;&lt;p class="mobile-post"&gt;Nick 
n.j.cox@durham.ac.uk &lt;/p&gt;&lt;p class="mobile-post"&gt;Deborah L. Duffy, Ph.D. 
 
&amp;gt; I am trying to make a bar graph that contains several y 
&amp;gt; variables grouped over 1
&amp;gt; categorical variable that has 2 levels (0, 1).  Stata 
&amp;gt; automatically groups all
&amp;gt; the yvars together for each level of the categorical variable, e.g., 
&amp;gt; 
&amp;gt; Cat1: yvar1 yvar2 yvar3 yvar4       Cat2: yvar1 yvar2 yvar3 yvar4
&amp;gt; 
&amp;gt; I would like to rearrange the bars into 4 clusters - 1 
&amp;gt; cluster for each yvar
&amp;gt; containing both levels of the cat var.  e.g.,
&amp;gt; 
&amp;gt; yvar1:cat1cat2   yvar2:cat1cat2   yvar3:cat1cat2    yvar4:cat1cat2
&amp;gt; 
&amp;gt; I can do this easily in SPSS ("clustered bar graph") but 
&amp;gt; haven't been able to
&amp;gt; find a way to do it with Stata.  I think what I need to do is 
&amp;gt; something like
&amp;gt; the 'ascategory' option only instead of treating the yvars as 
&amp;gt; the first over
&amp;gt; group I need them to be the second over group.  Is this possible??&lt;/p&gt;&lt;p class="mobile-post"&gt;*
*   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/&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15088145-114289556957395495?l=statalist.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114289556957395495'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114289556957395495'/><link rel='alternate' type='text/html' href='http://statalist.blogspot.com/2006/03/st-re-how-can-i-change-way-stata.html' title='st: RE: How can I change the way Stata clusters the yvars in a bar graph?'/><author><name>statalist member</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-15088145.post-114289526051578368</id><published>2006-03-20T17:54:00.000-05:00</published><updated>2006-03-20T17:54:20.950-05:00</updated><title type='text'>RE: st: question on gllamm (multilevel logit)</title><content type='html'>&lt;p class="mobile-post"&gt;When Stas says "Nick Cox FAQ" I think he means
the Statalist FAQ mentioned at the end of every 
Statalist posting. &lt;/p&gt;&lt;p class="mobile-post"&gt;The Statalist FAQ is not attributed to authors 
-- only its official maintainer is mentioned -- 
but includes the work of Kit Baum, Bill Gould, 
Ken Higbee, Marcello Pagano, David Wormuth and 
various others over the years. &lt;/p&gt;&lt;p class="mobile-post"&gt;Nick 
n.j.cox@durham.ac.uk &lt;/p&gt;&lt;p class="mobile-post"&gt;Stas Kolenikov
 
&amp;gt; Without any further information, nobody on this list will
&amp;gt; be able to help you -- Nick Cox FAQ makes all sorts of suggestions as
&amp;gt; to what should be included in your posting.
 &lt;/p&gt;&lt;p class="mobile-post"&gt;*
*   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/&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15088145-114289526051578368?l=statalist.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114289526051578368'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114289526051578368'/><link rel='alternate' type='text/html' href='http://statalist.blogspot.com/2006/03/re-st-question-on-gllamm-multilevel_20.html' title='RE: st: question on gllamm (multilevel logit)'/><author><name>statalist member</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-15088145.post-114289489419953346</id><published>2006-03-20T17:48:00.000-05:00</published><updated>2006-03-20T17:48:15.720-05:00</updated><title type='text'>Re: st: question on gllamm (multilevel logit)</title><content type='html'>&lt;p class="mobile-post"&gt;Well a number of strange things may be happening with your model
specification and your data... Check that you don't have
underidentified model (in other words, that you are not estimating the
same constant or same slope twice); and check that you have the most
recent version of -gllamm- and all the required programs (see
gllamm.org). Without any further information, nobody on this list will
be able to help you -- Nick Cox FAQ makes all sorts of suggestions as
to what should be included in your posting.&lt;/p&gt;&lt;p class="mobile-post"&gt;On 3/20/06, sj2033@columbia.edu &amp;lt;sj2033@columbia.edu&amp;gt; wrote:
&amp;gt;  I'm trying to estimate logistic multilevel model with random
&amp;gt; coefficients, using gllamm command with 'adapt' option. When I
&amp;gt; submit the command, STATA calculates Initial values for fixed
&amp;gt; effects, but keeps giving error messege of "Log-likelihood cannot
&amp;gt; be computed" when running adaptive quadrature. Does anybody know
&amp;gt; why this happens and how to get around this problem? Thanks
&amp;gt; *
&amp;gt; *   For searches and help try:
&amp;gt; *   http://www.stata.com/support/faqs/res/findit.html
&amp;gt; *   http://www.stata.com/support/statalist/faq
&amp;gt; *   http://www.ats.ucla.edu/stat/stata/
&amp;gt;&lt;/p&gt;&lt;p class="mobile-post"&gt;--
Stas Kolenikov
http://stas.kolenikov.name&lt;/p&gt;&lt;p class="mobile-post"&gt;*
*   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/&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15088145-114289489419953346?l=statalist.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114289489419953346'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114289489419953346'/><link rel='alternate' type='text/html' href='http://statalist.blogspot.com/2006/03/re-st-question-on-gllamm-multilevel.html' title='Re: st: question on gllamm (multilevel logit)'/><author><name>statalist member</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-15088145.post-114289301387728713</id><published>2006-03-20T17:16:00.000-05:00</published><updated>2006-03-20T17:16:53.880-05:00</updated><title type='text'>st: RE: Stata 9 scatter plot problem</title><content type='html'>&lt;p class="mobile-post"&gt;Make sure both your executable and ados
are up-to-date. Type -update query-. &lt;/p&gt;&lt;p class="mobile-post"&gt;Nick 
n.j.cox@durham.ac.uk &lt;/p&gt;&lt;p class="mobile-post"&gt;Jonathan A. Schwabish
 
&amp;gt; I just installed Stata 9 and am getting a weird error
&amp;gt; when running a scatter plot (simple command line:
&amp;gt; scatter var1 var2). I get a long line of errors that
&amp;gt; start with "(note: scheme s2color not found, using
&amp;gt; s2color)" and then later I get "system limit
&amp;gt; exceeded-see manual". Any ideas? Do I need to
&amp;gt; reinstall?&lt;/p&gt;&lt;p class="mobile-post"&gt;*
*   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/&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15088145-114289301387728713?l=statalist.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114289301387728713'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114289301387728713'/><link rel='alternate' type='text/html' href='http://statalist.blogspot.com/2006/03/st-re-stata-9-scatter-plot-problem.html' title='st: RE: Stata 9 scatter plot problem'/><author><name>statalist member</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-15088145.post-114289274947217794</id><published>2006-03-20T17:12:00.000-05:00</published><updated>2006-03-20T17:12:29.563-05:00</updated><title type='text'>st: Stata 9 scatter plot problem</title><content type='html'>&lt;p class="mobile-post"&gt;I just installed Stata 9 and am getting a weird error
when running a scatter plot (simple command line:
scatter var1 var2). I get a long line of errors that
start with "(note: scheme s2color not found, using
s2color)" and then later I get "system limit
exceeded-see manual". Any ideas? Do I need to
reinstall?&lt;/p&gt;&lt;p class="mobile-post"&gt;Thanks,
jon&lt;/p&gt;&lt;p class="mobile-post"&gt;__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
*
*   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/&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15088145-114289274947217794?l=statalist.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114289274947217794'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114289274947217794'/><link rel='alternate' type='text/html' href='http://statalist.blogspot.com/2006/03/st-stata-9-scatter-plot-problem.html' title='st: Stata 9 scatter plot problem'/><author><name>statalist member</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-15088145.post-114289249913412395</id><published>2006-03-20T17:08:00.000-05:00</published><updated>2006-03-20T17:08:19.986-05:00</updated><title type='text'>st: How can I change the way Stata clusters the yvars in a bar graph?</title><content type='html'>&lt;p class="mobile-post"&gt;Hello all,&lt;/p&gt;&lt;p class="mobile-post"&gt;I am trying to make a bar graph that contains several y variables grouped over
1
categorical variable that has 2 levels (0, 1).  Stata automatically groups all
the yvars together for each level of the categorical variable, e.g., &lt;/p&gt;&lt;p class="mobile-post"&gt;Cat1: yvar1 yvar2 yvar3 yvar4       Cat2: yvar1 yvar2 yvar3 yvar4&lt;/p&gt;&lt;p class="mobile-post"&gt;I would like to rearrange the bars into 4 clusters - 1 cluster for each yvar
containing both levels of the cat var.  e.g.,&lt;/p&gt;&lt;p class="mobile-post"&gt;yvar1:cat1cat2   yvar2:cat1cat2   yvar3:cat1cat2    yvar4:cat1cat2&lt;/p&gt;&lt;p class="mobile-post"&gt;I can do this easily in SPSS ("clustered bar graph") but haven't been able to
find a way to do it with Stata.  I think what I need to do is something like
the 'ascategory' option only instead of treating the yvars as the first over
group I need them to be the second over group.  Is this possible??&lt;/p&gt;&lt;p class="mobile-post"&gt;Any help is much appreciated!!
Deb&lt;/p&gt;&lt;p class="mobile-post"&gt;-- 
Deborah L. Duffy, Ph.D.
Research Specialist, Center for the Interaction of Animals and Society 
School of Veterinary Medicine, Department of Clinical Studies
University of Pennsylvania
3900 Delancy Street
Philadelphia, PA 19104-6010&lt;/p&gt;&lt;p class="mobile-post"&gt;PHONE: 215-746-2089, FAX: 215-746-2090, EMAIL: duffydl@vet.upenn.edu&lt;/p&gt;&lt;p class="mobile-post"&gt;*
*   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/&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15088145-114289249913412395?l=statalist.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114289249913412395'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114289249913412395'/><link rel='alternate' type='text/html' href='http://statalist.blogspot.com/2006/03/st-how-can-i-change-way-stata-clusters.html' title='st: How can I change the way Stata clusters the yvars in a bar graph?'/><author><name>statalist member</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-15088145.post-114289165655367493</id><published>2006-03-20T16:54:00.000-05:00</published><updated>2006-03-20T16:54:18.076-05:00</updated><title type='text'>st: question on gllamm (multilevel logit)</title><content type='html'>&lt;p class="mobile-post"&gt; I'm trying to estimate logistic multilevel model with random
coefficients, using gllamm command with 'adapt' option. When I
submit the command, STATA calculates Initial values for fixed
effects, but keeps giving error messege of "Log-likelihood cannot
be computed" when running adaptive quadrature. Does anybody know
why this happens and how to get around this problem? Thanks
*
*   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/&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15088145-114289165655367493?l=statalist.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114289165655367493'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114289165655367493'/><link rel='alternate' type='text/html' href='http://statalist.blogspot.com/2006/03/st-question-on-gllamm-multilevel-logit.html' title='st: question on gllamm (multilevel logit)'/><author><name>statalist member</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-15088145.post-114288500165746698</id><published>2006-03-20T15:03:00.000-05:00</published><updated>2006-03-20T15:03:23.450-05:00</updated><title type='text'>RE: st: corrupted png files in 64-bit Stata 9 for Windows?</title><content type='html'>&lt;p class="mobile-post"&gt;Anders Alexandersson (andersalex@gmail.com) asks about PNG files
created by Stata 9 for 64-bit x86-64 Windows:
&amp;gt; I'm unable to create valid PNG files with -graph export- in 64-bit
&amp;gt; Stata 9 for Windows. Is it a bug in 64-bit Stata 9 for Windows?
&amp;gt; 
&amp;gt; After I have created a graph, I use -graph export fig1.png, replace-
&amp;gt; and Stata creates the file fig1.png and writes the note "(file
&amp;gt; fig1.png written in PNG format)". But the file cannot be open in the
&amp;gt; latest versions of Internet Explorer or Firefox on my computer using
&amp;gt; 64-bit Windows XP (x86), service pack 1. It can be open fine with
&amp;gt; Windows Picture and Fax Viewer and Windows Explorer displays the
&amp;gt; thumbnail picture fine. &lt;/p&gt;&lt;p class="mobile-post"&gt;I have just reproduced this and verified that it is a bug.  It
appears that Stata 9 for 64-bit x86-64 Windows is putting valid
data in PNG files it creates, but is filling in an incorrect
checksum value to 'validate' that data.&lt;/p&gt;&lt;p class="mobile-post"&gt;Windows Explorer and Windows Picture and Fax Viewer are ignoring the
checksum, and can thus display the PNG without a problem.  IE and
Firefox are looking at the checksum before trying to display the PNG
data.&lt;/p&gt;&lt;p class="mobile-post"&gt;This will be fixed in the next executable update.&lt;/p&gt;&lt;p class="mobile-post"&gt;Alan
(ariley@stata.com)&lt;/p&gt;&lt;p class="mobile-post"&gt;*
*   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/&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15088145-114288500165746698?l=statalist.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114288500165746698'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114288500165746698'/><link rel='alternate' type='text/html' href='http://statalist.blogspot.com/2006/03/re-st-corrupted-png-files-in-64-bit.html' title='RE: st: corrupted png files in 64-bit Stata 9 for Windows?'/><author><name>statalist member</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-15088145.post-114287957631720949</id><published>2006-03-20T13:32:00.000-05:00</published><updated>2006-03-20T13:33:29.126-05:00</updated><title type='text'>RE: st: ivreset</title><content type='html'>&lt;p class="mobile-post"&gt;Emails crossing in the post...  I think you're probably right, though.&lt;/p&gt;&lt;p class="mobile-post"&gt;--Mark &lt;/p&gt;&lt;p class="mobile-post"&gt;&amp;gt; -----Original Message-----
&amp;gt; From: owner-statalist@hsphsun2.harvard.edu 
&amp;gt; [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of 
&amp;gt; Arne Risa Hole
&amp;gt; Sent: 20 March 2006 18:08
&amp;gt; To: statalist@hsphsun2.harvard.edu
&amp;gt; Subject: Re: st: ivreset
&amp;gt; 
&amp;gt; Mark,
&amp;gt; 
&amp;gt; Note, however, that it is only because of the collinearity 
&amp;gt; problem - the fact that one variable is dropped from the 
&amp;gt; model when the forecast is not rescaled - that the test 
&amp;gt; statistics differ in your OLS example.
&amp;gt; The rescaling does not matter in a test with only the squared 
&amp;gt; and cubed forecasts for example.
&amp;gt; 
&amp;gt; This is different in the case of IV: even when collinearity 
&amp;gt; is not a problem the test statistics differ, as the example 
&amp;gt; of running Austin's code with and without the rescaling shows.
&amp;gt; 
&amp;gt; The solution is probably to rescale after creating the 
&amp;gt; polynomials as you suggest - this way of rescaling the 
&amp;gt; forecasts does not affect the test statistic in either case, 
&amp;gt; IV or OLS, and may solve the numerical problems that using 
&amp;gt; the actual forcast might introduce - on the other hand it 
&amp;gt; doesn't seem to sort out the collinearity so this problem remains..
&amp;gt; 
&amp;gt; Cheers,
&amp;gt; Arne
&amp;gt; 
&amp;gt; 
&amp;gt; 
&amp;gt; 
&amp;gt; On 20/03/06, Schaffer, Mark E &amp;lt;M.E.Schaffer@hw.ac.uk&amp;gt; wrote:
&amp;gt; &amp;gt; Arne,
&amp;gt; &amp;gt;
&amp;gt; &amp;gt; I think you are onto something here.  The rescaling should perhaps 
&amp;gt; &amp;gt; take place *after* creating the polynomials, not before.
&amp;gt; &amp;gt;
&amp;gt; &amp;gt; That said, Stata's official -ovtest- also rescales first, 
&amp;gt; then creates 
&amp;gt; &amp;gt; the polynomials.  When I wrote -ivreset-, I had used replication of 
&amp;gt; &amp;gt; the output of -ovtest- as a check, and I used the same approach to 
&amp;gt; &amp;gt; rescaling yhat, namely rescale and then create polynomials (rather 
&amp;gt; &amp;gt; than create polynomials and then rescale).
&amp;gt; &amp;gt;
&amp;gt; &amp;gt; Here is an example that demonstrates that (a) rescaling 
&amp;gt; after creating 
&amp;gt; &amp;gt; the polynomials leaves the reset statistic unchanged, and (b) 
&amp;gt; &amp;gt; rescaling before creating the polynomials replicates the output of 
&amp;gt; &amp;gt; official -ovtest-.  Note that there are collinearity 
&amp;gt; problems with (a) 
&amp;gt; &amp;gt; even after rescaling, which makes me hesitate...
&amp;gt; &amp;gt;
&amp;gt; &amp;gt; Does anyone else want to comment?
&amp;gt; &amp;gt;
&amp;gt; &amp;gt; --Mark
&amp;gt; &amp;gt;
&amp;gt; &amp;gt; *********** do code ***************
&amp;gt; &amp;gt;
&amp;gt; &amp;gt; use http://fmwww.bc.edu/ec-p/data/hayashi/griliches76.dta, clear 
&amp;gt; &amp;gt; capture drop yhat* qui regress lw s qui predict double yhat
&amp;gt; &amp;gt; * yhatr=rescaled yhat
&amp;gt; &amp;gt; sum yhat, meanonly
&amp;gt; &amp;gt; qui gen double yhatr = (yhat-r(min))/(r(max)-r(min)) qui gen double 
&amp;gt; &amp;gt; yhat2=yhat^2 qui gen double yhat3=yhat^3 qui gen double 
&amp;gt; yhat4=yhat^4 
&amp;gt; &amp;gt; qui gen double yhatr2=yhatr^2 qui gen double yhatr3=yhatr^3 qui gen 
&amp;gt; &amp;gt; double yhatr4=yhatr^4
&amp;gt; &amp;gt; * yhatrr2=rescaled yhat2
&amp;gt; &amp;gt; * yhatrr3=rescaled yhat3
&amp;gt; &amp;gt; * yhatrr4=rescaled yhat4
&amp;gt; &amp;gt; sum yhat2, meanonly
&amp;gt; &amp;gt; qui gen double yhatrr2 = (yhat2-r(min))/(r(max)-r(min)) sum yhat3, 
&amp;gt; &amp;gt; meanonly qui gen double yhatrr3 = 
&amp;gt; (yhat3-r(min))/(r(max)-r(min)) sum 
&amp;gt; &amp;gt; yhat4, meanonly qui gen double yhatrr4 = 
&amp;gt; &amp;gt; (yhat4-r(min))/(r(max)-r(min)) sum yhat*
&amp;gt; &amp;gt;
&amp;gt; &amp;gt; * Unrescaled RESET
&amp;gt; &amp;gt; qui regress lw s yhat2 yhat3 yhat4
&amp;gt; &amp;gt; testparm yhat*
&amp;gt; &amp;gt; * yhat that is first ^2, ^3, ^4, then rescaled
&amp;gt; &amp;gt; * Output identical to unrescaled RESET qui regress lw s yhatrr2 
&amp;gt; &amp;gt; yhatrr3 yhatrr4 testparm yhat*
&amp;gt; &amp;gt; * yhat that is first rescaled, then ^2, ^3, ^4
&amp;gt; &amp;gt; * Output different from unrescaled RESET qui regress lw s yhatr2 
&amp;gt; &amp;gt; yhatr3 yhatr4 testparm yhat*
&amp;gt; &amp;gt; * Stata's built-in ovtest
&amp;gt; &amp;gt; * Output again different from unrescaled RESET qui regress 
&amp;gt; lw s Ovtest
&amp;gt; &amp;gt;
&amp;gt; &amp;gt; ************* output ****************
&amp;gt; &amp;gt;
&amp;gt; &amp;gt;
&amp;gt; &amp;gt; . use http://fmwww.bc.edu/ec-p/data/hayashi/griliches76.dta, clear 
&amp;gt; &amp;gt; (Wages of Very Young Men, Zvi Griliches, J.Pol.Ec. 1976)
&amp;gt; &amp;gt;
&amp;gt; &amp;gt; . capture drop yhat*
&amp;gt; &amp;gt;
&amp;gt; &amp;gt; . qui regress lw s
&amp;gt; &amp;gt;
&amp;gt; &amp;gt; . qui predict double yhat
&amp;gt; &amp;gt;
&amp;gt; &amp;gt; . * yhatr=rescaled yhat
&amp;gt; &amp;gt; . sum yhat, meanonly
&amp;gt; &amp;gt;
&amp;gt; &amp;gt; . qui gen double yhatr = (yhat-r(min))/(r(max)-r(min))
&amp;gt; &amp;gt;
&amp;gt; &amp;gt; . qui gen double yhat2=yhat^2
&amp;gt; &amp;gt;
&amp;gt; &amp;gt; . qui gen double yhat3=yhat^3
&amp;gt; &amp;gt;
&amp;gt; &amp;gt; . qui gen double yhat4=yhat^4
&amp;gt; &amp;gt;
&amp;gt; &amp;gt; . qui gen double yhatr2=yhatr^2
&amp;gt; &amp;gt;
&amp;gt; &amp;gt; . qui gen double yhatr3=yhatr^3
&amp;gt; &amp;gt;
&amp;gt; &amp;gt; . qui gen double yhatr4=yhatr^4
&amp;gt; &amp;gt;
&amp;gt; &amp;gt; . * yhatrr2=rescaled yhat2
&amp;gt; &amp;gt; . * yhatrr3=rescaled yhat3
&amp;gt; &amp;gt; . * yhatrr4=rescaled yhat4
&amp;gt; &amp;gt; . sum yhat2, meanonly
&amp;gt; &amp;gt;
&amp;gt; &amp;gt; . qui gen double yhatrr2 = (yhat2-r(min))/(r(max)-r(min))
&amp;gt; &amp;gt;
&amp;gt; &amp;gt; . sum yhat3, meanonly
&amp;gt; &amp;gt;
&amp;gt; &amp;gt; . qui gen double yhatrr3 = (yhat3-r(min))/(r(max)-r(min))
&amp;gt; &amp;gt;
&amp;gt; &amp;gt; . sum yhat4, meanonly
&amp;gt; &amp;gt;
&amp;gt; &amp;gt; . qui gen double yhatrr4 = (yhat4-r(min))/(r(max)-r(min))
&amp;gt; &amp;gt;
&amp;gt; &amp;gt; . sum yhat*
&amp;gt; &amp;gt;
&amp;gt; &amp;gt;    Variable |       Obs        Mean    Std. Dev.       Min  
&amp;gt;       Max
&amp;gt; &amp;gt; 
&amp;gt; -------------+--------------------------------------------------------
&amp;gt; &amp;gt;        yhat |       758    5.686739    .2156493   5.261107  
&amp;gt;  6.130727
&amp;gt; &amp;gt;       yhatr |       758    .4894459    .2479809          0  
&amp;gt;         1
&amp;gt; &amp;gt;       yhat2 |       758    32.38544    2.473995   27.67924  
&amp;gt;  37.58581
&amp;gt; &amp;gt;       yhat3 |       758    184.7003     21.3139   145.6234  
&amp;gt;  230.4284
&amp;gt; &amp;gt;       yhat4 |       758    1054.929    163.4247   766.1405  
&amp;gt;  1412.693
&amp;gt; &amp;gt; 
&amp;gt; -------------+--------------------------------------------------------
&amp;gt; &amp;gt;      yhatr2 |       758    .3009707    .2769761          0  
&amp;gt;         1
&amp;gt; &amp;gt;      yhatr3 |       758    .2142687    .2681644          0  
&amp;gt;         1
&amp;gt; &amp;gt;      yhatr4 |       758    .1671979    .2530434          0  
&amp;gt;         1
&amp;gt; &amp;gt;     yhatrr2 |       758    .4750582    .2497327          0  
&amp;gt;         1
&amp;gt; &amp;gt;     yhatrr3 |       758    .4607848    .2513286          0  
&amp;gt;         1
&amp;gt; &amp;gt; 
&amp;gt; -------------+--------------------------------------------------------
&amp;gt; &amp;gt;     yhatrr4 |       758    .4466593     .252763          0  
&amp;gt;         1
&amp;gt; &amp;gt;
&amp;gt; &amp;gt; .
&amp;gt; &amp;gt; . * Unrescaled RESET
&amp;gt; &amp;gt; . qui regress lw s yhat2 yhat3 yhat4
&amp;gt; &amp;gt;
&amp;gt; &amp;gt; . testparm yhat*
&amp;gt; &amp;gt;
&amp;gt; &amp;gt;  ( 1)  yhat2 = 0
&amp;gt; &amp;gt;  ( 2)  yhat3 = 0
&amp;gt; &amp;gt;  ( 3)  yhat4 = 0
&amp;gt; &amp;gt;       Constraint 1 dropped
&amp;gt; &amp;gt;
&amp;gt; &amp;gt;       F(  2,   754) =    0.87
&amp;gt; &amp;gt;            Prob &amp;gt; F =    0.4191
&amp;gt; &amp;gt;
&amp;gt; &amp;gt; . * yhat that is first ^2, ^3, ^4, then rescaled . * Output 
&amp;gt; identical 
&amp;gt; &amp;gt; to unrescaled RESET . qui regress lw s yhatrr2 yhatrr3 yhatrr4
&amp;gt; &amp;gt;
&amp;gt; &amp;gt; . testparm yhat*
&amp;gt; &amp;gt;
&amp;gt; &amp;gt;  ( 1)  yhatrr2 = 0
&amp;gt; &amp;gt;  ( 2)  yhatrr3 = 0
&amp;gt; &amp;gt;  ( 3)  yhatrr4 = 0
&amp;gt; &amp;gt;       Constraint 1 dropped
&amp;gt; &amp;gt;
&amp;gt; &amp;gt;       F(  2,   754) =    0.87
&amp;gt; &amp;gt;            Prob &amp;gt; F =    0.4191
&amp;gt; &amp;gt;
&amp;gt; &amp;gt; . * yhat that is first rescaled, then ^2, ^3, ^4 . * Output 
&amp;gt; different 
&amp;gt; &amp;gt; from unrescaled RESET . qui regress lw s yhatr2 yhatr3 yhatr4
&amp;gt; &amp;gt;
&amp;gt; &amp;gt; . testparm yhat*
&amp;gt; &amp;gt;
&amp;gt; &amp;gt;  ( 1)  yhatr2 = 0
&amp;gt; &amp;gt;  ( 2)  yhatr3 = 0
&amp;gt; &amp;gt;  ( 3)  yhatr4 = 0
&amp;gt; &amp;gt;
&amp;gt; &amp;gt;       F(  3,   753) =    0.59
&amp;gt; &amp;gt;            Prob &amp;gt; F =    0.6216
&amp;gt; &amp;gt;
&amp;gt; &amp;gt; . * Stata's built-in ovtest
&amp;gt; &amp;gt; . * Output again different from unrescaled RESET . qui regress lw s
&amp;gt; &amp;gt;
&amp;gt; &amp;gt; . ovtest
&amp;gt; &amp;gt;
&amp;gt; &amp;gt; Ramsey RESET test using powers of the fitted values of lw
&amp;gt; &amp;gt;       Ho:  model has no omitted variables
&amp;gt; &amp;gt;                 F(3, 753) =      0.59
&amp;gt; &amp;gt;                  Prob &amp;gt; F =      0.6216
&amp;gt; &amp;gt;
&amp;gt; &amp;gt; .
&amp;gt; &amp;gt; end of do-file
&amp;gt; &amp;gt;
&amp;gt; &amp;gt; *************************************
&amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; -----Original Message-----
&amp;gt; &amp;gt; &amp;gt; From: owner-statalist@hsphsun2.harvard.edu
&amp;gt; &amp;gt; &amp;gt; [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf 
&amp;gt; Of Arne Risa 
&amp;gt; &amp;gt; &amp;gt; Hole
&amp;gt; &amp;gt; &amp;gt; Sent: 20 March 2006 16:03
&amp;gt; &amp;gt; &amp;gt; To: statalist@hsphsun2.harvard.edu
&amp;gt; &amp;gt; &amp;gt; Subject: Re: st: ivreset
&amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; Hi Mark,
&amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; Thank you very much for the clarifications. The rescaling 
&amp;gt; does have 
&amp;gt; &amp;gt; &amp;gt; an impact on the test statistic, however; this can be seen from 
&amp;gt; &amp;gt; &amp;gt; using Austin's code and comparing the results with and 
&amp;gt; without the 
&amp;gt; &amp;gt; &amp;gt; line:
&amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; replace yhat = (yhat-r(min))/(r(max)-r(min))
&amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; So even when the correct "optimal" forecast of yhat is used 
&amp;gt; &amp;gt; &amp;gt; (yhat=X-hat*beta-hat), rescaling the forecast affects the result. 
&amp;gt; &amp;gt; &amp;gt; This is not a problem in the case of -ovtest-, however, since the 
&amp;gt; &amp;gt; &amp;gt; Reset test statistic is invariant to the rescaling in the 
&amp;gt; OLS case.
&amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; Sorry for going on about this, but it seems to me that 
&amp;gt; since the two 
&amp;gt; &amp;gt; &amp;gt; statistics differ the correct statistic is the one without the 
&amp;gt; &amp;gt; &amp;gt; rescaling of the (yhat=X-hat*beta-hat) forecast (even though this 
&amp;gt; &amp;gt; &amp;gt; may introduce numerical precision problems in some cases).
&amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; Cheers,
&amp;gt; &amp;gt; &amp;gt; Arne
&amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; On 20/03/06, Schaffer, Mark E &amp;lt;M.E.Schaffer@hw.ac.uk&amp;gt; wrote:
&amp;gt; &amp;gt; &amp;gt; &amp;gt; Arne,
&amp;gt; &amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; -----Original Message-----
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; From: owner-statalist@hsphsun2.harvard.edu
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf
&amp;gt; &amp;gt; &amp;gt; Of Arne Risa
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; Hole
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; Sent: 18 March 2006 11:43
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; To: statalist@hsphsun2.harvard.edu
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; Subject: RE: st: ivreset
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; Austin, Mark,
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; Thank you both for your replies, rescaling the 
&amp;gt; forecast did the 
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; trick (sorry for the bad formatting of my code 
&amp;gt; before, it looked 
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; fine in my email programme).
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; I understand the motivation behind the rescaling, but I'm
&amp;gt; &amp;gt; &amp;gt; slightly
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; concerned about the fact that it produces a different
&amp;gt; &amp;gt; &amp;gt; test statistic
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; compared to using the actual forecast. Note that this 
&amp;gt; is not the 
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; case when using the Reset test following OLS - the test
&amp;gt; &amp;gt; &amp;gt; statistic is
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; invariant to the rescaling in this case.
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; I would think that since the two approaches (rescaling/ no
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; rescaling) produce different results, the correct test
&amp;gt; &amp;gt; &amp;gt; statistic is
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; that using the actual forecast?
&amp;gt; &amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; There are two different issues here.  Rescaling is one, and
&amp;gt; &amp;gt; &amp;gt; it is, in
&amp;gt; &amp;gt; &amp;gt; &amp;gt; some sense, a side issue.  The problem is that sometimes
&amp;gt; &amp;gt; &amp;gt; the yhat has
&amp;gt; &amp;gt; &amp;gt; &amp;gt; large-ish values, and the higher order polynomials of yhat that 
&amp;gt; &amp;gt; &amp;gt; &amp;gt; are included in the artificial regression can get so 
&amp;gt; big that the 
&amp;gt; &amp;gt; &amp;gt; &amp;gt; regression fails for numerical precision reasons.  Stata's
&amp;gt; &amp;gt; &amp;gt; own version
&amp;gt; &amp;gt; &amp;gt; &amp;gt; of the reset test, -ovtest-, also does this rescaling.  
&amp;gt; The test 
&amp;gt; &amp;gt; &amp;gt; &amp;gt; statistic is, of course, invariant in theory to the units
&amp;gt; &amp;gt; &amp;gt; used and hence to rescaling.
&amp;gt; &amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; The other issue is the one you might have missed.  As
&amp;gt; &amp;gt; &amp;gt; Austin pointed
&amp;gt; &amp;gt; &amp;gt; &amp;gt; out, the IV version of the RESET test cannot use 
&amp;gt; standard fitted 
&amp;gt; &amp;gt; &amp;gt; &amp;gt; values that would be generated by -predict- after 
&amp;gt; estimation using
&amp;gt; &amp;gt; &amp;gt; &amp;gt; -ivreg- or -ivreg2-.  These are yhat=X*beta-hat, and 
&amp;gt; the problem 
&amp;gt; &amp;gt; &amp;gt; &amp;gt; is that X includes some endogenous regressors.
&amp;gt; &amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; As the help file for -ivreset- explains, there are two 
&amp;gt; alternatives.
&amp;gt; &amp;gt; &amp;gt; &amp;gt; One is to use reduced form predictions for yhat, i.e., 
&amp;gt; regress y 
&amp;gt; &amp;gt; &amp;gt; &amp;gt; on all the exogenous variables (including the excluded
&amp;gt; &amp;gt; &amp;gt; instruments) and
&amp;gt; &amp;gt; &amp;gt; &amp;gt; then use -predict-.  The other is to get what Pesaran and
&amp;gt; &amp;gt; &amp;gt; Taylor call
&amp;gt; &amp;gt; &amp;gt; &amp;gt; the "optimal forecast" of yhat.  This is not 
&amp;gt; yhat=X*beta-hat, but 
&amp;gt; &amp;gt; &amp;gt; &amp;gt; yhat=X-hat*beta-hat, where X-hat includes the reduced form
&amp;gt; &amp;gt; &amp;gt; predicted
&amp;gt; &amp;gt; &amp;gt; &amp;gt; values of the endogenous regressors (rather than the 
&amp;gt; actual values).
&amp;gt; &amp;gt; &amp;gt; &amp;gt; The code that Austin kindly posted to Statalast implemented
&amp;gt; &amp;gt; &amp;gt; the latter.
&amp;gt; &amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; Cheers,
&amp;gt; &amp;gt; &amp;gt; &amp;gt; Mark
&amp;gt; &amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; Cheers
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; Arne
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; On Mar 17 2006, Schaffer, Mark E wrote:
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; Austin, Arne,
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; -----Original Message-----
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; From: Austin Nichols [mailto:austinnichols@gmail.com]
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; Sent: 16 March 2006 23:30
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; To: statalist@hsphsun2.harvard.edu
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; Subject: Re: st: ivreset
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; -findit ivreset- then -help ivreset- when installed has a
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; excellent
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; exposition that begins:
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; As Pagan and Hall (1983) and Pesaran and Taylor (1999)
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; point out, a
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; RESET test for an IV regression cannot use the standard
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; IV predicted
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; values X*beta-hat, because X includes endogenous
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; regressors that are
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; correlated with u.
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; Try this code instead:
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; use http://fmwww.bc.edu/ec-p/data/hayashi/griliches76.dta
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; qui ivreg2 lw s expr tenure rns smsa (iq=med kww) predict
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; ytilde mat
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; b=e(b) mat li b qui regress iq s expr tenure rns smsa med 
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; kww qui predict double xh gen 
&amp;gt; yhat=ytil-b[1,1]*iq+b[1,1]*xh 
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; sum yhat, meanonly qui replace yhat =
&amp;gt; &amp;gt; &amp;gt; (yhat-r(min))/(r(max)-r(min))
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; qui gen double yhat2=yhat^2 qui ivreg2 lw s expr
&amp;gt; &amp;gt; &amp;gt; tenure rns smsa
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; yhat2 (iq=med kww) test yhat2 qui ivreg2 lw s expr tenure 
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; rns
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; smsa (iq=med
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; kww) ivreset
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; Now, as to why
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt;  replace yhat = (yhat-r(min))/(r(max)-r(min)) I cannot
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; tell you, but
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; it's in ivreset.ado
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; It's to rescale yhat so that when it's squared, 
&amp;gt; cubed, etc., 
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; it doesn't get wildly out of scale relative to the other
&amp;gt; &amp;gt; &amp;gt; regressors.
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; This can cause problems for the regression that includes
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; these terms.
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; Cheers,
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; Mark
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; On 16 Mar 2006 19:10:13 +0000, Arne Risa Hole wrote:
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; I am using ivreset to do a Pesaran-Taylor Reset test
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; after ivreg2.
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; However, I am not able to replicate the result from 
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; ivreset
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; manually. For example:
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; use 
&amp;gt; http://fmwww.bc.edu/ec-p/data/hayashi/griliches76.dta
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; *
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; *   For searches and help try:
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; *   http://www.stata.com/support/faqs/res/findit.html
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; *   http://www.stata.com/support/statalist/faq
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; *   http://www.ats.ucla.edu/stat/stata/
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; *
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; *   For searches and help try:
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; *   http://www.stata.com/support/faqs/res/findit.html
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; *   http://www.stata.com/support/statalist/faq
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; *   http://www.ats.ucla.edu/stat/stata/
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; *
&amp;gt; &amp;gt; &amp;gt; &amp;gt; *   For searches and help try:
&amp;gt; &amp;gt; &amp;gt; &amp;gt; *   http://www.stata.com/support/faqs/res/findit.html
&amp;gt; &amp;gt; &amp;gt; &amp;gt; *   http://www.stata.com/support/statalist/faq
&amp;gt; &amp;gt; &amp;gt; &amp;gt; *   http://www.ats.ucla.edu/stat/stata/
&amp;gt; &amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; *
&amp;gt; &amp;gt; &amp;gt; *   For searches and help try:
&amp;gt; &amp;gt; &amp;gt; *   http://www.stata.com/support/faqs/res/findit.html
&amp;gt; &amp;gt; &amp;gt; *   http://www.stata.com/support/statalist/faq
&amp;gt; &amp;gt; &amp;gt; *   http://www.ats.ucla.edu/stat/stata/
&amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt;
&amp;gt; &amp;gt; *
&amp;gt; &amp;gt; *   For searches and help try:
&amp;gt; &amp;gt; *   http://www.stata.com/support/faqs/res/findit.html
&amp;gt; &amp;gt; *   http://www.stata.com/support/statalist/faq
&amp;gt; &amp;gt; *   http://www.ats.ucla.edu/stat/stata/
&amp;gt; &amp;gt;
&amp;gt; 
&amp;gt; *
&amp;gt; *   For searches and help try:
&amp;gt; *   http://www.stata.com/support/faqs/res/findit.html
&amp;gt; *   http://www.stata.com/support/statalist/faq
&amp;gt; *   http://www.ats.ucla.edu/stat/stata/
&amp;gt; 
&amp;gt; &lt;/p&gt;&lt;p class="mobile-post"&gt;*
*   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/&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15088145-114287957631720949?l=statalist.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114287957631720949'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114287957631720949'/><link rel='alternate' type='text/html' href='http://statalist.blogspot.com/2006/03/re-st-ivreset_114287957631720949.html' title='RE: st: ivreset'/><author><name>statalist member</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-15088145.post-114287819780681174</id><published>2006-03-20T13:09:00.001-05:00</published><updated>2006-03-20T13:10:03.466-05:00</updated><title type='text'>RE: st: ivreset</title><content type='html'>&lt;p class="mobile-post"&gt;Hi all.  I think I spoke too soon.  The differences between the
different approaches to rescaling are driven, I think, by numerical
precision problems and collinearities.&lt;/p&gt;&lt;p class="mobile-post"&gt;Here are the 3 versions of the basic ovtest using squares and cubes: no
rescaling, rescaling yhat and then squaring and cubing, and squaring and
cubing followed by rescaling.  This uses the code that I posted to the
list earlier today.  All three generate the same results.  When a yhat^4
is included, as in the example I posted earlier, is when collinearities
arise and different test statistics can be generated.&lt;/p&gt;&lt;p class="mobile-post"&gt;--Mark&lt;/p&gt;&lt;p class="mobile-post"&gt;. * Squared and cubed
. * Unrescaled RESET
. qui regress lw s yhat2 yhat3&lt;/p&gt;&lt;p class="mobile-post"&gt;. testparm yhat*&lt;/p&gt;&lt;p class="mobile-post"&gt; ( 1)  yhat2 = 0
 ( 2)  yhat3 = 0&lt;/p&gt;&lt;p class="mobile-post"&gt;       F(  2,   754) =    0.87
            Prob &amp;gt; F =    0.4188&lt;/p&gt;&lt;p class="mobile-post"&gt;. * yhat that is first ^2, ^3, then rescaled
. * Output identical to unrescaled RESET
. qui regress lw s yhatrr2 yhatrr3&lt;/p&gt;&lt;p class="mobile-post"&gt;. testparm yhat*&lt;/p&gt;&lt;p class="mobile-post"&gt; ( 1)  yhatrr2 = 0
 ( 2)  yhatrr3 = 0&lt;/p&gt;&lt;p class="mobile-post"&gt;       F(  2,   754) =    0.87
            Prob &amp;gt; F =    0.4188&lt;/p&gt;&lt;p class="mobile-post"&gt;. * yhat that is first rescaled, then ^2, ^3
. * Output different from unrescaled RESET
. qui regress lw s yhatr2 yhatr3&lt;/p&gt;&lt;p class="mobile-post"&gt;. testparm yhat*&lt;/p&gt;&lt;p class="mobile-post"&gt; ( 1)  yhatr2 = 0
 ( 2)  yhatr3 = 0&lt;/p&gt;&lt;p class="mobile-post"&gt;       F(  2,   754) =    0.87
            Prob &amp;gt; F =    0.4188&lt;/p&gt;&lt;p class="mobile-post"&gt;&amp;gt; -----Original Message-----
&amp;gt; From: owner-statalist@hsphsun2.harvard.edu 
&amp;gt; [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of 
&amp;gt; Schaffer, Mark E
&amp;gt; Sent: 20 March 2006 16:57
&amp;gt; To: statalist@hsphsun2.harvard.edu
&amp;gt; Subject: RE: st: ivreset
&amp;gt; 
&amp;gt; Arne,
&amp;gt; 
&amp;gt; I think you are onto something here.  The rescaling should 
&amp;gt; perhaps take place *after* creating the polynomials, not before.
&amp;gt; 
&amp;gt; That said, Stata's official -ovtest- also rescales first, 
&amp;gt; then creates the polynomials.  When I wrote -ivreset-, I had 
&amp;gt; used replication of the output of -ovtest- as a check, and I 
&amp;gt; used the same approach to rescaling yhat, namely rescale and 
&amp;gt; then create polynomials (rather than create polynomials and 
&amp;gt; then rescale).
&amp;gt; 
&amp;gt; Here is an example that demonstrates that (a) rescaling after 
&amp;gt; creating the polynomials leaves the reset statistic 
&amp;gt; unchanged, and (b) rescaling before creating the polynomials 
&amp;gt; replicates the output of official -ovtest-.  Note that there 
&amp;gt; are collinearity problems with (a) even after rescaling, 
&amp;gt; which makes me hesitate...
&amp;gt; 
&amp;gt; Does anyone else want to comment?
&amp;gt; 
&amp;gt; --Mark
&amp;gt; 
&amp;gt; *********** do code ***************
&amp;gt; 
&amp;gt; use http://fmwww.bc.edu/ec-p/data/hayashi/griliches76.dta, 
&amp;gt; clear capture drop yhat* qui regress lw s qui predict double yhat
&amp;gt; * yhatr=rescaled yhat
&amp;gt; sum yhat, meanonly
&amp;gt; qui gen double yhatr = (yhat-r(min))/(r(max)-r(min)) qui gen 
&amp;gt; double yhat2=yhat^2 qui gen double yhat3=yhat^3 qui gen 
&amp;gt; double yhat4=yhat^4 qui gen double yhatr2=yhatr^2 qui gen 
&amp;gt; double yhatr3=yhatr^3 qui gen double yhatr4=yhatr^4
&amp;gt; * yhatrr2=rescaled yhat2
&amp;gt; * yhatrr3=rescaled yhat3
&amp;gt; * yhatrr4=rescaled yhat4
&amp;gt; sum yhat2, meanonly
&amp;gt; qui gen double yhatrr2 = (yhat2-r(min))/(r(max)-r(min)) sum 
&amp;gt; yhat3, meanonly qui gen double yhatrr3 = 
&amp;gt; (yhat3-r(min))/(r(max)-r(min)) sum yhat4, meanonly qui gen 
&amp;gt; double yhatrr4 = (yhat4-r(min))/(r(max)-r(min)) sum yhat*
&amp;gt; 
&amp;gt; * Unrescaled RESET
&amp;gt; qui regress lw s yhat2 yhat3 yhat4
&amp;gt; testparm yhat*
&amp;gt; * yhat that is first ^2, ^3, ^4, then rescaled
&amp;gt; * Output identical to unrescaled RESET
&amp;gt; qui regress lw s yhatrr2 yhatrr3 yhatrr4 testparm yhat*
&amp;gt; * yhat that is first rescaled, then ^2, ^3, ^4
&amp;gt; * Output different from unrescaled RESET qui regress lw s 
&amp;gt; yhatr2 yhatr3 yhatr4 testparm yhat*
&amp;gt; * Stata's built-in ovtest
&amp;gt; * Output again different from unrescaled RESET qui regress lw s Ovtest
&amp;gt; 
&amp;gt; ************* output ****************
&amp;gt; 
&amp;gt; 
&amp;gt; . use http://fmwww.bc.edu/ec-p/data/hayashi/griliches76.dta, 
&amp;gt; clear (Wages of Very Young Men, Zvi Griliches, J.Pol.Ec. 1976)
&amp;gt; 
&amp;gt; . capture drop yhat*
&amp;gt; 
&amp;gt; . qui regress lw s 
&amp;gt; 
&amp;gt; . qui predict double yhat
&amp;gt; 
&amp;gt; . * yhatr=rescaled yhat
&amp;gt; . sum yhat, meanonly
&amp;gt; 
&amp;gt; . qui gen double yhatr = (yhat-r(min))/(r(max)-r(min))
&amp;gt; 
&amp;gt; . qui gen double yhat2=yhat^2
&amp;gt; 
&amp;gt; . qui gen double yhat3=yhat^3
&amp;gt; 
&amp;gt; . qui gen double yhat4=yhat^4
&amp;gt; 
&amp;gt; . qui gen double yhatr2=yhatr^2
&amp;gt; 
&amp;gt; . qui gen double yhatr3=yhatr^3
&amp;gt; 
&amp;gt; . qui gen double yhatr4=yhatr^4
&amp;gt; 
&amp;gt; . * yhatrr2=rescaled yhat2
&amp;gt; . * yhatrr3=rescaled yhat3
&amp;gt; . * yhatrr4=rescaled yhat4
&amp;gt; . sum yhat2, meanonly
&amp;gt; 
&amp;gt; . qui gen double yhatrr2 = (yhat2-r(min))/(r(max)-r(min))
&amp;gt; 
&amp;gt; . sum yhat3, meanonly
&amp;gt; 
&amp;gt; . qui gen double yhatrr3 = (yhat3-r(min))/(r(max)-r(min))
&amp;gt; 
&amp;gt; . sum yhat4, meanonly
&amp;gt; 
&amp;gt; . qui gen double yhatrr4 = (yhat4-r(min))/(r(max)-r(min))
&amp;gt; 
&amp;gt; . sum yhat*
&amp;gt; 
&amp;gt;     Variable |       Obs        Mean    Std. Dev.       Min        Max
&amp;gt; -------------+--------------------------------------------------------
&amp;gt;         yhat |       758    5.686739    .2156493   5.261107   6.130727
&amp;gt;        yhatr |       758    .4894459    .2479809          0          1
&amp;gt;        yhat2 |       758    32.38544    2.473995   27.67924   37.58581
&amp;gt;        yhat3 |       758    184.7003     21.3139   145.6234   230.4284
&amp;gt;        yhat4 |       758    1054.929    163.4247   766.1405   1412.693
&amp;gt; -------------+--------------------------------------------------------
&amp;gt;       yhatr2 |       758    .3009707    .2769761          0          1
&amp;gt;       yhatr3 |       758    .2142687    .2681644          0          1
&amp;gt;       yhatr4 |       758    .1671979    .2530434          0          1
&amp;gt;      yhatrr2 |       758    .4750582    .2497327          0          1
&amp;gt;      yhatrr3 |       758    .4607848    .2513286          0          1
&amp;gt; -------------+--------------------------------------------------------
&amp;gt;      yhatrr4 |       758    .4466593     .252763          0          1
&amp;gt; 
&amp;gt; . 
&amp;gt; . * Unrescaled RESET
&amp;gt; . qui regress lw s yhat2 yhat3 yhat4
&amp;gt; 
&amp;gt; . testparm yhat*
&amp;gt; 
&amp;gt;  ( 1)  yhat2 = 0
&amp;gt;  ( 2)  yhat3 = 0
&amp;gt;  ( 3)  yhat4 = 0
&amp;gt;        Constraint 1 dropped
&amp;gt; 
&amp;gt;        F(  2,   754) =    0.87
&amp;gt;             Prob &amp;gt; F =    0.4191
&amp;gt; 
&amp;gt; . * yhat that is first ^2, ^3, ^4, then rescaled . * Output 
&amp;gt; identical to unrescaled RESET . qui regress lw s yhatrr2 
&amp;gt; yhatrr3 yhatrr4
&amp;gt; 
&amp;gt; . testparm yhat*
&amp;gt; 
&amp;gt;  ( 1)  yhatrr2 = 0
&amp;gt;  ( 2)  yhatrr3 = 0
&amp;gt;  ( 3)  yhatrr4 = 0
&amp;gt;        Constraint 1 dropped
&amp;gt; 
&amp;gt;        F(  2,   754) =    0.87
&amp;gt;             Prob &amp;gt; F =    0.4191
&amp;gt; 
&amp;gt; . * yhat that is first rescaled, then ^2, ^3, ^4 . * Output 
&amp;gt; different from unrescaled RESET . qui regress lw s yhatr2 
&amp;gt; yhatr3 yhatr4
&amp;gt; 
&amp;gt; . testparm yhat*
&amp;gt; 
&amp;gt;  ( 1)  yhatr2 = 0
&amp;gt;  ( 2)  yhatr3 = 0
&amp;gt;  ( 3)  yhatr4 = 0
&amp;gt; 
&amp;gt;        F(  3,   753) =    0.59
&amp;gt;             Prob &amp;gt; F =    0.6216
&amp;gt; 
&amp;gt; . * Stata's built-in ovtest
&amp;gt; . * Output again different from unrescaled RESET . qui regress lw s
&amp;gt; 
&amp;gt; . ovtest
&amp;gt; 
&amp;gt; Ramsey RESET test using powers of the fitted values of lw
&amp;gt;        Ho:  model has no omitted variables
&amp;gt;                  F(3, 753) =      0.59
&amp;gt;                   Prob &amp;gt; F =      0.6216
&amp;gt; 
&amp;gt; . 
&amp;gt; end of do-file
&amp;gt; 
&amp;gt; *************************************
&amp;gt; 
&amp;gt; &amp;gt; -----Original Message-----
&amp;gt; &amp;gt; From: owner-statalist@hsphsun2.harvard.edu
&amp;gt; &amp;gt; [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of 
&amp;gt; Arne Risa 
&amp;gt; &amp;gt; Hole
&amp;gt; &amp;gt; Sent: 20 March 2006 16:03
&amp;gt; &amp;gt; To: statalist@hsphsun2.harvard.edu
&amp;gt; &amp;gt; Subject: Re: st: ivreset
&amp;gt; &amp;gt; 
&amp;gt; &amp;gt; Hi Mark,
&amp;gt; &amp;gt; 
&amp;gt; &amp;gt; Thank you very much for the clarifications. The rescaling 
&amp;gt; does have an 
&amp;gt; &amp;gt; impact on the test statistic, however; this can be seen from using 
&amp;gt; &amp;gt; Austin's code and comparing the results with and without the line:
&amp;gt; &amp;gt; 
&amp;gt; &amp;gt; replace yhat = (yhat-r(min))/(r(max)-r(min))
&amp;gt; &amp;gt; 
&amp;gt; &amp;gt; So even when the correct "optimal" forecast of yhat is used 
&amp;gt; &amp;gt; (yhat=X-hat*beta-hat), rescaling the forecast affects the 
&amp;gt; result. This 
&amp;gt; &amp;gt; is not a problem in the case of -ovtest-, however, since the Reset 
&amp;gt; &amp;gt; test statistic is invariant to the rescaling in the OLS case.
&amp;gt; &amp;gt; 
&amp;gt; &amp;gt; Sorry for going on about this, but it seems to me that 
&amp;gt; since the two 
&amp;gt; &amp;gt; statistics differ the correct statistic is the one without the 
&amp;gt; &amp;gt; rescaling of the (yhat=X-hat*beta-hat) forecast (even 
&amp;gt; though this may 
&amp;gt; &amp;gt; introduce numerical precision problems in some cases).
&amp;gt; &amp;gt; 
&amp;gt; &amp;gt; Cheers,
&amp;gt; &amp;gt; Arne
&amp;gt; &amp;gt; 
&amp;gt; &amp;gt; On 20/03/06, Schaffer, Mark E &amp;lt;M.E.Schaffer@hw.ac.uk&amp;gt; wrote:
&amp;gt; &amp;gt; &amp;gt; Arne,
&amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; -----Original Message-----
&amp;gt; &amp;gt; &amp;gt; &amp;gt; From: owner-statalist@hsphsun2.harvard.edu
&amp;gt; &amp;gt; &amp;gt; &amp;gt; [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf
&amp;gt; &amp;gt; Of Arne Risa
&amp;gt; &amp;gt; &amp;gt; &amp;gt; Hole
&amp;gt; &amp;gt; &amp;gt; &amp;gt; Sent: 18 March 2006 11:43
&amp;gt; &amp;gt; &amp;gt; &amp;gt; To: statalist@hsphsun2.harvard.edu
&amp;gt; &amp;gt; &amp;gt; &amp;gt; Subject: RE: st: ivreset
&amp;gt; &amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; Austin, Mark,
&amp;gt; &amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; Thank you both for your replies, rescaling the forecast did the 
&amp;gt; &amp;gt; &amp;gt; &amp;gt; trick (sorry for the bad formatting of my code before, 
&amp;gt; it looked 
&amp;gt; &amp;gt; &amp;gt; &amp;gt; fine in my email programme).
&amp;gt; &amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; I understand the motivation behind the rescaling, but I'm
&amp;gt; &amp;gt; slightly
&amp;gt; &amp;gt; &amp;gt; &amp;gt; concerned about the fact that it produces a different
&amp;gt; &amp;gt; test statistic
&amp;gt; &amp;gt; &amp;gt; &amp;gt; compared to using the actual forecast. Note that this 
&amp;gt; is not the 
&amp;gt; &amp;gt; &amp;gt; &amp;gt; case when using the Reset test following OLS - the test
&amp;gt; &amp;gt; statistic is
&amp;gt; &amp;gt; &amp;gt; &amp;gt; invariant to the rescaling in this case.
&amp;gt; &amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; I would think that since the two approaches (rescaling/ no
&amp;gt; &amp;gt; &amp;gt; &amp;gt; rescaling) produce different results, the correct test
&amp;gt; &amp;gt; statistic is
&amp;gt; &amp;gt; &amp;gt; &amp;gt; that using the actual forecast?
&amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; There are two different issues here.  Rescaling is one, and
&amp;gt; &amp;gt; it is, in
&amp;gt; &amp;gt; &amp;gt; some sense, a side issue.  The problem is that sometimes
&amp;gt; &amp;gt; the yhat has
&amp;gt; &amp;gt; &amp;gt; large-ish values, and the higher order polynomials of 
&amp;gt; yhat that are 
&amp;gt; &amp;gt; &amp;gt; included in the artificial regression can get so big that the 
&amp;gt; &amp;gt; &amp;gt; regression fails for numerical precision reasons.  Stata's
&amp;gt; &amp;gt; own version
&amp;gt; &amp;gt; &amp;gt; of the reset test, -ovtest-, also does this rescaling.  The test 
&amp;gt; &amp;gt; &amp;gt; statistic is, of course, invariant in theory to the units
&amp;gt; &amp;gt; used and hence to rescaling.
&amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; The other issue is the one you might have missed.  As
&amp;gt; &amp;gt; Austin pointed
&amp;gt; &amp;gt; &amp;gt; out, the IV version of the RESET test cannot use standard fitted 
&amp;gt; &amp;gt; &amp;gt; values that would be generated by -predict- after estimation using
&amp;gt; &amp;gt; &amp;gt; -ivreg- or -ivreg2-.  These are yhat=X*beta-hat, and the 
&amp;gt; problem is 
&amp;gt; &amp;gt; &amp;gt; that X includes some endogenous regressors.
&amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; As the help file for -ivreset- explains, there are two 
&amp;gt; alternatives.
&amp;gt; &amp;gt; &amp;gt; One is to use reduced form predictions for yhat, i.e., 
&amp;gt; regress y on 
&amp;gt; &amp;gt; &amp;gt; all the exogenous variables (including the excluded
&amp;gt; &amp;gt; instruments) and
&amp;gt; &amp;gt; &amp;gt; then use -predict-.  The other is to get what Pesaran and
&amp;gt; &amp;gt; Taylor call
&amp;gt; &amp;gt; &amp;gt; the "optimal forecast" of yhat.  This is not yhat=X*beta-hat, but 
&amp;gt; &amp;gt; &amp;gt; yhat=X-hat*beta-hat, where X-hat includes the reduced form
&amp;gt; &amp;gt; predicted
&amp;gt; &amp;gt; &amp;gt; values of the endogenous regressors (rather than the 
&amp;gt; actual values).
&amp;gt; &amp;gt; &amp;gt; The code that Austin kindly posted to Statalast implemented
&amp;gt; &amp;gt; the latter.
&amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; Cheers,
&amp;gt; &amp;gt; &amp;gt; Mark
&amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; Cheers
&amp;gt; &amp;gt; &amp;gt; &amp;gt; Arne
&amp;gt; &amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; On Mar 17 2006, Schaffer, Mark E wrote:
&amp;gt; &amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; Austin, Arne,
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; -----Original Message-----
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; From: Austin Nichols [mailto:austinnichols@gmail.com]
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; Sent: 16 March 2006 23:30
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; To: statalist@hsphsun2.harvard.edu
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; Subject: Re: st: ivreset
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; -findit ivreset- then -help ivreset- when installed has a
&amp;gt; &amp;gt; &amp;gt; &amp;gt; excellent
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; exposition that begins:
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; As Pagan and Hall (1983) and Pesaran and Taylor (1999)
&amp;gt; &amp;gt; &amp;gt; &amp;gt; point out, a
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; RESET test for an IV regression cannot use the standard
&amp;gt; &amp;gt; &amp;gt; &amp;gt; IV predicted
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; values X*beta-hat, because X includes endogenous
&amp;gt; &amp;gt; &amp;gt; &amp;gt; regressors that are
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; correlated with u.
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; Try this code instead:
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; use http://fmwww.bc.edu/ec-p/data/hayashi/griliches76.dta
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; qui ivreg2 lw s expr tenure rns smsa (iq=med kww) predict
&amp;gt; &amp;gt; &amp;gt; &amp;gt; ytilde mat
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; b=e(b) mat li b qui regress iq s expr tenure rns 
&amp;gt; smsa med kww 
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; qui predict double xh gen yhat=ytil-b[1,1]*iq+b[1,1]*xh sum 
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; yhat, meanonly qui replace yhat =
&amp;gt; &amp;gt; (yhat-r(min))/(r(max)-r(min))
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; qui gen double yhat2=yhat^2 qui ivreg2 lw s expr
&amp;gt; &amp;gt; tenure rns smsa
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; yhat2 (iq=med kww) test yhat2 qui ivreg2 lw s expr 
&amp;gt; tenure rns
&amp;gt; &amp;gt; &amp;gt; &amp;gt; smsa (iq=med
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; kww) ivreset
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; Now, as to why
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt;  replace yhat = (yhat-r(min))/(r(max)-r(min)) I cannot
&amp;gt; &amp;gt; &amp;gt; &amp;gt; tell you, but
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; it's in ivreset.ado
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; It's to rescale yhat so that when it's squared, 
&amp;gt; cubed, etc., it 
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; doesn't get wildly out of scale relative to the other
&amp;gt; &amp;gt; regressors.
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; This can cause problems for the regression that includes
&amp;gt; &amp;gt; &amp;gt; &amp;gt; these terms.
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; Cheers,
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; Mark
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; On 16 Mar 2006 19:10:13 +0000, Arne Risa Hole wrote:
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; I am using ivreset to do a Pesaran-Taylor Reset test
&amp;gt; &amp;gt; &amp;gt; &amp;gt; after ivreg2.
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; However, I am not able to replicate the result 
&amp;gt; from ivreset
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; manually. For example:
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; use http://fmwww.bc.edu/ec-p/data/hayashi/griliches76.dta
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; *
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; *   For searches and help try:
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; *   http://www.stata.com/support/faqs/res/findit.html
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; *   http://www.stata.com/support/statalist/faq
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; *   http://www.ats.ucla.edu/stat/stata/
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; *
&amp;gt; &amp;gt; &amp;gt; &amp;gt; *   For searches and help try:
&amp;gt; &amp;gt; &amp;gt; &amp;gt; *   http://www.stata.com/support/faqs/res/findit.html
&amp;gt; &amp;gt; &amp;gt; &amp;gt; *   http://www.stata.com/support/statalist/faq
&amp;gt; &amp;gt; &amp;gt; &amp;gt; *   http://www.ats.ucla.edu/stat/stata/
&amp;gt; &amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; *
&amp;gt; &amp;gt; &amp;gt; *   For searches and help try:
&amp;gt; &amp;gt; &amp;gt; *   http://www.stata.com/support/faqs/res/findit.html
&amp;gt; &amp;gt; &amp;gt; *   http://www.stata.com/support/statalist/faq
&amp;gt; &amp;gt; &amp;gt; *   http://www.ats.ucla.edu/stat/stata/
&amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; 
&amp;gt; &amp;gt; *
&amp;gt; &amp;gt; *   For searches and help try:
&amp;gt; &amp;gt; *   http://www.stata.com/support/faqs/res/findit.html
&amp;gt; &amp;gt; *   http://www.stata.com/support/statalist/faq
&amp;gt; &amp;gt; *   http://www.ats.ucla.edu/stat/stata/
&amp;gt; &amp;gt; 
&amp;gt; &amp;gt; 
&amp;gt; 
&amp;gt; *
&amp;gt; *   For searches and help try:
&amp;gt; *   http://www.stata.com/support/faqs/res/findit.html
&amp;gt; *   http://www.stata.com/support/statalist/faq
&amp;gt; *   http://www.ats.ucla.edu/stat/stata/
&amp;gt; 
&amp;gt; &lt;/p&gt;&lt;p class="mobile-post"&gt;*
*   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/&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15088145-114287819780681174?l=statalist.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114287819780681174'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114287819780681174'/><link rel='alternate' type='text/html' href='http://statalist.blogspot.com/2006/03/re-st-ivreset_114287819780681174.html' title='RE: st: ivreset'/><author><name>statalist member</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-15088145.post-114287818930615777</id><published>2006-03-20T13:09:00.000-05:00</published><updated>2006-03-20T13:10:03.466-05:00</updated><title type='text'>Re: st: ivreset</title><content type='html'>&lt;p class="mobile-post"&gt;Mark,&lt;/p&gt;&lt;p class="mobile-post"&gt;Note, however, that it is only because of the collinearity problem -
the fact that one variable is dropped from the model when the forecast
is not rescaled - that the test statistics differ in your OLS example.
The rescaling does not matter in a test with only the squared and
cubed forecasts for example.&lt;/p&gt;&lt;p class="mobile-post"&gt;This is different in the case of IV: even when collinearity is not a
problem the test statistics differ, as the example of running Austin's
code with and without the rescaling shows.&lt;/p&gt;&lt;p class="mobile-post"&gt;The solution is probably to rescale after creating the polynomials as
you suggest - this way of rescaling the forecasts does not affect the
test statistic in either case, IV or OLS, and may solve the numerical
problems that using the actual forcast might introduce - on the other
hand it doesn't seem to sort out the collinearity so this problem
remains..&lt;/p&gt;&lt;p class="mobile-post"&gt;Cheers,
Arne&lt;/p&gt;&lt;p class="mobile-post"&gt;On 20/03/06, Schaffer, Mark E &amp;lt;M.E.Schaffer@hw.ac.uk&amp;gt; wrote:
&amp;gt; Arne,
&amp;gt;
&amp;gt; I think you are onto something here.  The rescaling should perhaps take
&amp;gt; place *after* creating the polynomials, not before.
&amp;gt;
&amp;gt; That said, Stata's official -ovtest- also rescales first, then creates
&amp;gt; the polynomials.  When I wrote -ivreset-, I had used replication of the
&amp;gt; output of -ovtest- as a check, and I used the same approach to rescaling
&amp;gt; yhat, namely rescale and then create polynomials (rather than create
&amp;gt; polynomials and then rescale).
&amp;gt;
&amp;gt; Here is an example that demonstrates that (a) rescaling after creating
&amp;gt; the polynomials leaves the reset statistic unchanged, and (b) rescaling
&amp;gt; before creating the polynomials replicates the output of official
&amp;gt; -ovtest-.  Note that there are collinearity problems with (a) even after
&amp;gt; rescaling, which makes me hesitate...
&amp;gt;
&amp;gt; Does anyone else want to comment?
&amp;gt;
&amp;gt; --Mark
&amp;gt;
&amp;gt; *********** do code ***************
&amp;gt;
&amp;gt; use http://fmwww.bc.edu/ec-p/data/hayashi/griliches76.dta, clear
&amp;gt; capture drop yhat*
&amp;gt; qui regress lw s
&amp;gt; qui predict double yhat
&amp;gt; * yhatr=rescaled yhat
&amp;gt; sum yhat, meanonly
&amp;gt; qui gen double yhatr = (yhat-r(min))/(r(max)-r(min))
&amp;gt; qui gen double yhat2=yhat^2
&amp;gt; qui gen double yhat3=yhat^3
&amp;gt; qui gen double yhat4=yhat^4
&amp;gt; qui gen double yhatr2=yhatr^2
&amp;gt; qui gen double yhatr3=yhatr^3
&amp;gt; qui gen double yhatr4=yhatr^4
&amp;gt; * yhatrr2=rescaled yhat2
&amp;gt; * yhatrr3=rescaled yhat3
&amp;gt; * yhatrr4=rescaled yhat4
&amp;gt; sum yhat2, meanonly
&amp;gt; qui gen double yhatrr2 = (yhat2-r(min))/(r(max)-r(min))
&amp;gt; sum yhat3, meanonly
&amp;gt; qui gen double yhatrr3 = (yhat3-r(min))/(r(max)-r(min))
&amp;gt; sum yhat4, meanonly
&amp;gt; qui gen double yhatrr4 = (yhat4-r(min))/(r(max)-r(min))
&amp;gt; sum yhat*
&amp;gt;
&amp;gt; * Unrescaled RESET
&amp;gt; qui regress lw s yhat2 yhat3 yhat4
&amp;gt; testparm yhat*
&amp;gt; * yhat that is first ^2, ^3, ^4, then rescaled
&amp;gt; * Output identical to unrescaled RESET
&amp;gt; qui regress lw s yhatrr2 yhatrr3 yhatrr4
&amp;gt; testparm yhat*
&amp;gt; * yhat that is first rescaled, then ^2, ^3, ^4
&amp;gt; * Output different from unrescaled RESET
&amp;gt; qui regress lw s yhatr2 yhatr3 yhatr4
&amp;gt; testparm yhat*
&amp;gt; * Stata's built-in ovtest
&amp;gt; * Output again different from unrescaled RESET
&amp;gt; qui regress lw s
&amp;gt; Ovtest
&amp;gt;
&amp;gt; ************* output ****************
&amp;gt;
&amp;gt;
&amp;gt; . use http://fmwww.bc.edu/ec-p/data/hayashi/griliches76.dta, clear
&amp;gt; (Wages of Very Young Men, Zvi Griliches, J.Pol.Ec. 1976)
&amp;gt;
&amp;gt; . capture drop yhat*
&amp;gt;
&amp;gt; . qui regress lw s
&amp;gt;
&amp;gt; . qui predict double yhat
&amp;gt;
&amp;gt; . * yhatr=rescaled yhat
&amp;gt; . sum yhat, meanonly
&amp;gt;
&amp;gt; . qui gen double yhatr = (yhat-r(min))/(r(max)-r(min))
&amp;gt;
&amp;gt; . qui gen double yhat2=yhat^2
&amp;gt;
&amp;gt; . qui gen double yhat3=yhat^3
&amp;gt;
&amp;gt; . qui gen double yhat4=yhat^4
&amp;gt;
&amp;gt; . qui gen double yhatr2=yhatr^2
&amp;gt;
&amp;gt; . qui gen double yhatr3=yhatr^3
&amp;gt;
&amp;gt; . qui gen double yhatr4=yhatr^4
&amp;gt;
&amp;gt; . * yhatrr2=rescaled yhat2
&amp;gt; . * yhatrr3=rescaled yhat3
&amp;gt; . * yhatrr4=rescaled yhat4
&amp;gt; . sum yhat2, meanonly
&amp;gt;
&amp;gt; . qui gen double yhatrr2 = (yhat2-r(min))/(r(max)-r(min))
&amp;gt;
&amp;gt; . sum yhat3, meanonly
&amp;gt;
&amp;gt; . qui gen double yhatrr3 = (yhat3-r(min))/(r(max)-r(min))
&amp;gt;
&amp;gt; . sum yhat4, meanonly
&amp;gt;
&amp;gt; . qui gen double yhatrr4 = (yhat4-r(min))/(r(max)-r(min))
&amp;gt;
&amp;gt; . sum yhat*
&amp;gt;
&amp;gt;    Variable |       Obs        Mean    Std. Dev.       Min        Max
&amp;gt; -------------+--------------------------------------------------------
&amp;gt;        yhat |       758    5.686739    .2156493   5.261107   6.130727
&amp;gt;       yhatr |       758    .4894459    .2479809          0          1
&amp;gt;       yhat2 |       758    32.38544    2.473995   27.67924   37.58581
&amp;gt;       yhat3 |       758    184.7003     21.3139   145.6234   230.4284
&amp;gt;       yhat4 |       758    1054.929    163.4247   766.1405   1412.693
&amp;gt; -------------+--------------------------------------------------------
&amp;gt;      yhatr2 |       758    .3009707    .2769761          0          1
&amp;gt;      yhatr3 |       758    .2142687    .2681644          0          1
&amp;gt;      yhatr4 |       758    .1671979    .2530434          0          1
&amp;gt;     yhatrr2 |       758    .4750582    .2497327          0          1
&amp;gt;     yhatrr3 |       758    .4607848    .2513286          0          1
&amp;gt; -------------+--------------------------------------------------------
&amp;gt;     yhatrr4 |       758    .4466593     .252763          0          1
&amp;gt;
&amp;gt; .
&amp;gt; . * Unrescaled RESET
&amp;gt; . qui regress lw s yhat2 yhat3 yhat4
&amp;gt;
&amp;gt; . testparm yhat*
&amp;gt;
&amp;gt;  ( 1)  yhat2 = 0
&amp;gt;  ( 2)  yhat3 = 0
&amp;gt;  ( 3)  yhat4 = 0
&amp;gt;       Constraint 1 dropped
&amp;gt;
&amp;gt;       F(  2,   754) =    0.87
&amp;gt;            Prob &amp;gt; F =    0.4191
&amp;gt;
&amp;gt; . * yhat that is first ^2, ^3, ^4, then rescaled
&amp;gt; . * Output identical to unrescaled RESET
&amp;gt; . qui regress lw s yhatrr2 yhatrr3 yhatrr4
&amp;gt;
&amp;gt; . testparm yhat*
&amp;gt;
&amp;gt;  ( 1)  yhatrr2 = 0
&amp;gt;  ( 2)  yhatrr3 = 0
&amp;gt;  ( 3)  yhatrr4 = 0
&amp;gt;       Constraint 1 dropped
&amp;gt;
&amp;gt;       F(  2,   754) =    0.87
&amp;gt;            Prob &amp;gt; F =    0.4191
&amp;gt;
&amp;gt; . * yhat that is first rescaled, then ^2, ^3, ^4
&amp;gt; . * Output different from unrescaled RESET
&amp;gt; . qui regress lw s yhatr2 yhatr3 yhatr4
&amp;gt;
&amp;gt; . testparm yhat*
&amp;gt;
&amp;gt;  ( 1)  yhatr2 = 0
&amp;gt;  ( 2)  yhatr3 = 0
&amp;gt;  ( 3)  yhatr4 = 0
&amp;gt;
&amp;gt;       F(  3,   753) =    0.59
&amp;gt;            Prob &amp;gt; F =    0.6216
&amp;gt;
&amp;gt; . * Stata's built-in ovtest
&amp;gt; . * Output again different from unrescaled RESET
&amp;gt; . qui regress lw s
&amp;gt;
&amp;gt; . ovtest
&amp;gt;
&amp;gt; Ramsey RESET test using powers of the fitted values of lw
&amp;gt;       Ho:  model has no omitted variables
&amp;gt;                 F(3, 753) =      0.59
&amp;gt;                  Prob &amp;gt; F =      0.6216
&amp;gt;
&amp;gt; .
&amp;gt; end of do-file
&amp;gt;
&amp;gt; *************************************
&amp;gt;
&amp;gt; &amp;gt; -----Original Message-----
&amp;gt; &amp;gt; From: owner-statalist@hsphsun2.harvard.edu
&amp;gt; &amp;gt; [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of
&amp;gt; &amp;gt; Arne Risa Hole
&amp;gt; &amp;gt; Sent: 20 March 2006 16:03
&amp;gt; &amp;gt; To: statalist@hsphsun2.harvard.edu
&amp;gt; &amp;gt; Subject: Re: st: ivreset
&amp;gt; &amp;gt;
&amp;gt; &amp;gt; Hi Mark,
&amp;gt; &amp;gt;
&amp;gt; &amp;gt; Thank you very much for the clarifications. The rescaling
&amp;gt; &amp;gt; does have an impact on the test statistic, however; this can
&amp;gt; &amp;gt; be seen from using Austin's code and comparing the results
&amp;gt; &amp;gt; with and without the line:
&amp;gt; &amp;gt;
&amp;gt; &amp;gt; replace yhat = (yhat-r(min))/(r(max)-r(min))
&amp;gt; &amp;gt;
&amp;gt; &amp;gt; So even when the correct "optimal" forecast of yhat is used
&amp;gt; &amp;gt; (yhat=X-hat*beta-hat), rescaling the forecast affects the
&amp;gt; &amp;gt; result. This is not a problem in the case of -ovtest-,
&amp;gt; &amp;gt; however, since the Reset test statistic is invariant to the
&amp;gt; &amp;gt; rescaling in the OLS case.
&amp;gt; &amp;gt;
&amp;gt; &amp;gt; Sorry for going on about this, but it seems to me that since
&amp;gt; &amp;gt; the two statistics differ the correct statistic is the one
&amp;gt; &amp;gt; without the rescaling of the (yhat=X-hat*beta-hat) forecast
&amp;gt; &amp;gt; (even though this may introduce numerical precision problems
&amp;gt; &amp;gt; in some cases).
&amp;gt; &amp;gt;
&amp;gt; &amp;gt; Cheers,
&amp;gt; &amp;gt; Arne
&amp;gt; &amp;gt;
&amp;gt; &amp;gt; On 20/03/06, Schaffer, Mark E &amp;lt;M.E.Schaffer@hw.ac.uk&amp;gt; wrote:
&amp;gt; &amp;gt; &amp;gt; Arne,
&amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; -----Original Message-----
&amp;gt; &amp;gt; &amp;gt; &amp;gt; From: owner-statalist@hsphsun2.harvard.edu
&amp;gt; &amp;gt; &amp;gt; &amp;gt; [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf
&amp;gt; &amp;gt; Of Arne Risa
&amp;gt; &amp;gt; &amp;gt; &amp;gt; Hole
&amp;gt; &amp;gt; &amp;gt; &amp;gt; Sent: 18 March 2006 11:43
&amp;gt; &amp;gt; &amp;gt; &amp;gt; To: statalist@hsphsun2.harvard.edu
&amp;gt; &amp;gt; &amp;gt; &amp;gt; Subject: RE: st: ivreset
&amp;gt; &amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; Austin, Mark,
&amp;gt; &amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; Thank you both for your replies, rescaling the forecast did the
&amp;gt; &amp;gt; &amp;gt; &amp;gt; trick (sorry for the bad formatting of my code before, it looked
&amp;gt; &amp;gt; &amp;gt; &amp;gt; fine in my email programme).
&amp;gt; &amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; I understand the motivation behind the rescaling, but I'm
&amp;gt; &amp;gt; slightly
&amp;gt; &amp;gt; &amp;gt; &amp;gt; concerned about the fact that it produces a different
&amp;gt; &amp;gt; test statistic
&amp;gt; &amp;gt; &amp;gt; &amp;gt; compared to using the actual forecast. Note that this is not the
&amp;gt; &amp;gt; &amp;gt; &amp;gt; case when using the Reset test following OLS - the test
&amp;gt; &amp;gt; statistic is
&amp;gt; &amp;gt; &amp;gt; &amp;gt; invariant to the rescaling in this case.
&amp;gt; &amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; I would think that since the two approaches (rescaling/ no
&amp;gt; &amp;gt; &amp;gt; &amp;gt; rescaling) produce different results, the correct test
&amp;gt; &amp;gt; statistic is
&amp;gt; &amp;gt; &amp;gt; &amp;gt; that using the actual forecast?
&amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; There are two different issues here.  Rescaling is one, and
&amp;gt; &amp;gt; it is, in
&amp;gt; &amp;gt; &amp;gt; some sense, a side issue.  The problem is that sometimes
&amp;gt; &amp;gt; the yhat has
&amp;gt; &amp;gt; &amp;gt; large-ish values, and the higher order polynomials of yhat that are
&amp;gt; &amp;gt; &amp;gt; included in the artificial regression can get so big that the
&amp;gt; &amp;gt; &amp;gt; regression fails for numerical precision reasons.  Stata's
&amp;gt; &amp;gt; own version
&amp;gt; &amp;gt; &amp;gt; of the reset test, -ovtest-, also does this rescaling.  The test
&amp;gt; &amp;gt; &amp;gt; statistic is, of course, invariant in theory to the units
&amp;gt; &amp;gt; used and hence to rescaling.
&amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; The other issue is the one you might have missed.  As
&amp;gt; &amp;gt; Austin pointed
&amp;gt; &amp;gt; &amp;gt; out, the IV version of the RESET test cannot use standard fitted
&amp;gt; &amp;gt; &amp;gt; values that would be generated by -predict- after estimation using
&amp;gt; &amp;gt; &amp;gt; -ivreg- or -ivreg2-.  These are yhat=X*beta-hat, and the problem is
&amp;gt; &amp;gt; &amp;gt; that X includes some endogenous regressors.
&amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; As the help file for -ivreset- explains, there are two alternatives.
&amp;gt; &amp;gt; &amp;gt; One is to use reduced form predictions for yhat, i.e., regress y on
&amp;gt; &amp;gt; &amp;gt; all the exogenous variables (including the excluded
&amp;gt; &amp;gt; instruments) and
&amp;gt; &amp;gt; &amp;gt; then use -predict-.  The other is to get what Pesaran and
&amp;gt; &amp;gt; Taylor call
&amp;gt; &amp;gt; &amp;gt; the "optimal forecast" of yhat.  This is not yhat=X*beta-hat, but
&amp;gt; &amp;gt; &amp;gt; yhat=X-hat*beta-hat, where X-hat includes the reduced form
&amp;gt; &amp;gt; predicted
&amp;gt; &amp;gt; &amp;gt; values of the endogenous regressors (rather than the actual values).
&amp;gt; &amp;gt; &amp;gt; The code that Austin kindly posted to Statalast implemented
&amp;gt; &amp;gt; the latter.
&amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; Cheers,
&amp;gt; &amp;gt; &amp;gt; Mark
&amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; Cheers
&amp;gt; &amp;gt; &amp;gt; &amp;gt; Arne
&amp;gt; &amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; On Mar 17 2006, Schaffer, Mark E wrote:
&amp;gt; &amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; Austin, Arne,
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; -----Original Message-----
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; From: Austin Nichols [mailto:austinnichols@gmail.com]
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; Sent: 16 March 2006 23:30
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; To: statalist@hsphsun2.harvard.edu
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; Subject: Re: st: ivreset
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; -findit ivreset- then -help ivreset- when installed has a
&amp;gt; &amp;gt; &amp;gt; &amp;gt; excellent
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; exposition that begins:
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; As Pagan and Hall (1983) and Pesaran and Taylor (1999)
&amp;gt; &amp;gt; &amp;gt; &amp;gt; point out, a
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; RESET test for an IV regression cannot use the standard
&amp;gt; &amp;gt; &amp;gt; &amp;gt; IV predicted
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; values X*beta-hat, because X includes endogenous
&amp;gt; &amp;gt; &amp;gt; &amp;gt; regressors that are
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; correlated with u.
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; Try this code instead:
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; use http://fmwww.bc.edu/ec-p/data/hayashi/griliches76.dta
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; qui ivreg2 lw s expr tenure rns smsa (iq=med kww) predict
&amp;gt; &amp;gt; &amp;gt; &amp;gt; ytilde mat
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; b=e(b) mat li b qui regress iq s expr tenure rns smsa med kww
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; qui predict double xh gen yhat=ytil-b[1,1]*iq+b[1,1]*xh sum
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; yhat, meanonly qui replace yhat =
&amp;gt; &amp;gt; (yhat-r(min))/(r(max)-r(min))
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; qui gen double yhat2=yhat^2 qui ivreg2 lw s expr
&amp;gt; &amp;gt; tenure rns smsa
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; yhat2 (iq=med kww) test yhat2 qui ivreg2 lw s expr tenure rns
&amp;gt; &amp;gt; &amp;gt; &amp;gt; smsa (iq=med
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; kww) ivreset
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; Now, as to why
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt;  replace yhat = (yhat-r(min))/(r(max)-r(min)) I cannot
&amp;gt; &amp;gt; &amp;gt; &amp;gt; tell you, but
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; it's in ivreset.ado
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; It's to rescale yhat so that when it's squared, cubed, etc., it
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; doesn't get wildly out of scale relative to the other
&amp;gt; &amp;gt; regressors.
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; This can cause problems for the regression that includes
&amp;gt; &amp;gt; &amp;gt; &amp;gt; these terms.
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; Cheers,
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; Mark
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; On 16 Mar 2006 19:10:13 +0000, Arne Risa Hole wrote:
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; I am using ivreset to do a Pesaran-Taylor Reset test
&amp;gt; &amp;gt; &amp;gt; &amp;gt; after ivreg2.
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; However, I am not able to replicate the result from ivreset
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; manually. For example:
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; use http://fmwww.bc.edu/ec-p/data/hayashi/griliches76.dta
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; *
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; *   For searches and help try:
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; *   http://www.stata.com/support/faqs/res/findit.html
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; *   http://www.stata.com/support/statalist/faq
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; *   http://www.ats.ucla.edu/stat/stata/
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; *
&amp;gt; &amp;gt; &amp;gt; &amp;gt; *   For searches and help try:
&amp;gt; &amp;gt; &amp;gt; &amp;gt; *   http://www.stata.com/support/faqs/res/findit.html
&amp;gt; &amp;gt; &amp;gt; &amp;gt; *   http://www.stata.com/support/statalist/faq
&amp;gt; &amp;gt; &amp;gt; &amp;gt; *   http://www.ats.ucla.edu/stat/stata/
&amp;gt; &amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; *
&amp;gt; &amp;gt; &amp;gt; *   For searches and help try:
&amp;gt; &amp;gt; &amp;gt; *   http://www.stata.com/support/faqs/res/findit.html
&amp;gt; &amp;gt; &amp;gt; *   http://www.stata.com/support/statalist/faq
&amp;gt; &amp;gt; &amp;gt; *   http://www.ats.ucla.edu/stat/stata/
&amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt;
&amp;gt; &amp;gt; *
&amp;gt; &amp;gt; *   For searches and help try:
&amp;gt; &amp;gt; *   http://www.stata.com/support/faqs/res/findit.html
&amp;gt; &amp;gt; *   http://www.stata.com/support/statalist/faq
&amp;gt; &amp;gt; *   http://www.ats.ucla.edu/stat/stata/
&amp;gt; &amp;gt;
&amp;gt; &amp;gt;
&amp;gt;
&amp;gt; *
&amp;gt; *   For searches and help try:
&amp;gt; *   http://www.stata.com/support/faqs/res/findit.html
&amp;gt; *   http://www.stata.com/support/statalist/faq
&amp;gt; *   http://www.ats.ucla.edu/stat/stata/
&amp;gt;&lt;/p&gt;&lt;p class="mobile-post"&gt;*
*   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/&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15088145-114287818930615777?l=statalist.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114287818930615777'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114287818930615777'/><link rel='alternate' type='text/html' href='http://statalist.blogspot.com/2006/03/re-st-ivreset_114287818930615777.html' title='Re: st: ivreset'/><author><name>statalist member</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-15088145.post-114287435627192415</id><published>2006-03-20T12:05:00.000-05:00</published><updated>2006-03-20T12:05:56.523-05:00</updated><title type='text'>st: corrupted png files in 64-bit Stata 9 for Windows?</title><content type='html'>&lt;p class="mobile-post"&gt;I'm unable to create valid PNG files with -graph export- in 64-bit
Stata 9 for Windows. Is it a bug in 64-bit Stata 9 for Windows?&lt;/p&gt;&lt;p class="mobile-post"&gt;After I have created a graph, I use -graph export fig1.png, replace-
and Stata creates the file fig1.png and writes the note "(file
fig1.png written in PNG format)". But the file cannot be open in the
latest versions of Internet Explorer or Firefox on my computer using
64-bit Windows XP (x86), service pack 1. It can be open fine with
Windows Picture and Fax Viewer and Windows Explorer displays the
thumbnail picture fine. I do not have this problem of viewing the PNG
file in my web browsers when the file is created using either 32-bit
Stata 9 for Windows or 32-bit Stata 9 for Linux. All my versions of
Stata 9 are updated.&lt;/p&gt;&lt;p class="mobile-post"&gt;Anders Alexandersson
andersalex@gmail.com&lt;/p&gt;&lt;p class="mobile-post"&gt;*
*   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/&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15088145-114287435627192415?l=statalist.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114287435627192415'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114287435627192415'/><link rel='alternate' type='text/html' href='http://statalist.blogspot.com/2006/03/st-corrupted-png-files-in-64-bit-stata.html' title='st: corrupted png files in 64-bit Stata 9 for Windows?'/><author><name>statalist member</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-15088145.post-114287394563828149</id><published>2006-03-20T11:59:00.000-05:00</published><updated>2006-03-20T11:59:07.103-05:00</updated><title type='text'>RE: st: ivreset</title><content type='html'>&lt;p class="mobile-post"&gt;Arne,&lt;/p&gt;&lt;p class="mobile-post"&gt;I think you are onto something here.  The rescaling should perhaps take
place *after* creating the polynomials, not before.&lt;/p&gt;&lt;p class="mobile-post"&gt;That said, Stata's official -ovtest- also rescales first, then creates
the polynomials.  When I wrote -ivreset-, I had used replication of the
output of -ovtest- as a check, and I used the same approach to rescaling
yhat, namely rescale and then create polynomials (rather than create
polynomials and then rescale).&lt;/p&gt;&lt;p class="mobile-post"&gt;Here is an example that demonstrates that (a) rescaling after creating
the polynomials leaves the reset statistic unchanged, and (b) rescaling
before creating the polynomials replicates the output of official
-ovtest-.  Note that there are collinearity problems with (a) even after
rescaling, which makes me hesitate...&lt;/p&gt;&lt;p class="mobile-post"&gt;Does anyone else want to comment?&lt;/p&gt;&lt;p class="mobile-post"&gt;--Mark&lt;/p&gt;&lt;p class="mobile-post"&gt;*********** do code ***************&lt;/p&gt;&lt;p class="mobile-post"&gt;use http://fmwww.bc.edu/ec-p/data/hayashi/griliches76.dta, clear
capture drop yhat*
qui regress lw s 
qui predict double yhat
* yhatr=rescaled yhat
sum yhat, meanonly
qui gen double yhatr = (yhat-r(min))/(r(max)-r(min))
qui gen double yhat2=yhat^2
qui gen double yhat3=yhat^3
qui gen double yhat4=yhat^4
qui gen double yhatr2=yhatr^2
qui gen double yhatr3=yhatr^3
qui gen double yhatr4=yhatr^4
* yhatrr2=rescaled yhat2
* yhatrr3=rescaled yhat3
* yhatrr4=rescaled yhat4
sum yhat2, meanonly
qui gen double yhatrr2 = (yhat2-r(min))/(r(max)-r(min))
sum yhat3, meanonly
qui gen double yhatrr3 = (yhat3-r(min))/(r(max)-r(min))
sum yhat4, meanonly
qui gen double yhatrr4 = (yhat4-r(min))/(r(max)-r(min))
sum yhat*&lt;/p&gt;&lt;p class="mobile-post"&gt;* Unrescaled RESET
qui regress lw s yhat2 yhat3 yhat4
testparm yhat*
* yhat that is first ^2, ^3, ^4, then rescaled
* Output identical to unrescaled RESET
qui regress lw s yhatrr2 yhatrr3 yhatrr4
testparm yhat*
* yhat that is first rescaled, then ^2, ^3, ^4
* Output different from unrescaled RESET
qui regress lw s yhatr2 yhatr3 yhatr4
testparm yhat*
* Stata's built-in ovtest
* Output again different from unrescaled RESET
qui regress lw s
Ovtest&lt;/p&gt;&lt;p class="mobile-post"&gt;************* output ****************&lt;/p&gt;&lt;p class="mobile-post"&gt;. use http://fmwww.bc.edu/ec-p/data/hayashi/griliches76.dta, clear
(Wages of Very Young Men, Zvi Griliches, J.Pol.Ec. 1976)&lt;/p&gt;&lt;p class="mobile-post"&gt;. capture drop yhat*&lt;/p&gt;&lt;p class="mobile-post"&gt;. qui regress lw s &lt;/p&gt;&lt;p class="mobile-post"&gt;. qui predict double yhat&lt;/p&gt;&lt;p class="mobile-post"&gt;. * yhatr=rescaled yhat
. sum yhat, meanonly&lt;/p&gt;&lt;p class="mobile-post"&gt;. qui gen double yhatr = (yhat-r(min))/(r(max)-r(min))&lt;/p&gt;&lt;p class="mobile-post"&gt;. qui gen double yhat2=yhat^2&lt;/p&gt;&lt;p class="mobile-post"&gt;. qui gen double yhat3=yhat^3&lt;/p&gt;&lt;p class="mobile-post"&gt;. qui gen double yhat4=yhat^4&lt;/p&gt;&lt;p class="mobile-post"&gt;. qui gen double yhatr2=yhatr^2&lt;/p&gt;&lt;p class="mobile-post"&gt;. qui gen double yhatr3=yhatr^3&lt;/p&gt;&lt;p class="mobile-post"&gt;. qui gen double yhatr4=yhatr^4&lt;/p&gt;&lt;p class="mobile-post"&gt;. * yhatrr2=rescaled yhat2
. * yhatrr3=rescaled yhat3
. * yhatrr4=rescaled yhat4
. sum yhat2, meanonly&lt;/p&gt;&lt;p class="mobile-post"&gt;. qui gen double yhatrr2 = (yhat2-r(min))/(r(max)-r(min))&lt;/p&gt;&lt;p class="mobile-post"&gt;. sum yhat3, meanonly&lt;/p&gt;&lt;p class="mobile-post"&gt;. qui gen double yhatrr3 = (yhat3-r(min))/(r(max)-r(min))&lt;/p&gt;&lt;p class="mobile-post"&gt;. sum yhat4, meanonly&lt;/p&gt;&lt;p class="mobile-post"&gt;. qui gen double yhatrr4 = (yhat4-r(min))/(r(max)-r(min))&lt;/p&gt;&lt;p class="mobile-post"&gt;. sum yhat*&lt;/p&gt;&lt;p class="mobile-post"&gt;    Variable |       Obs        Mean    Std. Dev.       Min        Max
-------------+--------------------------------------------------------
        yhat |       758    5.686739    .2156493   5.261107   6.130727
       yhatr |       758    .4894459    .2479809          0          1
       yhat2 |       758    32.38544    2.473995   27.67924   37.58581
       yhat3 |       758    184.7003     21.3139   145.6234   230.4284
       yhat4 |       758    1054.929    163.4247   766.1405   1412.693
-------------+--------------------------------------------------------
      yhatr2 |       758    .3009707    .2769761          0          1
      yhatr3 |       758    .2142687    .2681644          0          1
      yhatr4 |       758    .1671979    .2530434          0          1
     yhatrr2 |       758    .4750582    .2497327          0          1
     yhatrr3 |       758    .4607848    .2513286          0          1
-------------+--------------------------------------------------------
     yhatrr4 |       758    .4466593     .252763          0          1&lt;/p&gt;&lt;p class="mobile-post"&gt;. 
. * Unrescaled RESET
. qui regress lw s yhat2 yhat3 yhat4&lt;/p&gt;&lt;p class="mobile-post"&gt;. testparm yhat*&lt;/p&gt;&lt;p class="mobile-post"&gt; ( 1)  yhat2 = 0
 ( 2)  yhat3 = 0
 ( 3)  yhat4 = 0
       Constraint 1 dropped&lt;/p&gt;&lt;p class="mobile-post"&gt;       F(  2,   754) =    0.87
            Prob &amp;gt; F =    0.4191&lt;/p&gt;&lt;p class="mobile-post"&gt;. * yhat that is first ^2, ^3, ^4, then rescaled
. * Output identical to unrescaled RESET
. qui regress lw s yhatrr2 yhatrr3 yhatrr4&lt;/p&gt;&lt;p class="mobile-post"&gt;. testparm yhat*&lt;/p&gt;&lt;p class="mobile-post"&gt; ( 1)  yhatrr2 = 0
 ( 2)  yhatrr3 = 0
 ( 3)  yhatrr4 = 0
       Constraint 1 dropped&lt;/p&gt;&lt;p class="mobile-post"&gt;       F(  2,   754) =    0.87
            Prob &amp;gt; F =    0.4191&lt;/p&gt;&lt;p class="mobile-post"&gt;. * yhat that is first rescaled, then ^2, ^3, ^4
. * Output different from unrescaled RESET
. qui regress lw s yhatr2 yhatr3 yhatr4&lt;/p&gt;&lt;p class="mobile-post"&gt;. testparm yhat*&lt;/p&gt;&lt;p class="mobile-post"&gt; ( 1)  yhatr2 = 0
 ( 2)  yhatr3 = 0
 ( 3)  yhatr4 = 0&lt;/p&gt;&lt;p class="mobile-post"&gt;       F(  3,   753) =    0.59
            Prob &amp;gt; F =    0.6216&lt;/p&gt;&lt;p class="mobile-post"&gt;. * Stata's built-in ovtest
. * Output again different from unrescaled RESET
. qui regress lw s&lt;/p&gt;&lt;p class="mobile-post"&gt;. ovtest&lt;/p&gt;&lt;p class="mobile-post"&gt;Ramsey RESET test using powers of the fitted values of lw
       Ho:  model has no omitted variables
                 F(3, 753) =      0.59
                  Prob &amp;gt; F =      0.6216&lt;/p&gt;&lt;p class="mobile-post"&gt;. 
end of do-file&lt;/p&gt;&lt;p class="mobile-post"&gt;*************************************&lt;/p&gt;&lt;p class="mobile-post"&gt;&amp;gt; -----Original Message-----
&amp;gt; From: owner-statalist@hsphsun2.harvard.edu 
&amp;gt; [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of 
&amp;gt; Arne Risa Hole
&amp;gt; Sent: 20 March 2006 16:03
&amp;gt; To: statalist@hsphsun2.harvard.edu
&amp;gt; Subject: Re: st: ivreset
&amp;gt; 
&amp;gt; Hi Mark,
&amp;gt; 
&amp;gt; Thank you very much for the clarifications. The rescaling 
&amp;gt; does have an impact on the test statistic, however; this can 
&amp;gt; be seen from using Austin's code and comparing the results 
&amp;gt; with and without the line:
&amp;gt; 
&amp;gt; replace yhat = (yhat-r(min))/(r(max)-r(min))
&amp;gt; 
&amp;gt; So even when the correct "optimal" forecast of yhat is used 
&amp;gt; (yhat=X-hat*beta-hat), rescaling the forecast affects the 
&amp;gt; result. This is not a problem in the case of -ovtest-, 
&amp;gt; however, since the Reset test statistic is invariant to the 
&amp;gt; rescaling in the OLS case.
&amp;gt; 
&amp;gt; Sorry for going on about this, but it seems to me that since 
&amp;gt; the two statistics differ the correct statistic is the one 
&amp;gt; without the rescaling of the (yhat=X-hat*beta-hat) forecast 
&amp;gt; (even though this may introduce numerical precision problems 
&amp;gt; in some cases).
&amp;gt; 
&amp;gt; Cheers,
&amp;gt; Arne
&amp;gt; 
&amp;gt; On 20/03/06, Schaffer, Mark E &amp;lt;M.E.Schaffer@hw.ac.uk&amp;gt; wrote:
&amp;gt; &amp;gt; Arne,
&amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; -----Original Message-----
&amp;gt; &amp;gt; &amp;gt; From: owner-statalist@hsphsun2.harvard.edu
&amp;gt; &amp;gt; &amp;gt; [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf 
&amp;gt; Of Arne Risa 
&amp;gt; &amp;gt; &amp;gt; Hole
&amp;gt; &amp;gt; &amp;gt; Sent: 18 March 2006 11:43
&amp;gt; &amp;gt; &amp;gt; To: statalist@hsphsun2.harvard.edu
&amp;gt; &amp;gt; &amp;gt; Subject: RE: st: ivreset
&amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; Austin, Mark,
&amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; Thank you both for your replies, rescaling the forecast did the 
&amp;gt; &amp;gt; &amp;gt; trick (sorry for the bad formatting of my code before, it looked 
&amp;gt; &amp;gt; &amp;gt; fine in my email programme).
&amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; I understand the motivation behind the rescaling, but I'm 
&amp;gt; slightly 
&amp;gt; &amp;gt; &amp;gt; concerned about the fact that it produces a different 
&amp;gt; test statistic 
&amp;gt; &amp;gt; &amp;gt; compared to using the actual forecast. Note that this is not the 
&amp;gt; &amp;gt; &amp;gt; case when using the Reset test following OLS - the test 
&amp;gt; statistic is 
&amp;gt; &amp;gt; &amp;gt; invariant to the rescaling in this case.
&amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; I would think that since the two approaches (rescaling/ no
&amp;gt; &amp;gt; &amp;gt; rescaling) produce different results, the correct test 
&amp;gt; statistic is 
&amp;gt; &amp;gt; &amp;gt; that using the actual forecast?
&amp;gt; &amp;gt;
&amp;gt; &amp;gt; There are two different issues here.  Rescaling is one, and 
&amp;gt; it is, in 
&amp;gt; &amp;gt; some sense, a side issue.  The problem is that sometimes 
&amp;gt; the yhat has 
&amp;gt; &amp;gt; large-ish values, and the higher order polynomials of yhat that are 
&amp;gt; &amp;gt; included in the artificial regression can get so big that the 
&amp;gt; &amp;gt; regression fails for numerical precision reasons.  Stata's 
&amp;gt; own version 
&amp;gt; &amp;gt; of the reset test, -ovtest-, also does this rescaling.  The test 
&amp;gt; &amp;gt; statistic is, of course, invariant in theory to the units 
&amp;gt; used and hence to rescaling.
&amp;gt; &amp;gt;
&amp;gt; &amp;gt; The other issue is the one you might have missed.  As 
&amp;gt; Austin pointed 
&amp;gt; &amp;gt; out, the IV version of the RESET test cannot use standard fitted 
&amp;gt; &amp;gt; values that would be generated by -predict- after estimation using 
&amp;gt; &amp;gt; -ivreg- or -ivreg2-.  These are yhat=X*beta-hat, and the problem is 
&amp;gt; &amp;gt; that X includes some endogenous regressors.
&amp;gt; &amp;gt;
&amp;gt; &amp;gt; As the help file for -ivreset- explains, there are two alternatives.
&amp;gt; &amp;gt; One is to use reduced form predictions for yhat, i.e., regress y on 
&amp;gt; &amp;gt; all the exogenous variables (including the excluded 
&amp;gt; instruments) and 
&amp;gt; &amp;gt; then use -predict-.  The other is to get what Pesaran and 
&amp;gt; Taylor call 
&amp;gt; &amp;gt; the "optimal forecast" of yhat.  This is not yhat=X*beta-hat, but 
&amp;gt; &amp;gt; yhat=X-hat*beta-hat, where X-hat includes the reduced form 
&amp;gt; predicted 
&amp;gt; &amp;gt; values of the endogenous regressors (rather than the actual values).
&amp;gt; &amp;gt; The code that Austin kindly posted to Statalast implemented 
&amp;gt; the latter.
&amp;gt; &amp;gt;
&amp;gt; &amp;gt; Cheers,
&amp;gt; &amp;gt; Mark
&amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; Cheers
&amp;gt; &amp;gt; &amp;gt; Arne
&amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; On Mar 17 2006, Schaffer, Mark E wrote:
&amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; Austin, Arne,
&amp;gt; &amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; -----Original Message-----
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; From: Austin Nichols [mailto:austinnichols@gmail.com]
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; Sent: 16 March 2006 23:30
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; To: statalist@hsphsun2.harvard.edu
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; Subject: Re: st: ivreset
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; -findit ivreset- then -help ivreset- when installed has a
&amp;gt; &amp;gt; &amp;gt; excellent
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; exposition that begins:
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; As Pagan and Hall (1983) and Pesaran and Taylor (1999)
&amp;gt; &amp;gt; &amp;gt; point out, a
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; RESET test for an IV regression cannot use the standard
&amp;gt; &amp;gt; &amp;gt; IV predicted
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; values X*beta-hat, because X includes endogenous
&amp;gt; &amp;gt; &amp;gt; regressors that are
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; correlated with u.
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; Try this code instead:
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; use http://fmwww.bc.edu/ec-p/data/hayashi/griliches76.dta
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; qui ivreg2 lw s expr tenure rns smsa (iq=med kww) predict
&amp;gt; &amp;gt; &amp;gt; ytilde mat
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; b=e(b) mat li b qui regress iq s expr tenure rns smsa med kww 
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; qui predict double xh gen yhat=ytil-b[1,1]*iq+b[1,1]*xh sum 
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; yhat, meanonly qui replace yhat = 
&amp;gt; (yhat-r(min))/(r(max)-r(min)) 
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; qui gen double yhat2=yhat^2 qui ivreg2 lw s expr 
&amp;gt; tenure rns smsa 
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; yhat2 (iq=med kww) test yhat2 qui ivreg2 lw s expr tenure rns
&amp;gt; &amp;gt; &amp;gt; smsa (iq=med
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; kww) ivreset
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; Now, as to why
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt;  replace yhat = (yhat-r(min))/(r(max)-r(min)) I cannot
&amp;gt; &amp;gt; &amp;gt; tell you, but
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; it's in ivreset.ado
&amp;gt; &amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; It's to rescale yhat so that when it's squared, cubed, etc., it 
&amp;gt; &amp;gt; &amp;gt; &amp;gt; doesn't get wildly out of scale relative to the other 
&amp;gt; regressors.
&amp;gt; &amp;gt; &amp;gt; &amp;gt; This can cause problems for the regression that includes
&amp;gt; &amp;gt; &amp;gt; these terms.
&amp;gt; &amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; Cheers,
&amp;gt; &amp;gt; &amp;gt; &amp;gt; Mark
&amp;gt; &amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; On 16 Mar 2006 19:10:13 +0000, Arne Risa Hole wrote:
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; I am using ivreset to do a Pesaran-Taylor Reset test
&amp;gt; &amp;gt; &amp;gt; after ivreg2.
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; However, I am not able to replicate the result from ivreset
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; manually. For example:
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; use http://fmwww.bc.edu/ec-p/data/hayashi/griliches76.dta
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; *
&amp;gt; &amp;gt; &amp;gt; &amp;gt; *   For searches and help try:
&amp;gt; &amp;gt; &amp;gt; &amp;gt; *   http://www.stata.com/support/faqs/res/findit.html
&amp;gt; &amp;gt; &amp;gt; &amp;gt; *   http://www.stata.com/support/statalist/faq
&amp;gt; &amp;gt; &amp;gt; &amp;gt; *   http://www.ats.ucla.edu/stat/stata/
&amp;gt; &amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; *
&amp;gt; &amp;gt; &amp;gt; *   For searches and help try:
&amp;gt; &amp;gt; &amp;gt; *   http://www.stata.com/support/faqs/res/findit.html
&amp;gt; &amp;gt; &amp;gt; *   http://www.stata.com/support/statalist/faq
&amp;gt; &amp;gt; &amp;gt; *   http://www.ats.ucla.edu/stat/stata/
&amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt;
&amp;gt; &amp;gt; *
&amp;gt; &amp;gt; *   For searches and help try:
&amp;gt; &amp;gt; *   http://www.stata.com/support/faqs/res/findit.html
&amp;gt; &amp;gt; *   http://www.stata.com/support/statalist/faq
&amp;gt; &amp;gt; *   http://www.ats.ucla.edu/stat/stata/
&amp;gt; &amp;gt;
&amp;gt; 
&amp;gt; *
&amp;gt; *   For searches and help try:
&amp;gt; *   http://www.stata.com/support/faqs/res/findit.html
&amp;gt; *   http://www.stata.com/support/statalist/faq
&amp;gt; *   http://www.ats.ucla.edu/stat/stata/
&amp;gt; 
&amp;gt; &lt;/p&gt;&lt;p class="mobile-post"&gt;*
*   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/&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15088145-114287394563828149?l=statalist.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114287394563828149'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114287394563828149'/><link rel='alternate' type='text/html' href='http://statalist.blogspot.com/2006/03/re-st-ivreset_114287394563828149.html' title='RE: st: ivreset'/><author><name>statalist member</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-15088145.post-114287307064100609</id><published>2006-03-20T11:44:00.000-05:00</published><updated>2006-03-20T11:44:54.226-05:00</updated><title type='text'>st: recovering estat output</title><content type='html'>&lt;p class="mobile-post"&gt;Abiel said&lt;/p&gt;&lt;p class="mobile-post"&gt;After running a regression, I am interested in capturing the results  
of the
estat ic command so that I can work with the Bayesian information  
criteria
field in a do file. Is there a way to read the results of this command?&lt;/p&gt;&lt;p class="mobile-post"&gt;Although regress is e-class, ic is r-class. After ic,&lt;/p&gt;&lt;p class="mobile-post"&gt;. mat list r(S)&lt;/p&gt;&lt;p class="mobile-post"&gt;r(S)[1,6]
              N         ll0          ll          df          
AIC         BIC
r1          74  -695.71287  -675.17278           6   1362.3456    
1376.1699&lt;/p&gt;&lt;p class="mobile-post"&gt;Kit Baum, Boston College Economics
http://ideas.repec.org/e/pba1.html&lt;/p&gt;&lt;p class="mobile-post"&gt;*
*   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/&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15088145-114287307064100609?l=statalist.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114287307064100609'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114287307064100609'/><link rel='alternate' type='text/html' href='http://statalist.blogspot.com/2006/03/st-recovering-estat-output_20.html' title='st: recovering estat output'/><author><name>statalist member</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-15088145.post-114287100141649983</id><published>2006-03-20T11:10:00.000-05:00</published><updated>2006-03-20T11:10:01.420-05:00</updated><title type='text'>st: -adoupdate-</title><content type='html'>&lt;p class="mobile-post"&gt;First off, this is a really nice utility. Like most users, I had multiple copies of the same stuff installed so this has 
helped clean up my ados in addition to helping me keep them updated.&lt;/p&gt;&lt;p class="mobile-post"&gt;It was pointed out that you may need to run -adoupdate, update- a number of times before it gets everything right. 
However, I have a list of stubborn ados which must be updated however, -adoupdate, update- does not appear to be 
updating them (or if it does then they change everyday)&lt;/p&gt;&lt;p class="mobile-post"&gt;------------------begin log--------------------------------------&lt;/p&gt;&lt;p class="mobile-post"&gt;Packages that need to be updated are...&lt;/p&gt;&lt;p class="mobile-post"&gt;    [80] collin       -- zdemo. Collinearity Diagnostics
    [95] sjlatex      -- sjlatex:  LaTeX files for the Stata Journal
------------------end log--------------------------------------&lt;/p&gt;&lt;p class="mobile-post"&gt;And today, -textbarplot- was added to this list (I run -adoupdate, update- a number of times but kept getting this list)&lt;/p&gt;&lt;p class="mobile-post"&gt;   [126] textbarplot  -- 'TEXTBARPLOT': module to produce horizontal text and bar plot&lt;/p&gt;&lt;p class="mobile-post"&gt;Is anyone familiar with this and does it mean I dont have the most recent copies of these ados? (I did the uninstall, 
reinstall but it didnt help)&lt;/p&gt;&lt;p class="mobile-post"&gt;Ronnie
*
*   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/&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15088145-114287100141649983?l=statalist.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114287100141649983'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114287100141649983'/><link rel='alternate' type='text/html' href='http://statalist.blogspot.com/2006/03/st-adoupdate.html' title='st: -adoupdate-'/><author><name>statalist member</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-15088145.post-114287096531532762</id><published>2006-03-20T11:09:00.000-05:00</published><updated>2006-03-20T11:09:25.416-05:00</updated><title type='text'>Re: st: FW: p-value </title><content type='html'>&lt;p class="mobile-post"&gt;On 20 Márta 2006, at 15:07, Jochen Siegele wrote:&lt;/p&gt;&lt;p class="mobile-post"&gt;&amp;gt;&amp;gt; Dear STATA-listers,
&amp;gt;&amp;gt;
&amp;gt;&amp;gt;
&amp;gt;&amp;gt; could someone of you please tell me which command I need to get  
&amp;gt;&amp;gt; the p-value(s) after doing a (multiple) linear regression in STATA 8.
&amp;gt;&amp;gt;
&amp;gt;&amp;gt; Thanks a lot in advance.&lt;/p&gt;&lt;p class="mobile-post"&gt;-regress-&lt;/p&gt;&lt;p class="mobile-post"&gt;Ronán Conroy
rconroy@rcsi.ie&lt;/p&gt;&lt;p class="mobile-post"&gt;*
*   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/&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15088145-114287096531532762?l=statalist.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114287096531532762'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114287096531532762'/><link rel='alternate' type='text/html' href='http://statalist.blogspot.com/2006/03/re-st-fw-p-value.html' title='Re: st: FW: p-value '/><author><name>statalist member</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-15088145.post-114287075657935766</id><published>2006-03-20T11:05:00.000-05:00</published><updated>2006-03-20T11:05:56.836-05:00</updated><title type='text'>Re: st: ivreset</title><content type='html'>&lt;p class="mobile-post"&gt;Hi Mark,&lt;/p&gt;&lt;p class="mobile-post"&gt;Thank you very much for the clarifications. The rescaling does have an
impact on the test statistic, however; this can be seen from using
Austin's code and comparing the results with and without the line:&lt;/p&gt;&lt;p class="mobile-post"&gt;replace yhat = (yhat-r(min))/(r(max)-r(min))&lt;/p&gt;&lt;p class="mobile-post"&gt;So even when the correct "optimal" forecast of yhat is used
(yhat=X-hat*beta-hat), rescaling the forecast affects the result. This
is not a problem in the case of -ovtest-, however, since the Reset
test statistic is invariant to the rescaling in the OLS case.&lt;/p&gt;&lt;p class="mobile-post"&gt;Sorry for going on about this, but it seems to me that since the two
statistics differ the correct statistic is the one without the
rescaling of the (yhat=X-hat*beta-hat) forecast (even though this may
introduce numerical precision problems in some cases).&lt;/p&gt;&lt;p class="mobile-post"&gt;Cheers,
Arne&lt;/p&gt;&lt;p class="mobile-post"&gt;On 20/03/06, Schaffer, Mark E &amp;lt;M.E.Schaffer@hw.ac.uk&amp;gt; wrote:
&amp;gt; Arne,
&amp;gt;
&amp;gt; &amp;gt; -----Original Message-----
&amp;gt; &amp;gt; From: owner-statalist@hsphsun2.harvard.edu
&amp;gt; &amp;gt; [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of
&amp;gt; &amp;gt; Arne Risa Hole
&amp;gt; &amp;gt; Sent: 18 March 2006 11:43
&amp;gt; &amp;gt; To: statalist@hsphsun2.harvard.edu
&amp;gt; &amp;gt; Subject: RE: st: ivreset
&amp;gt; &amp;gt;
&amp;gt; &amp;gt; Austin, Mark,
&amp;gt; &amp;gt;
&amp;gt; &amp;gt; Thank you both for your replies, rescaling the forecast did
&amp;gt; &amp;gt; the trick (sorry for the bad formatting of my code before, it
&amp;gt; &amp;gt; looked fine in my email programme).
&amp;gt; &amp;gt;
&amp;gt; &amp;gt; I understand the motivation behind the rescaling, but I'm
&amp;gt; &amp;gt; slightly concerned about the fact that it produces a
&amp;gt; &amp;gt; different test statistic compared to using the actual
&amp;gt; &amp;gt; forecast. Note that this is not the case when using the Reset
&amp;gt; &amp;gt; test following OLS - the test statistic is invariant to the
&amp;gt; &amp;gt; rescaling in this case.
&amp;gt; &amp;gt;
&amp;gt; &amp;gt; I would think that since the two approaches (rescaling/ no
&amp;gt; &amp;gt; rescaling) produce different results, the correct test
&amp;gt; &amp;gt; statistic is that using the actual forecast?
&amp;gt;
&amp;gt; There are two different issues here.  Rescaling is one, and it is, in
&amp;gt; some sense, a side issue.  The problem is that sometimes the yhat has
&amp;gt; large-ish values, and the higher order polynomials of yhat that are
&amp;gt; included in the artificial regression can get so big that the regression
&amp;gt; fails for numerical precision reasons.  Stata's own version of the reset
&amp;gt; test, -ovtest-, also does this rescaling.  The test statistic is, of
&amp;gt; course, invariant in theory to the units used and hence to rescaling.
&amp;gt;
&amp;gt; The other issue is the one you might have missed.  As Austin pointed
&amp;gt; out, the IV version of the RESET test cannot use standard fitted values
&amp;gt; that would be generated by -predict- after estimation using -ivreg- or
&amp;gt; -ivreg2-.  These are yhat=X*beta-hat, and the problem is that X includes
&amp;gt; some endogenous regressors.
&amp;gt;
&amp;gt; As the help file for -ivreset- explains, there are two alternatives.
&amp;gt; One is to use reduced form predictions for yhat, i.e., regress y on all
&amp;gt; the exogenous variables (including the excluded instruments) and then
&amp;gt; use -predict-.  The other is to get what Pesaran and Taylor call the
&amp;gt; "optimal forecast" of yhat.  This is not yhat=X*beta-hat, but
&amp;gt; yhat=X-hat*beta-hat, where X-hat includes the reduced form predicted
&amp;gt; values of the endogenous regressors (rather than the actual values).
&amp;gt; The code that Austin kindly posted to Statalast implemented the latter.
&amp;gt;
&amp;gt; Cheers,
&amp;gt; Mark
&amp;gt;
&amp;gt; &amp;gt; Cheers
&amp;gt; &amp;gt; Arne
&amp;gt; &amp;gt;
&amp;gt; &amp;gt; On Mar 17 2006, Schaffer, Mark E wrote:
&amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; Austin, Arne,
&amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; -----Original Message-----
&amp;gt; &amp;gt; &amp;gt; &amp;gt; From: Austin Nichols [mailto:austinnichols@gmail.com]
&amp;gt; &amp;gt; &amp;gt; &amp;gt; Sent: 16 March 2006 23:30
&amp;gt; &amp;gt; &amp;gt; &amp;gt; To: statalist@hsphsun2.harvard.edu
&amp;gt; &amp;gt; &amp;gt; &amp;gt; Subject: Re: st: ivreset
&amp;gt; &amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; -findit ivreset- then -help ivreset- when installed has a
&amp;gt; &amp;gt; excellent
&amp;gt; &amp;gt; &amp;gt; &amp;gt; exposition that begins:
&amp;gt; &amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; As Pagan and Hall (1983) and Pesaran and Taylor (1999)
&amp;gt; &amp;gt; point out, a
&amp;gt; &amp;gt; &amp;gt; &amp;gt; RESET test for an IV regression cannot use the standard
&amp;gt; &amp;gt; IV predicted
&amp;gt; &amp;gt; &amp;gt; &amp;gt; values X*beta-hat, because X includes endogenous
&amp;gt; &amp;gt; regressors that are
&amp;gt; &amp;gt; &amp;gt; &amp;gt; correlated with u.
&amp;gt; &amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; Try this code instead:
&amp;gt; &amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; use http://fmwww.bc.edu/ec-p/data/hayashi/griliches76.dta
&amp;gt; &amp;gt; &amp;gt; &amp;gt; qui ivreg2 lw s expr tenure rns smsa (iq=med kww) predict
&amp;gt; &amp;gt; ytilde mat
&amp;gt; &amp;gt; &amp;gt; &amp;gt; b=e(b) mat li b qui regress iq s expr tenure rns smsa med kww qui
&amp;gt; &amp;gt; &amp;gt; &amp;gt; predict double xh gen yhat=ytil-b[1,1]*iq+b[1,1]*xh sum yhat,
&amp;gt; &amp;gt; &amp;gt; &amp;gt; meanonly qui replace yhat = (yhat-r(min))/(r(max)-r(min)) qui gen
&amp;gt; &amp;gt; &amp;gt; &amp;gt; double yhat2=yhat^2 qui ivreg2 lw s expr tenure rns smsa yhat2
&amp;gt; &amp;gt; &amp;gt; &amp;gt; (iq=med kww) test yhat2 qui ivreg2 lw s expr tenure rns
&amp;gt; &amp;gt; smsa (iq=med
&amp;gt; &amp;gt; &amp;gt; &amp;gt; kww) ivreset
&amp;gt; &amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; Now, as to why
&amp;gt; &amp;gt; &amp;gt; &amp;gt;  replace yhat = (yhat-r(min))/(r(max)-r(min)) I cannot
&amp;gt; &amp;gt; tell you, but
&amp;gt; &amp;gt; &amp;gt; &amp;gt; it's in ivreset.ado
&amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; It's to rescale yhat so that when it's squared, cubed, etc., it
&amp;gt; &amp;gt; &amp;gt; doesn't get wildly out of scale relative to the other regressors.
&amp;gt; &amp;gt; &amp;gt; This can cause problems for the regression that includes
&amp;gt; &amp;gt; these terms.
&amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; Cheers,
&amp;gt; &amp;gt; &amp;gt; Mark
&amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; On 16 Mar 2006 19:10:13 +0000, Arne Risa Hole wrote:
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; I am using ivreset to do a Pesaran-Taylor Reset test
&amp;gt; &amp;gt; after ivreg2.
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; However, I am not able to replicate the result from ivreset
&amp;gt; &amp;gt; &amp;gt; &amp;gt; manually. For example:
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; use http://fmwww.bc.edu/ec-p/data/hayashi/griliches76.dta
&amp;gt; &amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; *
&amp;gt; &amp;gt; &amp;gt; *   For searches and help try:
&amp;gt; &amp;gt; &amp;gt; *   http://www.stata.com/support/faqs/res/findit.html
&amp;gt; &amp;gt; &amp;gt; *   http://www.stata.com/support/statalist/faq
&amp;gt; &amp;gt; &amp;gt; *   http://www.ats.ucla.edu/stat/stata/
&amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt;
&amp;gt; &amp;gt; *
&amp;gt; &amp;gt; *   For searches and help try:
&amp;gt; &amp;gt; *   http://www.stata.com/support/faqs/res/findit.html
&amp;gt; &amp;gt; *   http://www.stata.com/support/statalist/faq
&amp;gt; &amp;gt; *   http://www.ats.ucla.edu/stat/stata/
&amp;gt; &amp;gt;
&amp;gt; &amp;gt;
&amp;gt;
&amp;gt; *
&amp;gt; *   For searches and help try:
&amp;gt; *   http://www.stata.com/support/faqs/res/findit.html
&amp;gt; *   http://www.stata.com/support/statalist/faq
&amp;gt; *   http://www.ats.ucla.edu/stat/stata/
&amp;gt;&lt;/p&gt;&lt;p class="mobile-post"&gt;*
*   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/&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15088145-114287075657935766?l=statalist.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114287075657935766'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114287075657935766'/><link rel='alternate' type='text/html' href='http://statalist.blogspot.com/2006/03/re-st-ivreset_114287075657935766.html' title='Re: st: ivreset'/><author><name>statalist member</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-15088145.post-114287067675467781</id><published>2006-03-20T11:04:00.000-05:00</published><updated>2006-03-20T11:04:37.160-05:00</updated><title type='text'>st: Recovering estat output</title><content type='html'>&lt;p class="mobile-post"&gt;After running a regression, I am interested in capturing the results of the
estat ic command so that I can work with the Bayesian information criteria
field in a do file. Is there a way to read the results of this command?&lt;/p&gt;&lt;p class="mobile-post"&gt;Thanks,&lt;/p&gt;&lt;p class="mobile-post"&gt;Abiel&lt;/p&gt;&lt;p class="mobile-post"&gt;*
*   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/&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15088145-114287067675467781?l=statalist.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114287067675467781'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114287067675467781'/><link rel='alternate' type='text/html' href='http://statalist.blogspot.com/2006/03/st-recovering-estat-output.html' title='st: Recovering estat output'/><author><name>statalist member</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-15088145.post-114287013838645684</id><published>2006-03-20T10:55:00.000-05:00</published><updated>2006-03-20T10:55:38.500-05:00</updated><title type='text'>st: RE: FW: p-value</title><content type='html'>&lt;p class="mobile-post"&gt;No command. p-values are indicated by -regress- 
itself as Prob &amp;gt; F and and P &amp;gt; |t|. Or at least
this is true of Stata. &lt;/p&gt;&lt;p class="mobile-post"&gt;Nick 
n.j.cox@durham.ac.uk &lt;/p&gt;&lt;p class="mobile-post"&gt;Jochen Siegele
 
&amp;gt; could someone of you please tell me which command I need to 
&amp;gt; get the p-value(s) after doing a (multiple) linear regression 
&amp;gt; in STATA 8.&lt;/p&gt;&lt;p class="mobile-post"&gt;*
*   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/&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15088145-114287013838645684?l=statalist.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114287013838645684'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114287013838645684'/><link rel='alternate' type='text/html' href='http://statalist.blogspot.com/2006/03/st-re-fw-p-value.html' title='st: RE: FW: p-value'/><author><name>statalist member</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-15088145.post-114286988924207098</id><published>2006-03-20T10:51:00.000-05:00</published><updated>2006-03-20T10:51:30.506-05:00</updated><title type='text'>RE: st: looping</title><content type='html'>&lt;p class="mobile-post"&gt;Correct.&lt;/p&gt;&lt;p class="mobile-post"&gt;I guess &lt;/p&gt;&lt;p class="mobile-post"&gt;bysort state county age race : egen totalmales = total(males * perwt) 
by state county age race : egen totalfemales = total(females * perwt) 
gen ratio = totalmales / totalfemales &lt;/p&gt;&lt;p class="mobile-post"&gt;Nick 
n.j.cox@durham.ac.uk &lt;/p&gt;&lt;p class="mobile-post"&gt;Scott Cunningham
 
&amp;gt; On Mar 20, 2006, at 9:42 AM, n j cox wrote:
&amp;gt; 
&amp;gt; &amp;gt; You should read some basic accounts of -by:-.
&amp;gt; &amp;gt;
&amp;gt; &amp;gt; Also, please note the advice in the Statalist FAQ:
&amp;gt; &amp;gt;
&amp;gt; &amp;gt; "Statalist is an international list. Please explain details that  
&amp;gt; &amp;gt; may make sense only in your own corner of the world."
&amp;gt; &amp;gt;
&amp;gt; &amp;gt; Some of the details here presuppose knowledge of your local
&amp;gt; &amp;gt; situation, which I guess to be the United States. It is 
&amp;gt; likely that  
&amp;gt; &amp;gt; many members of Statalist do not know what "msa" means, for example.
&amp;gt; &amp;gt;
&amp;gt; &amp;gt; I am still in the dark on what an observation in your dataset
&amp;gt; &amp;gt; looks like, or what it represents. I assume that -males- and - 
&amp;gt; &amp;gt; females- are numeric variables, but are they dummies or do they  
&amp;gt; &amp;gt; include
&amp;gt; &amp;gt; counts? In either case, what is -perwt- precisely?
&amp;gt; 
&amp;gt; Sorry about the ambiguity.  I did forget my audience.  I am working  
&amp;gt; with a special sample from the 2000 United States Census called the  
&amp;gt; longform.  It is a sample of households - I think 
&amp;gt; approximately 5% of  
&amp;gt; the US population received the survey.  An observation is a  
&amp;gt; household, but since only 5% of all households were sampled, 
&amp;gt; you must  
&amp;gt; use the person weights (-perwt-) when working with this data.  So,  
&amp;gt; for instance, if a certain household is sampled and they represent 5  
&amp;gt; households, then the perwt=5.  Males and females are numeric values.
&amp;gt; 
&amp;gt; &amp;gt;
&amp;gt; &amp;gt; Either way, I guess that -egen, total()- with heavy use of -by()-
&amp;gt; &amp;gt; or -by:- is the easiest way to get totals of males and females,
&amp;gt; &amp;gt; after which you get ratios directly. It should take about 3 lines
&amp;gt; &amp;gt; of Stata. The only looping would be that tacit in -egen-.
&amp;gt; 
&amp;gt; I've been using egen to sum males and females, but was unsure of how  
&amp;gt; to implement the looping over all US county variables.  This 
&amp;gt; is where  
&amp;gt; -by county- wouuld come in, correct?&lt;/p&gt;&lt;p class="mobile-post"&gt;*
*   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/&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15088145-114286988924207098?l=statalist.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114286988924207098'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114286988924207098'/><link rel='alternate' type='text/html' href='http://statalist.blogspot.com/2006/03/re-st-looping_114286988924207098.html' title='RE: st: looping'/><author><name>statalist member</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-15088145.post-114286808100042165</id><published>2006-03-20T10:21:00.000-05:00</published><updated>2006-03-20T10:21:21.110-05:00</updated><title type='text'>RE: st: ivreset</title><content type='html'>&lt;p class="mobile-post"&gt;Arne, &lt;/p&gt;&lt;p class="mobile-post"&gt;&amp;gt; -----Original Message-----
&amp;gt; From: owner-statalist@hsphsun2.harvard.edu 
&amp;gt; [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of 
&amp;gt; Arne Risa Hole
&amp;gt; Sent: 18 March 2006 11:43
&amp;gt; To: statalist@hsphsun2.harvard.edu
&amp;gt; Subject: RE: st: ivreset
&amp;gt; 
&amp;gt; Austin, Mark,
&amp;gt; 
&amp;gt; Thank you both for your replies, rescaling the forecast did 
&amp;gt; the trick (sorry for the bad formatting of my code before, it 
&amp;gt; looked fine in my email programme).
&amp;gt; 
&amp;gt; I understand the motivation behind the rescaling, but I'm 
&amp;gt; slightly concerned about the fact that it produces a 
&amp;gt; different test statistic compared to using the actual 
&amp;gt; forecast. Note that this is not the case when using the Reset 
&amp;gt; test following OLS - the test statistic is invariant to the 
&amp;gt; rescaling in this case.
&amp;gt; 
&amp;gt; I would think that since the two approaches (rescaling/ no 
&amp;gt; rescaling) produce different results, the correct test 
&amp;gt; statistic is that using the actual forecast?&lt;/p&gt;&lt;p class="mobile-post"&gt;There are two different issues here.  Rescaling is one, and it is, in
some sense, a side issue.  The problem is that sometimes the yhat has
large-ish values, and the higher order polynomials of yhat that are
included in the artificial regression can get so big that the regression
fails for numerical precision reasons.  Stata's own version of the reset
test, -ovtest-, also does this rescaling.  The test statistic is, of
course, invariant in theory to the units used and hence to rescaling.&lt;/p&gt;&lt;p class="mobile-post"&gt;The other issue is the one you might have missed.  As Austin pointed
out, the IV version of the RESET test cannot use standard fitted values
that would be generated by -predict- after estimation using -ivreg- or
-ivreg2-.  These are yhat=X*beta-hat, and the problem is that X includes
some endogenous regressors.&lt;/p&gt;&lt;p class="mobile-post"&gt;As the help file for -ivreset- explains, there are two alternatives.
One is to use reduced form predictions for yhat, i.e., regress y on all
the exogenous variables (including the excluded instruments) and then
use -predict-.  The other is to get what Pesaran and Taylor call the
"optimal forecast" of yhat.  This is not yhat=X*beta-hat, but
yhat=X-hat*beta-hat, where X-hat includes the reduced form predicted
values of the endogenous regressors (rather than the actual values).
The code that Austin kindly posted to Statalast implemented the latter.&lt;/p&gt;&lt;p class="mobile-post"&gt;Cheers,
Mark&lt;/p&gt;&lt;p class="mobile-post"&gt;&amp;gt; Cheers
&amp;gt; Arne
&amp;gt; 
&amp;gt; On Mar 17 2006, Schaffer, Mark E wrote:
&amp;gt; 
&amp;gt; &amp;gt; Austin, Arne,
&amp;gt; &amp;gt; 
&amp;gt; &amp;gt; &amp;gt; -----Original Message-----
&amp;gt; &amp;gt; &amp;gt; From: Austin Nichols [mailto:austinnichols@gmail.com]
&amp;gt; &amp;gt; &amp;gt; Sent: 16 March 2006 23:30
&amp;gt; &amp;gt; &amp;gt; To: statalist@hsphsun2.harvard.edu
&amp;gt; &amp;gt; &amp;gt; Subject: Re: st: ivreset
&amp;gt; &amp;gt; &amp;gt; 
&amp;gt; &amp;gt; &amp;gt; -findit ivreset- then -help ivreset- when installed has a 
&amp;gt; excellent 
&amp;gt; &amp;gt; &amp;gt; exposition that begins:
&amp;gt; &amp;gt; &amp;gt; 
&amp;gt; &amp;gt; &amp;gt; As Pagan and Hall (1983) and Pesaran and Taylor (1999) 
&amp;gt; point out, a 
&amp;gt; &amp;gt; &amp;gt; RESET test for an IV regression cannot use the standard 
&amp;gt; IV predicted 
&amp;gt; &amp;gt; &amp;gt; values X*beta-hat, because X includes endogenous 
&amp;gt; regressors that are 
&amp;gt; &amp;gt; &amp;gt; correlated with u.
&amp;gt; &amp;gt; &amp;gt; 
&amp;gt; &amp;gt; &amp;gt; Try this code instead:
&amp;gt; &amp;gt; &amp;gt; 
&amp;gt; &amp;gt; &amp;gt; use http://fmwww.bc.edu/ec-p/data/hayashi/griliches76.dta
&amp;gt; &amp;gt; &amp;gt; qui ivreg2 lw s expr tenure rns smsa (iq=med kww) predict 
&amp;gt; ytilde mat 
&amp;gt; &amp;gt; &amp;gt; b=e(b) mat li b qui regress iq s expr tenure rns smsa med kww qui 
&amp;gt; &amp;gt; &amp;gt; predict double xh gen yhat=ytil-b[1,1]*iq+b[1,1]*xh sum yhat, 
&amp;gt; &amp;gt; &amp;gt; meanonly qui replace yhat = (yhat-r(min))/(r(max)-r(min)) qui gen 
&amp;gt; &amp;gt; &amp;gt; double yhat2=yhat^2 qui ivreg2 lw s expr tenure rns smsa yhat2 
&amp;gt; &amp;gt; &amp;gt; (iq=med kww) test yhat2 qui ivreg2 lw s expr tenure rns 
&amp;gt; smsa (iq=med 
&amp;gt; &amp;gt; &amp;gt; kww) ivreset
&amp;gt; &amp;gt; &amp;gt; 
&amp;gt; &amp;gt; &amp;gt; Now, as to why
&amp;gt; &amp;gt; &amp;gt;  replace yhat = (yhat-r(min))/(r(max)-r(min)) I cannot 
&amp;gt; tell you, but 
&amp;gt; &amp;gt; &amp;gt; it's in ivreset.ado
&amp;gt; &amp;gt; 
&amp;gt; &amp;gt; It's to rescale yhat so that when it's squared, cubed, etc., it 
&amp;gt; &amp;gt; doesn't get wildly out of scale relative to the other regressors.  
&amp;gt; &amp;gt; This can cause problems for the regression that includes 
&amp;gt; these terms.
&amp;gt; &amp;gt; 
&amp;gt; &amp;gt; Cheers,
&amp;gt; &amp;gt; Mark
&amp;gt; &amp;gt; 
&amp;gt; &amp;gt; 
&amp;gt; &amp;gt; &amp;gt; On 16 Mar 2006 19:10:13 +0000, Arne Risa Hole wrote:
&amp;gt; &amp;gt; &amp;gt; &amp;gt; I am using ivreset to do a Pesaran-Taylor Reset test 
&amp;gt; after ivreg2. 
&amp;gt; &amp;gt; &amp;gt; &amp;gt; However, I am not able to replicate the result from ivreset
&amp;gt; &amp;gt; &amp;gt; manually. For example:
&amp;gt; &amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; use http://fmwww.bc.edu/ec-p/data/hayashi/griliches76.dta
&amp;gt; &amp;gt; &amp;gt; 
&amp;gt; &amp;gt; &amp;gt; 
&amp;gt; &amp;gt; 
&amp;gt; &amp;gt; *
&amp;gt; &amp;gt; *   For searches and help try:
&amp;gt; &amp;gt; *   http://www.stata.com/support/faqs/res/findit.html
&amp;gt; &amp;gt; *   http://www.stata.com/support/statalist/faq
&amp;gt; &amp;gt; *   http://www.ats.ucla.edu/stat/stata/
&amp;gt; &amp;gt; 
&amp;gt; 
&amp;gt; *
&amp;gt; *   For searches and help try:
&amp;gt; *   http://www.stata.com/support/faqs/res/findit.html
&amp;gt; *   http://www.stata.com/support/statalist/faq
&amp;gt; *   http://www.ats.ucla.edu/stat/stata/
&amp;gt; 
&amp;gt; &lt;/p&gt;&lt;p class="mobile-post"&gt;*
*   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/&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15088145-114286808100042165?l=statalist.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114286808100042165'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114286808100042165'/><link rel='alternate' type='text/html' href='http://statalist.blogspot.com/2006/03/re-st-ivreset_20.html' title='RE: st: ivreset'/><author><name>statalist member</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-15088145.post-114286776581910149</id><published>2006-03-20T10:16:00.000-05:00</published><updated>2006-03-20T10:16:06.026-05:00</updated><title type='text'>Re: st: looping</title><content type='html'>&lt;p class="mobile-post"&gt;On Mar 20, 2006, at 9:42 AM, n j cox wrote:&lt;/p&gt;&lt;p class="mobile-post"&gt;&amp;gt; You should read some basic accounts of -by:-.
&amp;gt;
&amp;gt; Also, please note the advice in the Statalist FAQ:
&amp;gt;
&amp;gt; "Statalist is an international list. Please explain details that  
&amp;gt; may make sense only in your own corner of the world."
&amp;gt;
&amp;gt; Some of the details here presuppose knowledge of your local
&amp;gt; situation, which I guess to be the United States. It is likely that  
&amp;gt; many members of Statalist do not know what "msa" means, for example.
&amp;gt;
&amp;gt; I am still in the dark on what an observation in your dataset
&amp;gt; looks like, or what it represents. I assume that -males- and - 
&amp;gt; females- are numeric variables, but are they dummies or do they  
&amp;gt; include
&amp;gt; counts? In either case, what is -perwt- precisely?&lt;/p&gt;&lt;p class="mobile-post"&gt;Sorry about the ambiguity.  I did forget my audience.  I am working  
with a special sample from the 2000 United States Census called the  
longform.  It is a sample of households - I think approximately 5% of  
the US population received the survey.  An observation is a  
household, but since only 5% of all households were sampled, you must  
use the person weights (-perwt-) when working with this data.  So,  
for instance, if a certain household is sampled and they represent 5  
households, then the perwt=5.  Males and females are numeric values.&lt;/p&gt;&lt;p class="mobile-post"&gt;&amp;gt;
&amp;gt; Either way, I guess that -egen, total()- with heavy use of -by()-
&amp;gt; or -by:- is the easiest way to get totals of males and females,
&amp;gt; after which you get ratios directly. It should take about 3 lines
&amp;gt; of Stata. The only looping would be that tacit in -egen-.&lt;/p&gt;&lt;p class="mobile-post"&gt;I've been using egen to sum males and females, but was unsure of how  
to implement the looping over all US county variables.  This is where  
-by county- wouuld come in, correct?&lt;/p&gt;&lt;p class="mobile-post"&gt;*
*   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/&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15088145-114286776581910149?l=statalist.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114286776581910149'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114286776581910149'/><link rel='alternate' type='text/html' href='http://statalist.blogspot.com/2006/03/re-st-looping_20.html' title='Re: st: looping'/><author><name>statalist member</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-15088145.post-114286739272666844</id><published>2006-03-20T10:09:00.000-05:00</published><updated>2006-03-20T10:09:52.993-05:00</updated><title type='text'>st: FW: p-value </title><content type='html'>&lt;p class="mobile-post"&gt;&amp;gt; -----Ursprüngliche Nachricht-----
&amp;gt; Von: "Jochen Siegele" &amp;lt;jochen.siegele@web.de&amp;gt;
&amp;gt; Gesendet: 20.03.06 14:14:22
&amp;gt; An: statalist@hsphsun2.harvard.edu
&amp;gt; Betreff: p-value &lt;/p&gt;&lt;p class="mobile-post"&gt;&amp;gt; Dear STATA-listers,
&amp;gt; 
&amp;gt; 
&amp;gt; could someone of you please tell me which command I need to get the p-value(s) after doing a (multiple) linear regression in STATA 8.
&amp;gt; 
&amp;gt; Thanks a lot in advance.
&amp;gt; 
&amp;gt; 
&amp;gt; Jochen&lt;/p&gt;&lt;p class="mobile-post"&gt;*
*   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/&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15088145-114286739272666844?l=statalist.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114286739272666844'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114286739272666844'/><link rel='alternate' type='text/html' href='http://statalist.blogspot.com/2006/03/st-fw-p-value.html' title='st: FW: p-value '/><author><name>statalist member</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-15088145.post-114286666596830781</id><published>2006-03-20T09:57:00.000-05:00</published><updated>2006-03-20T09:57:46.460-05:00</updated><title type='text'>st: RE: Wooldridge 3rd edition: worth buying?</title><content type='html'>&lt;p class="mobile-post"&gt;The content between the 2e and 3e is almost identical.&lt;/p&gt;&lt;p class="mobile-post"&gt;(I own the 2e and tutored someone who has the 3e).&lt;/p&gt;&lt;p class="mobile-post"&gt;-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Friedrich Huebler
Sent: Monday, March 20, 2006 12:32 AM
To: statalist@hsphsun2.harvard.edu
Subject: st: Wooldridge 3rd edition: worth buying?&lt;/p&gt;&lt;p class="mobile-post"&gt;If someone has the second edition of "Introductory Econometrics" by
Jeffrey Wooldridge, are there reasons to buy the third edition of
this book? I read the book description on the publisher's website and
don't see much new in the latest edition. Please share your opinion
if you are familiar with both editions.&lt;/p&gt;&lt;p class="mobile-post"&gt;Thank you,&lt;/p&gt;&lt;p class="mobile-post"&gt;Friedrich Huebler&lt;/p&gt;&lt;p class="mobile-post"&gt;__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
*
*   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/&lt;/p&gt;&lt;p class="mobile-post"&gt;*
*   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/&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15088145-114286666596830781?l=statalist.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114286666596830781'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114286666596830781'/><link rel='alternate' type='text/html' href='http://statalist.blogspot.com/2006/03/st-re-wooldridge-3rd-edition-worth.html' title='st: RE: Wooldridge 3rd edition: worth buying?'/><author><name>statalist member</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-15088145.post-114286583974409357</id><published>2006-03-20T09:43:00.000-05:00</published><updated>2006-03-20T09:44:14.083-05:00</updated><title type='text'>Re: st: looping</title><content type='html'>&lt;p class="mobile-post"&gt;You should read some basic accounts of -by:-.&lt;/p&gt;&lt;p class="mobile-post"&gt;Also, please note the advice in the Statalist FAQ:&lt;/p&gt;&lt;p class="mobile-post"&gt;"Statalist is an international list. Please explain details that may 
make sense only in your own corner of the world."&lt;/p&gt;&lt;p class="mobile-post"&gt;Some of the details here presuppose knowledge of your local
situation, which I guess to be the United States. It is likely that many 
members of Statalist do not know what "msa" means, for example.&lt;/p&gt;&lt;p class="mobile-post"&gt;I am still in the dark on what an observation in your dataset
looks like, or what it represents. I assume that -males- and -females- 
are numeric variables, but are they dummies or do they include
counts? In either case, what is -perwt- precisely?&lt;/p&gt;&lt;p class="mobile-post"&gt;Either way, I guess that -egen, total()- with heavy use of -by()-
or -by:- is the easiest way to get totals of males and females,
after which you get ratios directly. It should take about 3 lines
of Stata. The only looping would be that tacit in -egen-.&lt;/p&gt;&lt;p class="mobile-post"&gt;Nick
n.j.cox@durham.ac.uk&lt;/p&gt;&lt;p class="mobile-post"&gt; &amp;gt;&amp;gt;&amp;gt; Scott Cunningham&lt;/p&gt;&lt;p class="mobile-post"&gt;I have the following dataset:&lt;/p&gt;&lt;p class="mobile-post"&gt;perwt year state msa county males females age race&lt;/p&gt;&lt;p class="mobile-post"&gt;My goal is to create sex ratios (ie ratios of males to females) for
each county.  I have not attempted this before because the way that I
calculated sex ratios for states and cities (ie, msa) was to write
a .do file that summed up the person weights (ie, perwt) for each
state/msa.  This was not so bad for states, but moreso for cities,
since there are 350 cities.  The number of counties are in the
thousands, and since I have to create sex ratios that differ by race,
age and year, it would require writing out a very long .do file.  So
my question is:  is there a looping procedure I could use, which
would use the county-level variable as the variable that does the
operation?  For instance, if there were two counties (1 and 2), then
the loop would sum all males of the given age-race criteria, all
females of the same age-race criteria, take the ratio and record that
for county 1, then repeat for county 2, etc.&lt;/p&gt;&lt;p class="mobile-post"&gt;*
*   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/&lt;/p&gt;&lt;p class="mobile-post"&gt;--------------------------------------------------------------------------------&lt;/p&gt;&lt;p class="mobile-post"&gt;Previous Article (by Date): st: single failure with mulltiple risk 
periods Dawn Teele
Articles sorted by: [Date] [Author] [Subject]&lt;/p&gt;&lt;p class="mobile-post"&gt;--------------------------------------------------------------------------------&lt;/p&gt;&lt;p class="mobile-post"&gt;  Go to Harvard School of Public Health LWGate Home Page.
*
*   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/&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15088145-114286583974409357?l=statalist.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114286583974409357'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114286583974409357'/><link rel='alternate' type='text/html' href='http://statalist.blogspot.com/2006/03/re-st-looping.html' title='Re: st: looping'/><author><name>statalist member</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-15088145.post-114286384833802767</id><published>2006-03-20T09:10:00.000-05:00</published><updated>2006-03-20T09:10:50.086-05:00</updated><title type='text'>st: looping</title><content type='html'>&lt;p class="mobile-post"&gt;I have the following dataset:&lt;/p&gt;&lt;p class="mobile-post"&gt;perwt year state msa county males females age race&lt;/p&gt;&lt;p class="mobile-post"&gt;My goal is to create sex ratios (ie ratios of males to females) for  
each county.  I have not attempted this before because the way that I  
calculated sex ratios for states and cities (ie, msa) was to write  
a .do file that summed up the person weights (ie, perwt) for each  
state/msa.  This was not so bad for states, but moreso for cities,  
since there are 350 cities.  The number of counties are in the  
thousands, and since I have to create sex ratios that differ by race,  
age and year, it would require writing out a very long .do file.  So  
my question is:  is there a looping procedure I could use, which  
would use the county-level variable as the variable that does the  
operation?  For instance, if there were two counties (1 and 2), then  
the loop would sum all males of the given age-race criteria, all  
females of the same age-race criteria, take the ratio and record that  
for county 1, then repeat for county 2, etc.&lt;/p&gt;&lt;p class="mobile-post"&gt;*
*   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/&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15088145-114286384833802767?l=statalist.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114286384833802767'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114286384833802767'/><link rel='alternate' type='text/html' href='http://statalist.blogspot.com/2006/03/st-looping.html' title='st: looping'/><author><name>statalist member</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-15088145.post-114285412397103607</id><published>2006-03-20T06:28:00.000-05:00</published><updated>2006-03-20T06:28:43.973-05:00</updated><title type='text'>st: single failure with mulltiple risk periods</title><content type='html'>&lt;p class="mobile-post"&gt;Hello,&lt;/p&gt;&lt;p class="mobile-post"&gt;I have a question about using the st commands for panel data where a
failure can only happen once, but where subjects go in and out of risk.&lt;/p&gt;&lt;p class="mobile-post"&gt;To be specific, the event in question is the ratification of a specific
ILO convention. right now I have used the command:&lt;/p&gt;&lt;p class="mobile-post"&gt;stset date1, id(panelid) failure(cnv100) origin(joinILO==1)&lt;/p&gt;&lt;p class="mobile-post"&gt;to tell stata that each country is at risk of ratification only after
they have become members of the ILO.&lt;/p&gt;&lt;p class="mobile-post"&gt;But some of the countries in the sample, for instance the United States,
were members at the beginning of the risk period (1976), but then
dropped out between 1980 and 1993.&lt;/p&gt;&lt;p class="mobile-post"&gt;Failure, then, must be conditional on the country actually being a
member in each timer period. Do you have any suggestions for how to deal
with this?&lt;/p&gt;&lt;p class="mobile-post"&gt;Thanks!&lt;/p&gt;&lt;p class="mobile-post"&gt;Dawn Teele
Reed College '06
*
*   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/&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15088145-114285412397103607?l=statalist.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114285412397103607'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15088145/posts/default/114285412397103607'/><link rel='alternate' type='text/html' href='http://statalist.blogspot.com/2006/03/st-single-failure-with-mulltiple-risk.html' title='st: single failure with mulltiple risk periods'/><author><name>statalist member</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry></feed>
