Statalist


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

Re: st: Re: Fwd: AW: Really basic question


From   "Martin Weiss" <[email protected]>
To   <[email protected]>
Subject   Re: st: Re: Fwd: AW: Really basic question
Date   Fri, 20 Feb 2009 21:55:05 +0100

<>

Ted`s responses remind me of the fact that one should always recommend that beginners -do- their do-files, not -run- them. With -do- they get some output in the results window other than cryptic tempfile paths... My apologies to Ted.


HTH
Martin
_______________________
----- Original Message ----- From: "Ted Fuller" <[email protected]>
To: "Martin Weiss" <[email protected]>
Sent: Friday, February 20, 2009 9:49 PM
Subject: Fwd: st: Re: Fwd: AW: Really basic question


Martin,
You are right: I am using version 8.
My apologies for not pointing this out!
Thanks for your further advice.
Ted


<>

Ok, several things as before. You seem to be using a version of Stata other than 10, which you should disclose beforehand. That being the case, I am unable to comment on older versions.

The do-files have been around long enough for basics to remain stable, though. So: you see the
run "C:\DOCUME~1\TEDFUL~1\LOCALS~1\Temp\STD02000000.tmp"
message, but the auto dataset is now loaded into memory, right? And it was not there before. So something did happen. Add the line "describe" to this, and Stata will describe the contents of its memory after opening the do-file.


If your version does not support the -estat- family of commands, run

*******
sysuse auto, clear
regress price weight turn rep78
test _b[turn]==2
********

and see what happens.

HTH
Martin
_______________________
----- Original Message ----- From: "Ted Fuller" <[email protected]>
To: <[email protected]>
Sent: Friday, February 20, 2009 7:39 PM
Subject: st: Fwd: AW: Really basic question


My thanks to Martin, but I am still not getting very far.
See my notes below.
Date: Fri, 20 Feb 2009 18:51:34 +0100
From: Martin Weiss <[email protected]>

<>


Well, several things really. First, type -doedit- and you get a window that lets you store a basic text file which you can subsequently -run- by going
to "Tools- Run".


I can open the window that Martin refers to.

Type, for instance, -sysuse auto, clear- in there and see
what happens when you -run- that.

All I get is:

. run "C:\DOCUME~1\TEDFUL~1\LOCALS~1\Temp\STD02000000.tmp"

I don't know what it means. I doesn't seem very interesting.


Now you argue that you do know how to operate Stata from the dialog boxes.
If that is true, then you can simply copy from Stata`s review window via
right-click and paste into the editor opened via -doedit-. Assemble a few of
your commands there, and -run- them and see what happens.

I'm obviously very dense. I found the review window, but the right click only gives me two options:
Save review contents...
Font...

When I select "Save review contents...", it tries to save it to a file on my hard-drive, as opposed to
allowing me to paste it into my editor.
Please see one more comment below.


Even easier: Choose your commands that you want in the command file (hold
down ctrl while selecting so you can select non-contiguous areas of commands
in the review window), right-click and select "Send to Do-File Editor".

What I pick up between the lines in your post is that you think a do-file
must have some "magic" component which makes it a do-file. But it is usually no more than a collection of Stata commands, interspersed with comments (add "// " to the beginning of a line). when you save it (File-Save as), the file
extension ".do" is appended, but that is it, really...

All this advice is assembled in -help contents_programming_dofiles-, BTW. If you want examples of professional do-files, try the collections of data that
come with Stata Press books, for instance
http://www.stata-press.com/data/mus/mus.zip


Finally, let me give you an example so you can get started faster. Copy it into the window opened by -doedit- and -run- and see how that works out...

*******
sysuse auto, clear
regress price weight turn rep78
test _b[turn]==2
estat hettest
*******

I tried this, and all I got was:
unrecognized command:  estat

I am forwarding this to the list. Feel free to reply to the list, making
sure that you post as "text-only" along the way...


HTH
Martin


-----Ursprüngliche Nachricht-----
Von: Ted Fuller [mailto:[email protected]]
Gesendet: Freitag, 20. Februar 2009 18:19
An: Martin Weiss
Betreff: Really basic question

Martin,
I have a really basic question.
I am used to using Stata with dialog boxes, but I think it would be
useful to use command files.
For the life of me, I can't figure out how to do that by reading the
documentation available in the "help"
EG Help - Contents - Basics - Syntax.
Actually, I think I could figure out how to write (most of) the
commands, but I can't figure out where to store them. Then, having
stored them, I'm not sure how to tell Stata to run just a few lines
that of code that I have stored.
Can you give me some pointers?
Thanks!
Ted Fuller



Theodore Fuller
Department of Sociology (0137)
Virginia Tech
Blacksburg, VA 24061
Phone: 540/231-8969

Theodore Fuller
Department of Sociology (0137)
Virginia Tech
Blacksburg, VA 24061
Phone: 540/231-8969

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

Theodore Fuller
Department of Sociology (0137)
Virginia Tech
Blacksburg, VA 24061
Phone: 540/231-8969

*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index