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: Executing do-file yields no output


From   Nick Cox <[email protected]>
To   [email protected]
Subject   Re: st: Executing do-file yields no output
Date   Mon, 9 May 2011 12:18:13 +0100

My apologies: it's the other way round. (Possibly insufficient
caffeine on my part this morning.)

If your do-file includes a -regress- command, you should see the
results with -do-, but not with -run-.


On Mon, May 9, 2011 at 12:11 PM, George Mailbox
<[email protected]> wrote:
> Nick,
>
> Many thanks for getting back.
>
> You mentioned "do" is silent, with online sources suggesting "run"
> suppresses the output, for instance:
>
> do filename [arguments] , [nostop]
>    Executes the specified do-file.
>    nostop allows to continue execution even if an error occurs.
>    On-line, context: 1, 2
>
> run filename [arguments] , [nostop]
>    Executes the specified do-file suppressing the output, except for erors.
>    nostop allows to continue execution even if an error occurs.
>    On-line, context
>
> (Source: http://web.missouri.edu/~kolenikovs/stata/Duke/commands.html#)
>
> Further, it appears that the terms "do" and "run" are often used
> interchangeably as in "run a do file using the do command" which
> complicates matters for beginners.
>
> My question thus boils down to:
> How can I execute my do-file such that Stata displays the regression
> estimates in the command window and the log-file?
>
> Best wishes,
> George Hylden
>
>
>
>
>
>
> 2011/5/9 Nick Cox <[email protected]>:
>> This is precisely as intended. -do- rather than -run- is silent. What
>> output would you expect from these commands if they work as intended,
>> i.e. with generating error messages?
>>
>> Nick
>>
>> Please note the request to use real names on Statalist.
>> http://www.stata.com/support/faqs/res/statalist.html#tojoin
>>
>> On Mon, May 9, 2011 at 10:18 AM, George Mailbox <[email protected]>
>>
>>> When I execute a do file (i.e. do do-file as opposed to run do-file),
>>> Stata (version 10.1) loads the data and runs through all commands
>>> without detecting errors but only displays the do-file commands
>>> preceded by ">", i.e. it does not display the results in the command
>>> window and thus not in the log-file either. When I copy and paste the
>>> commands into the command window, then Stata displays the results,
>>> i.e. the code is correct.
>>> I suspected some "suppress output" function was activated but I
>>> haven't been able to find any such thing.
>>>
>>> The do-file is a self-written plain do-file, not code written in a program.
>>> The procedural commands that precede the data manipulation commands
>>> are standard by my reckoning:
>>>
>>> ##############################
>>>
>>> clear all
>>>
>>> capture log close
>>>
>>> set more off
>>>
>>> version 10.1
>>>
>>> use  filename.dta
>>>
>>> log using filename.log, text replace
>>> ##############################
>>>
>>> I would be grateful for any advice or suggestions.

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