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 on April 23, and its replacement, is already up and running.

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

Re: st: Benchmarks for Stata

From   Austin Nichols <>
Subject   Re: st: Benchmarks for Stata
Date   Fri, 10 Dec 2010 12:20:05 -0500

Dimitriy V. Masterov <>:
I don't know why you are getting that error message, but you seem to
have misunderstood the point of the example code--it writes out a do
file and then starts Stata in batch mode, which you do not want to do
in your do file!  It was intended only as an example that can be run
interactively. Your do file should read

sysuse nlsw88, clear
set rmsg on
set seed 1
bs, r(50000): logit married grade south wage

without all that other stuff, and then you should run that in batch
mode as appropriate on your system. With Window's, click on the Start
menu, click Run.. and then type:

"C:\Program Files (x86)\Stata11\StataMP" -b do /batch

(if the above is saved as \

But try first:

sysuse nlsw88, clear
set rmsg on
set seed 1
bs, r(5): logit married grade south wage

to make sure it runs, and you can open the log file, and you
understand the idea.

On Fri, Dec 10, 2010 at 12:08 PM, Dimitriy V. Masterov
<> wrote:
> I had to tweak Austin's code since I do not have permission to write
> to sysdir (code and output below), but I am now getting an error:
> c(showbaselevels) undefined. This error only happens in batch mode. I
> can estimate the logit by hand without any problems.
> I forced Stata to update the executable and the utilities as was
> suggested on a previous thread, and I made sure to conduct the swap.
> Stata looks up to date:
> . update query
> (contacting
> Stata executable
>    folder:               C:\Program Files (x86)\Stata11\
>    name of file:         StataMP-64.exe
>    currently installed:  04 Nov 2010
>    latest available:     04 Nov 2010
> Ado-file updates
>    folder:               C:\Program Files (x86)\Stata11\ado\updates\
>    names of files:       (various)
>    currently installed:  10 Nov 2010
>    latest available:     10 Nov 2010
> Utilities updates
>    folder:               C:\Program Files (x86)\Stata11\utilities
>    names of files:       (various)
>    currently installed:  01 Sep 2010
>    latest available:     01 Sep 2010
> Recommendation
>    Do nothing; all files up to date.
> Here's my version of Austin's code:
> #delimit;
> set more off;
> clear all;
> cd "C:\Users\masterd\Documents"; // don't have permissions, so changed dirs.
> tempname t;
> file open `t' using, write replace; // added replace
> file write `t' "sysuse nlsw88, clear" _n;
> file write `t' "set rmsg on" _n;
> file write `t' "set seed 1" _n;
> file write `t' "bs, r(50000): logit married grade south wage" _n;
> file write `t' "exit" _n;
> file close `t';
> ! "C:\Program Files (x86)\Stata11\StataMP" -b do batch; // changed
> Stata MP to path
> erase;
> type batch.log;
> erase batch.log;

*   For searches and help try:

© Copyright 1996–2016 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index