Docsity

Log, Command Log files - Econometrics - Lecture Slides, Slides of Econometrics and Mathematical Economics

Partial preview of the text

Download Log, Command Log files - Econometrics - Lecture Slides and more Slides Econometrics and Mathematical Economics in PDF only on Docsity!

LOG & COMMAND LOG

FILES

Contents

In this lecture, we will learn

1. Introduction to LOG FILES2. Introduction to LOG FILES

LOG FILES

To open a log file click on the icon

A more detailed view is shown

Æ

You can also select it via ‘File’ menu.

LOG FILES

A dialogue box appears which asks us that where to savethis log file, write the name of the log file and also mentionthe destiny folder to save the file there.

Click

save

to

save the file.

LOG FILES

Now look at the log file which shows the details of the work youdid so far. For this click on the log file icon. A

dialogue

box

will

appear named “Stata LogOptions”

and

select

“view

snapshot

of

log

file” and click OK.

LOG FILES

When you click OK, the resulting window will appear whichshould look like the one shown below: To close the log file select“close log file” and clickOK.

10

LOG FILES

Now start working. We run one command and we want to see the results of our work inthe log file with the previous version of log file.

11

LOG FILES

If you want to pause thelog file. i.e; you wantsome commands not tobe recorded in the logfile,

select

option

“Suspend log file”.

The Result Window gives the message that you paused the log file.

13

COMMAND LOG FILE

(cmdlog)

Cmdlog only keeps the record of the work which we do instata and does not keep record of Stata’s output. So it is asubset of the Log file.You

can

make

full

logs,

command

logs,

or

both

simultaneously.

Neither is produced until you tell Stata to

start logging.Command logs are always ASCII text files, making themeasy to convert into do-files.

14

COMMAND LOG FILE

(cmdlog)

To open cmdlog, Type in command window the following command: cmdlog using “test.txt” OR you can specify the full path that where to save the file and press enter.We want to save the file in the folder located in Desktop so we enter thecomplete path as shown below:

The Results window confirms that the cmdlog file is opened.

16

COMMAND LOG FILE

(cmdlog)

Now we run some commands and see the cmd log file.We run two commands,

display abs(-4) and log(10).

Now see that the size of the file changes from 0 KB to 1KB.So this means that some data has been added to this file.

17

COMMAND LOG FILE

(cmdlog)

Now

open

this

“command

log.txt”

file.

It

shows

that

two

commands which we run. For more details on using log and cmdlog file, see Stata builtin help.

OR use the shortcut icon