Bookmark and Share

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


[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" <[email protected]>
To   <[email protected]>
Subject   RE: st: Why my codes run well on version 9.1 but not on version 10
Date   Fri, 26 Feb 2010 10:51:39 -0000

Although you thank us for our comments, you don't really address any of them! 

I can't see any Stata programs here, just a do file with references to other do files. Sorry, but this is not a problem report that can be commented on as it is really is not clear what the problem is. The detail here does not add to "doesn't run properly". 

A problem report would be a comparison of the _same_ code on the _same_ data in _different_ versions of Stata showing that the _results_ differ. That and only that would support your assertion implicit here that changes in Stata have caused problems. 

I think the best way forward for you is to take this up with Stata tech support. They are going to need to see a lot more information, minimally two logs gained as above showing different outcomes. 

I echo Neil's separate bemusement on what is meant by "portable" and "fully installed" here. 

Nick 
[email protected] 

Quang Nguyen

Many thanks for your helpful comments. I run the program in the
portable Stata version 9 and 10, and it run well. However, the program
doesn't run properly in the Stata 10 which is fully installed into our
computer. I would appreciate if you could help me find out whta might
go on here:


 For your reference, I am enclosing the codes here:

# delimit;


***************************************************************;
*NAME:lancetout.do
*
*DESCRIPTION:
*         -General definition
*         -launch all the programes
*ARGUMENTS:
***************************************************************;


* -----------------------------------------------------------------;
* -----------------------------------------------------------------;
* General definition;
* ------------------;

* Useful definitions;
* ------------------;
drop _all;
set mem 50000;
set more off;
set logtype text;
set linesize 255;
set matsize 800;

*Definitions of working file Sylvie;
*----------------------------------;
*global prog "C:\Sylvie\GATE-Travail\Sylvie_GATE\Migration\Stata\prog\";
*global bases "C:\Sylvie\GATE-Travail\Sylvie_GATE\Migration\Stata\bases\";
*global data "C:\Sylvie\GATE-Travail\Sylvie_GATE\Migration\Stata\data\";
*global log "C:\Sylvie\GATE-Travail\Sylvie_GATE\Migration\Stata\log\";

*Definitions of working file Xu Hui;
*----------------------------------;
global prog "F:\Stata\2008_survey\prog\";
global bases "F:\Stata\2008_survey\bases\";
global data "F:\Stata\2008_survey\data\";
global log "F:\Stata\2008_survey\log\";

*-------------------------------------------;
*General definition (end);
*----------------------------------------------------------------;
*----------------------------------------------------------------;

*----------------------------------------------------------------;
*----------------------------------------------------------------;
*Programs;
*--------;

* Import Excel data (Stata transfer + direct copy);
*-------------------------------------------------;
use ${data}indi_1;
sort hh memb;
save ${bases}indi_1, replace;

use ${data}indi_2;
sort hh memb;
save ${bases}indi_2, replace;

use ${data}indi_3;
sort hh memb;
save ${bases}indi_3, replace;

use ${data}hh;
sort hh;
save ${bases}hh, replace;

use ${data}village;
sort town village;
save ${bases}village, replace;

* Merge all the sub-files into the database to use;
*-------------------------------------------------;
drop _all;
capture log close;
log using ${log}merge, replace;

use ${bases}indi_1;
sort hh memb;
save ${bases}indi_1,replace;

merge hh memb using ${bases}indi_2;
tab _merge;
drop _merge;
save ${bases}indi, replace;

use ${bases}indi;
sort hh memb;
save ${bases}indi,replace;

merge hh memb using ${bases}indi_3;
tab _merge;
drop _merge;
save ${bases}indi, replace;

log close;

*********************************************;
*All variable renaming has been done in Excel;
*********************************************;



*********************************;
* Programs for creating variables;
*********************************;

* Household variables;
*--------------------;
do ${prog}hh;

* Add the household variables into the individual variables data base;
*--------------------------------------------------------------------;
do ${prog}indi_hh;

* Village variables;
*------------------;
do ${prog}village;

* Add the village/town variables into the individual and household
variables data base;
*-------------------------------------------------------------------------------------;
do ${prog}indi_hh_village;

* Individual variables;
*---------------------;
do ${prog}indi;


********************************;
* Programs for data verification;
********************************;
*do ${prog}stat_verif; *done before;


*************************************;
* Programs for descriptive statistics;
*************************************;

* By town;
*--------;
*do ${prog}stat_town;

* By household;
*-------------;
*do ${prog}stat_des_hh;

* By migration status;
*--------------------;
do ${prog}stat_des_mig;


***************************;
* Programs for econometrics;
***************************;

* Multinominal logit regression;
*------------------------------;
* do ${prog}mlogit;

* Probit regressions;
*-------------------;
* do ${prog}biprobit;
  do ${prog}ivprobit;

*------------------------------;
*programs (end)
*---------------------------------------------------------------------;
*---------------------------------------------------------------------;

***********************************************************************;
*DO FILE END;
*************;


On Thu, Feb 25, 2010 at 6:18 AM, Nick Cox <[email protected]> wrote:
> 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.
>
> Nick
> [email protected]
>
> 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:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


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