******************************************** *** Data Transfer & Access *** ******************************************** (1) Using Internet Explorer you will want to make sure to change the file type to Text (*.txt extension) when you save it. If you use the default *.htm format then this may lead to errors when trying to read the data into STATA. (2) Text data can be accessed via the "infile" command. (3) STATA uses the c:\DATA directory as default. Therefore it is convenient to create this directory and store your data files there. (4) You can access data over the web if your computer is connected. For example: infile age alc tob case count using http://courses.washington.edu/b513/homework/NewTuyns.data can be used to input the data to STATA. (5) As you may discover, if you use your web browser to "click" on a *.do file your computer will recognize this as a STATA "do" file and attempt to run the file. If you'd like to just save the do-file then you can use the right mouse button to just save the file without trying to view it. Also, on some computers the file extension *.dat is recognized for use with certain programs, and when that computer attempts to save a *.dat file it will "automatically" (not necessarily helpful) try to make conversion during transfer. This can then cause trouble with the subsequent use of the file for input to STATA. IF YOU ARE GETTING A DATA SET THAT ISN'T WHAT YOU EXPECT (ie. there are missing values that you didn't expect, or "shifted" data) then try the following: a) View the data file with your browser and then save the file MAKING SURE THAT YOU SAVE IT AS TEXT (ie. using the option at the bottom of the window to save as *.txt). b) Save the do-file in a similar way. c) Use the program "notepad" to edit the do file. ******************************************** *** STATA "do" files *** ******************************************** (1) If a file contains a list of STATA commands then you can execute the entire file (all commands) by typing (on the STATA command line): do YourFileName where "YourFileName" is the name of the file that contains the commands. If this command file has the *.do extension then it's not necessary to give the extension. (2) To edit a command file it is easiest to use Notepad to edit the file. If the file is saved as text (with the *.txt) then Notepad will automatically open when you double click the file. You may also edit the file using Word but want to be sure that it is saved as text -- and may need to change the file type option when saving. ******************************************** *** Windows and file extensions *** ******************************************** (thanks to Gwen Glew, 5/2002): To use "do" files you need to know the *full file name* of the data file, and of the "do" file. This full name includes the extension for the file (ie. the part of the name that follows the ".") Windows likes to hide the file extension from the user. That is, if you have a file whose name is "MyData.txt" then Windows by default will just share "MyData" as the name, and use the extension to choose what sort of icon (picture) it will use. However, as we create our analysis programs we sometimes want/need to see the entire file name -- here's a trick to get Windows to show us all of the information: When using a window to display your files go to: Tools Folder Options... View (choose that tab) [ ] Hide file extensions for known file types Make sure that you "uncheck" this option box.