Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


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

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


From   "Martin Weiss" <martin.weiss1@gmx.de>
To   <statalist@hsphsun2.harvard.edu>
Subject   AW: st: Why my codes run well on version 9.1 but not on version 10
Date   Fri, 26 Feb 2010 11:53:27 +0100

<> 

" I run the program in the
portable Stata version 9 and 10, and it run well."


What is a "portable Stata"? I have always dreamt of a portable version on my
smartphone (which would enable one to answer posts on the list while away
from home base) but so far, there is none. Maybe you meant to say: "a
version of Stata installed on a laptop" (which should be as functional as
any version installed on a desktop)?




HTH
Martin

-----Ursprüngliche Nachricht-----
Von: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] Im Auftrag von Quang Nguyen
Gesendet: Freitag, 26. Februar 2010 11:37
An: statalist@hsphsun2.harvard.edu
Betreff: Re: st: Why my codes run well on version 9.1 but not on version 10

Dear all:

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 <n.j.cox@durham.ac.uk> 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
> n.j.cox@durham.ac.uk
>
> 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/
>



-- 
"My father gave me the greatest gift anyone could give another person,
he believed in me." - Jim Valvano

*
*   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/


*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index