Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: st: Why my codes run well on version 9.1 but not on version 10

From   "Nick Cox" <>
To   <>
Subject   RE: st: Why my codes run well on version 9.1 but not on version 10
Date   Thu, 25 Feb 2010 16:18:49 -0000

In addition to this and other sensible comments, I note that 

-recode-'s aim has long (I'd say, always) been recoding numerical
categorical variables and that this has not changed, certainly not
between 9 and 10.1. (Stata, perhaps idiosyncratically, doesn't regard
string variables as even categorical.) 

The word "drop" is ambiguous, as witness 

1. drop meaning -drop-, otherwise delete or eliminate. 

2. drop meaning omit, as in not including variables as predictors in a
model, even when asked. 

3. drop meaning ignore, as in just skipping over, as -summarize- does
with string variables. 

Without more detail I can't see that anything can be added more
positively to help Quang here. 


Phil Schumm

On Feb 25, 2010, at 6:38 AM, Quang Nguyen wrote:
> We have a small program which run well on Stata version 9.1.  
> However, when we run it on Stata/SE 10, there is a message like "  
> recode only runs with numeric variable". We check and find that  
> Stata just automatically drop some variables in the in-between  
> steps. This happens as we run the program as a whole. If we run the  
> program comand by comand it works well. Do you know wht amight cause  
> this, and what is the solution.

Your question is impossible to answer without additional information  
-- you'll need to step through your do-file bit-by-bit (e.g., use - 
exit-), comparing the results obtained under 9.1 to those obtained  
under 10 at each step to locate the exact source of the discrepancy.   
At that point, someone here can help explain the cause of the  
difference, if necessary.

Three quick comments.  First, have you used -version 9.1- at the top  
of your do-file?  Using -version- is the single best (and easiest) way  
to make sure that code written for one version of Stata will continue  
to run under new versions.  Second, are you calling any 3rd party  
commands from within your do-file?  If so, it's possible that one of  
these commands is behaving differently under Stata 10 than under Stata  
9.1 (note that use of -version- within your do-file will not affect  
this).  Finally, you mentioned that "If we run the program comand by  
comand it works well."  I assume here that you are referring to  
selecting portions of the file and choosing "Run" -- note that this  
differs from executing the do-file continuously from the beginning in  
several important ways (e.g., local macros are lost and the last - 
preserve- is automatically restored each time control is returned to  
Stata).  For this reason, this is not a good way to debug.  Instead,  
use -exit- to stop the script at various points along the way (but  
always run continuously from the beginning), as described above.

*   For searches and help try:

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