An Introduction to STATA ECON 330 Econometrics Prof. Lemke

Size: px
Start display at page:

Download "An Introduction to STATA ECON 330 Econometrics Prof. Lemke"

Transcription

1 An Introduction to STATA ECON 330 Econometrics Prof. Lemke 1. GETTING STARTED A requirement of this class is that you become very comfortable with STATA, a leading statistical software package. You were given extensive exposure to Excel in ECON 130/180, which is important as you will use Excel in whatever you do after you graduate. Excel, however, is a spreadsheet program with rudimentary statistical tools. STATA is a statistical program. There are two primary statistical programs that firms/researchers use: SAS and STATA. After completing this class, you should list a working knowledge of STATA on your resume it will definitely help you land a job or internship. And although SAS is very different from STATA in terms of implementation, they are not very different at all in terms of what they can do. Moreover, employers usually don t care which one of the programs their employees learned in college as it is assumed that a smart college graduate can teach himself or herself the other program once knowing one of them. The Stata Corporation is very concerned about licensing of software. It charges for each copy, restricts each copy to one machine, and tries (in several ways) to make sure STATA users pay for their use. Lake Forest College respects intellectual property rights. The College has purchased enough licenses to have all of the computers in room 237 of the library to have STATA 12. If the door is locked, you can ask someone at the reference desk to let you in. I do not recommend using bootlegged versions of STATA. If you want to purchase your own copy, however, the current price tag is $895 with complete documentation. Go to the Start Menu, and open up STATA. You will see several windows. When I am working with STATA, I typically have three windows open: Results, Command, and Review. All results will be posted to the Results window. Commands are entered in the Command window. And the Review window lists your past several commands. By double clicking on previous commands, STATA will run them again. This is a quick way to repeat commands. Other people also like to have the Variables window open. STATA offers an interactive interface, which means, as the user, you type in commands, press enter, and STATA executes the command. Alternatively, you can write STATA programs, and then execute the programs in STATA. You are expected to learn how to program in STATA. You will write STATA programs, which are simply groups of STATA commands, in order to do the problem sets and your research project. The benefit of writing programs is that you can run and rerun a program very easily. A. Root Directories The main issue when getting starting with STATA is knowing where your data, programs, etc. are being stored on your computer. In the Command window, type: cd and hit the Enter button. In the Results window you will see the root directory of where STATA is looking for data and programs. If you are using the computers in room 237, the root directory should be U:\, which is your personal space on the network. If by chance you are not at this root, you can type in 1

2 the Command window: cd u:\ and STATA will change to the U:\ root. Next, to keep things separate from the other work you save to your U drive, enter (always in the Command window): Now enter: mkdir econ330 cd econ330 In the Results window, you should see in yellow: U:\ econ330 From now on, whenever you start up STATA, you should immediately enter cd econ330 to get to this root directly. Moreover, save all of your data, programs, and log files to this root. At this point, open up Internet Explorer, go to the class webpage: campus.lakeforest.edu/~lemke/econ330/index.html and click on the link to the first STATA lab: campus.lakeforest.edu/~lemke/econ330/stata/stata01(lab1)/lab1.html Right click on welfare.xls and save it to your U drive in your Stata folder: U:\ econ330\welfare.xls. B. Log Files Once you are in your root directory, you can start a log file. The log file will save everything that is displayed in the Results window. This is helpful as you can later print the log file or edit it and incorporate it in a Word document. To start a log file, simply type in the Command window: log using mylog.log, replace In the above line, log using is the command. You are telling STATA to open up a log file. The name of the file you are opening comes next, mylog.log. You could call it whatever you want, but make sure that it ends in.log. Lastly, STATA lets the user include options following a comma. In this case, the option is to over-write or replace any file that is already called mylog.log. In theory, you probably should not include, replace options too haphazardly as you will likely over-write a file you wanted to keep. In practice, however, it is a pain to always delete old log files (and data files) yourself, so you will probably make use of the replace option quite a bit. 2

3 When you enter a command that STATA doesn t understand or that STATA understands but which violates a precaution STATA imposes, STATA will respond with a warning or error message in red in the Results window. For example, if you already have a log file open, you cannot open another. Assuming you have already started the log file from above, type again: log using mylog.log, replace You will get a warning statement in red in the Results window stating: log file already open r(604) For the record, the comment in blue, r(604), is called a return code. It gives information as to what the error is by simply clicking on it. (One of the best features of STATA is that you can usually click on error message to learn more about the error.) Getting back to our log file, if you really wanted to start a new log file, you would first have to enter: log close When a log file is closed, the results window reports to you the name of the log file, along with the date and time it was closed. So now, suppose you want to restart the log file, and over-write what you had already done. We know that what you need to enter is log using mylog.log, replace but instead, just enter: log using mylog.log STATA will issue you another warning in the Results window: file U:\stata\mylog.log already exists r(602) The error in this instance is that the STATA will not over-write a log file (or any type of file for that matter log, data, program, graph, etc.) without the permission to do so, which comes with the replace option. So, instead type: log using mylog.log, replace and once again you will have a log file open that is collecting all results that are displayed in the Results window. To view a log file or STATA program, I suggest using WordPad. Word is also acceptable (as is any text editor), but Word and fancier editors like to save things with a lot of formatting. You really just want a good old-fashioned 1990 text editor, and that is WordPad, more or less. (WordPad is found on the Start Menu under Programs and then Accessories.) 3

4 C. Getting Help in STATA The reference desk at the library has all of the documentation materials for STATA on reserve. These manuals are extremely well-organized and helpful. If you have problems, they are a good starting point. STATA also has a very good on-line help system. When in STATA, simply type help topic or lookup topic, and STATA will give you a brief review of the topic. You can also type search topic to get a review of the commands you might want to use. When you are entering commands or running a program, however, and you encounter an error, keep in mind that one of the best ways to get help is to click on the blue return code. There is also a fabulous STATA webpage hosted by UCLA at D. Converting Excel Data to STATA Format Open Excel, and load into it welfare.xls, which you saved to your U drive in the stata folder. You will see 13 variables (variable names, in bold, are in row 1). There are 5,509 observations as the data go through row 5,510 and the first row is variable names. Select the entire matrix (from A1 to M5510). Do not select the entire sheet or entire rows or columns as STATA has difficulty with infinite rows or columns. Copy the data (Ctrl-C). In STATA, enter clear Now go to the Data Editor (Edit) icon in STATA. It is the fifth icon from the right. (It looks like an Excel sheet.) Left click on the icon, and a window that is reminiscent of Excel will appear, with what would be called cell A1 highlighted. Left click once on the highlighted cell. It will remain highlighted, and then paste what you copied from Excel (Ctrl-V or use the menu). You will then be asked whether STATA should treat the first line as data or as variable names. As you copied the variable names from Excel, click on Treat first row as variable names. Stata should think for a second, and then the window will appear with data in the cells. Close the window by clicking on the x in the upper right. 1 In the Results window, STATA returns: *(13 variables, 5509 observations pasted into data editor) With this statement, you should be confident that the cut from Excel and paste into STATA worked correctly as the number of variables and number of observations match between Excel and STATA. Next, in the Command window, type: save welfare.dta, replace The save command saves the data as a STATA dataset called welfare.dta, and the, replace option tells STATA to over-write any other file called welfare.dta. The Results window returns: (note: file welfare.dta not found) file welfare.dta saved 1 If your data may contain missing values, use the Paste-Special feature with Tab delimited box checked. 4

5 You now have a STATA dataset saved in your U:\stata folder. To see all of the files there, type: dir At a minimum, you should see mylog.log welfare.dta welfare.xls listed in your U:\econ330 folder. 2. RUNNING COMMANDS INTERACTIVELY Like any computer language, STATA has its own system of logic and symbols. To use STATA, the user feeds STATA commands. Commands almost always require a variable (or set of variables) or a dataset in which to act upon. Commands can also be supplemented with options. Usually options follow a comma, but this isn t always the case. Commands and options frequently can be abbreviated. Finally, there are also symbols that represent functional operations. A. Comments Frequently you will want to insert comments into your log file or program just to remind you of something or to index the work you are doing. There are two ways to insert comments. First, STATA ignores any line that begins with a *. Thus, you could put in a comment like the following: * ECON 330: Problem Set One When you hit return, STATA does nothing, but the comment is posted to the Results window in black type (and is also saved in the log file). The second way to include comments is to start your comments with a slash and asterisk, /*, and then end your comment with an asterisk and slash, */. STATA simply ignores everything between /* and */. You can only use this system of comments, however, in a STATA program; it does not work interactively. B. Functional Symbols In STATA: + means addition, - means subtraction, * means multiplication / means division & means and means or ln means natural log log also means natural log > means greater than >= means greater than or equal to < means less than <= means less than or equal to 5

6 C. Basic Commands The ten most commonly used commands are: use, save, describe, summarize, generate, drop, keep, log using, log close, and clear. To focus on these commands, enter the following. log close clear It could be that a log file is not open, in which case log close is not needed, but it never hurts to close a potential log file before trying to open another. The clear command clears all data from STATA s memory (or tells the user that no data is in memory if that happens to be the case). Now enter: log using mylog.log, replace use welfare.dta This opens up a log file and then calls into memory the data in welfare.dta. Only one dataset can be in memory at a time. It is also not required to include the.dta extension, but it doesn t hurt either. Now type describe Notice that when no variables are listed, the describe command lists the number of observations and variables in the dataset, and then it proceeds to list the type of variable each is. It also lists the variable s value label and the variable label if the researcher has defined these. We haven t done that yet, so the variables in welfare.dta do not have descriptions. The shortcut command for describe is desc. At this point, your results window may have a blue line with -more-. This indicates that there is more output to be posted to the window, but rather than automatically post all results, STATA is waiting for the user to click on the space bar once to scroll through the results. Whenever your results window has this blue bar, therefore, press the space bar (repeatedly if necessary) to scroll through all results. Note that describe is a rare command in that it does not require a variable or dataset after it. This is because, if no variables are listed after the command, STATA will perform the command on all variables in the dataset that is currently in memory. Alternatively, if you only want a few variables described, you might type the command followed by the variables you are interested in, for example: desc age cccost wage Next, use the summarize command to produce summary statistics for each variable. Again, if you do not include a list of variables, STATA will provide the summary statistics for all variables in memory. If you provide a variable list, then the summary statistics are provided just for those variables. Also, summary statistics cannot be calculated for alphabetical variables (called string variables) as summary statistics are mathematical in nature. Enter: summarize and you will see in the Results window the summary statistics for all 13 variables. You can tell that several of the variables are strings as there are no summary statistics for them (educ, race, English, smsa, working). The shortcut command for summarize is sum. For example, enter: sum age wage hours and you will see the summary statistics for just these three variables. 6

7 You can observe more summary statistics for each variable by adding the detail option following a comma. For example, enter: sum age, detail and you will get a table of percentiles along with measures of the mean, median, variance, number of observations, and even a few more statistics. You can abbreviate detail with just d. Try this with: sum age wage hours, d Now that you have described and summarized your data, you will often need to create new variables from the data. For example, we might want to study the natural log of wages rather than wages levels. To do this, we will create a variable called lnwage. To do this, enter: generate lnwage = ln(wage) Notice a couple of things. First, you cannot take the natural log of 0, and as many observations had a 0 for wage indicating that the individual is not employed, the log(wage) is undefined. Missing values are denoted by a single period,., in STATA, and upon creating lnwages, STATA reports back that: (2745 missing values generated) Second, the command used to create the log of wage variable is generate. To the right of the equal sign, however, is ln which is a mathematical function and that function is applied to whatever variable is in parentheses (in this case, its applied to wage). Third, whenever you generate a new variable, you must assign it a variable name. The new variable is listed immediately after the generate command and is followed by an = sign. In the above example, the new variable name is lnwage. Finally, the shortcut command for generate is gen. So you could have entered instead: gen lnwage = ln(wage) If you enter this now you will get an error message as the variable lnwage has now been defined, so don t renter the command using gen. As a brief aside, it is a good idea to give variables meaningful names. It is also a good idea to restrict variable names to 8 characters or less. This is not required, but it can help when interpreting results as STATA sometimes restricts itself to listing the first 8 characters in a variable. Be aware that STATA also recognizes a difference between uppercase and lowercase letters. Now that new variables have been defined, we may want to save our new dataset. Type: save welfare_b.dta to save the new variable (along with all of the variables as they are still all in memory) to a new STATA dataset file called welfare_b.dta. Finally, you would want to close the log file and clear the memory: log close clear Neither of these commands requires a list of variables or a dataset as log close applies to the currently opened log file and clear applies to STATA s memory. 7

8 D. Boolean Logic of STATA At the end of section C above, we saved and cleared our data, so to pick up from there, type: log using mylog2.log, replace use welfare_b.dta The first command starts a new log file. The second calls the welfare_b.dta data set into STATA s memory. (Recall that STATA can have at most one data set in memory at any one time.) There is a Boolean logic to STATA commands that is necessary to understand for anyone to use STATA. When defining variables, a single equal sign is required to the right of the new variable name. For example, when we defined lnwage to be the natural log of the hourly wage, the command in STATA was gen lnwage = ln(wage). (Do not repeat this command now, as lnwage is already defined.) Notice the single equal sign in this command a single equals sign is used whenever generating a variable! Suppose instead that we wanted to create a variable called employed that equals 1 if the person s wage rate is positive and equals 0 if the wage rate is 0. Thus, we are creating a dummy variable that takes on the values of 1 or 0. This is a Boolean operation, and STATA allows for this by using parentheses. STATA evaluates any expression that is in parentheses to the right of the equal sign to see if the expression is true or false. If the expression is true, STATA assigns a value of 1 to the parentheses and assigns a 0 if the value is not true. Thus, to create the variable employed, enter: gen employed = (wage>0) Thus, all observations with a positive wage will have a value of 1 associated with employed, while all observations associated with a $0 wage will have a value of 0 associated with employed. To prove this to yourself, enter the following (note the double equal sign is not a typo): sum wage if employed==0 sum wage if employed==1 Note that the wage values are strictly positive when employed equals one and the wage values all equal zero when employed equals zero. (We will return to the syntax of the qualifying if statement later.) An alternative way to get the above results, which used two sum commands both with if statements, is to use a single bysort statement. To do this, enter: bysort employed: sum wage For the record, the bysort command executes the command following the colon (sum wage) for all values of the variable that precedes the colon (employed). You will notice in the Results window that there are two sets of results, one for when employed takes on the value of 0 and one for when employed takes on the value of 1. Another powerful command in STATA, especially when it comes to seeing your data, is tabulate, or simply tab. The tab command must be followed by at least one and at most two variables. If it is followed by a single variable, STATA will produce a table of values for that variable. Consider the race variable. tab race 8

9 The results are: race Freq. Percent Cum black 1, hispanic 2, other white 1, Total 5, The tab command, therefore, reveals that race takes on four difference values black, hispanic, other, and white. It goes on to report the count (frequency) of each value as well as the percentage and cumulative percentage for each value. (You may recall that this type of table, a Frequency Table, was introduced on day 1 or 2 of your ECON 130/180 class.) If the tab command is followed by two variables, then STATA produces a cross-tabulation of the values. (Also taught in ECON 130/180.) For example, the data set already has a (string) variable, working, that supposedly indicates whether or not someone is working. Our newly created employed variable should line up perfectly with the working variable if the data are to make sense. We can check into that by using tab. Enter: The results are: tab employed working working employed Not Worki Working Total , , ,764 2, Total 2,745 2,764 5,509 And so we see that working and employed are capturing the same behavior. There are 2,745 observations who are not working and not employed. There are 2,764 observations who are working and employed. There are no observations for which the individual is not working but employed or for which the individual is working but not employed. Suppose instead of creating the employed variable, we want to create a variable indicating that someone is unemployed. In this case, unempl will equal 1 if wages are $0 and equal 0 if wages are positive. The natural guess at how to do this is to enter gen unempl = (wage=0), but this does not work. If you do this, STATA will return the error: wage=0 invalid name r(198); The problem is that a single equal sign is reserved for the definition of the variable name. That is, immediately to the right of the new variable name is a single equal sign. If an expression requires equality in the conditional part of a statement (not in the variable name designation), then STATA requires a double equal sign. 9

10 So, the proper way to create unempl is: gen unempl = (wage==0) Again, notice that there is a single equal sign when defining the new variable, but there is a double equal sign when typing the condition under which the variable is being defined. This is the source of a lot of problems, so if you ever receive an invalid name error when an equal sign as part of the error (wage=0 invalid name from above), the first thing you should check are your double equal signs. To make things a bit more confusing, if the qualifying statement uses a less than or equal or a greater than or equal condition, you do not need to include a double equal sign. In fact, you can t use a double equal sign in such cases. So, if we were going to define a new variable called highwage that equals 1 if the person s wage is $10 or more per hour, the command would be: gen highwage = (wage>=10) Embedded in STATA s system of logic is also the qualifier if. Note that if is a qualifier, it is not a command or an option. You will use if to apply a command to only some of the observations. For example, suppose you want to know the average wage for all highwage workers. Clearly you cannot summarize wage as that will give you the average of all wages, including $0 wage rates. You cannot summarize highwage, as that will simply give the percentage of workers who are highwage workers. Do both quickly just to convince yourself of each: sum wage highwage Variable Obs Mean Std. Dev. Min Max wage highwage Thus, the average wage rate, including the $0 wage of those not working is $3.73 and only 5.59% of people in the data set earn at least $10 per hour. The question remains, what is the average hourly wage of high-wage workers? We might also be interested in the average hourly wage of all workers, omitting those with a wage of $0. The way to get at both of these statements is with a qualifying if. sum wage if highwage==1 If you read the above command, it says to summarize the hourly wage for those observations who are designated high-wage workers. Notice the double equal sign. The results are: Variable Obs Mean Std. Dev. Min Max wage Thus, the average wage of high-wage workers is $11.29 (and that there are exactly 308 such observations, which is 5.59% of 5509). 10

11 The results could also have been obtained with a bysort command, but this would be the worst choice as this command is also going to report additional information that was not asked for (in particular it is going to report the average wage of all observations that are not earning at least $10 per hour). Try it to see this point. That is, enter: bysort highwage: sum wage To find the average wage of all workers (with strictly positive wages), enter: The results are: sum wage if wage>0 Variable Obs Mean Std. Dev. Min Max wage Thus, the average wage of all workers is $7.44. The real power of Boolean logic comes in being able to use Boolean operators with other mathematical functions. For example, consider the race variable again. It is a string variable taking on the values of black, hispanic, white, and other. We want to create a numerical variable that captures these four possibilities. Consider the following: gen race2 = 1*(race== black ) + 2*(race== hispanic ) + 3*(race== white ) + 4*(race== other ) Be sure to type the entire command without entering a return until the end. There are two new features of this expression that we haven t seen before. First, when dealing with string variables, you must put the variable value in quotes. Second, each parenthetical expression gets evaluated as 0 or 1, and now we are multiplying each by 1, 2, 3, or 4 depending on the race. Thus, the above command creates a new variable called race2 that equals 1 for blacks, 2 for Hispanics, 3 for whites, and 4 for all other races. We can make sure we typed the expression correctly by tabbing race2 against race. tab race race2 race2 race Total black 1, ,962 hispanic 0 2, ,088 other white 0 0 1, , Total 1,962 2,088 1, ,509 Before moving on, save the new dataset: save welfare_c, replace 11

12 E. More Commands There are a few more commands worth knowing from the outset. Two commands that are related are the drop and keep commands. The trick with both of these commands (and they are essentially the opposite of one another) is that with any dataset, you can drop variables or drop observations. You can also keep variables or keep observations. This is an extremely important difference! Whenever you use a drop or keep command, you need to understand if you are dropping or keeping observations or variables. A drop command followed by a list of variables removes all of the listed variables from the dataset in memory. (That is, STATA keeps all variables that are not listed.) The keep command followed by a list of variables keeps the variables listed and removes all of the others from STATA memory. In small data sets, there is not much benefit to carefully choosing between the drop and keep commands, but if you have a dataset with 1000 variables and you want to keep just 25 of them, it is much better to use a keep command followed by 25 variable names than to use a drop command followed by 975 variable names. (Likewise, it is better to use a drop command than a keep command to reduce a dataset of 123 variables to one with 117 variables.) Just for practice, create the variables dum2, dum3, and dum4 that equals two, three, and four times each individuals wage respectively, and then immediately proceed to drop dum2, dum3, and dum4. gen dum2 = 2*wage gen dum3 = 3*wage gen dum4 = 4*wage drop dum2 dum3 dum4 The drop and keep commands can also be used with a qualifying if to drop or keep particular observations. The trick is to realize that whenever drop or keep is followed by a list of variables, those variables will be dropped or kept. Whenever drop or keep is followed by a qualifying statement, then the observations that satisfy the qualifying statement will be dropped or kept. Suppose you want to create a new dataset of just high-wage workers. One way to do this is to enter: keep if highwage==1 save hw_workers.dta, replace sum Notice that this data set still contains all of the variables that are in welfare_c.dta (18 variables in all), but there are now only 308 observations in hw_workers.dta, which correspond to the 308 observations in welfare.dta that have a wage of $10 or more. The point of this exercise, though, was to show how a large data set with high wages, low wages, and zero wages, can be converted into a dataset (with a new name) of just high wage earners by using a single keep command. We want to return to the welfare_c.dta dataset, so enter: clear use welfare_c.dta Suppose we want to save just those observations for which race is black and the hourly wage is greater than or equal to $6.50. The command would be: keep if wage>=6.50 & race== black Notice the Boolean logic implicit in and which is captured by the & symbol. Note too that we used a double equal sign and included the string variable value, black, in double quotes. 12

13 To see the new dataset, summarize it: sum Notice that there are now 806 observations. We could then save this dataset: save dataset2.dta, replace clear As this last dataset is rather meaningless, let s delete it. The clear command deleted this data set from STATA s memory, but when we say let s delete it, I mean let s delete it from your U drive. STATA s delete command is erase, so enter: erase dataset2.dta Note that you must include the.dta extention when using the erase command. Now call back into memory the previous data set: use welfare_c.dta Suppose you don t want 2,745 observations to be associated with a missing value for lnwage, we can have STATA treat all of these lnwages as 0 by using the recode command: recode lnwage.=0 The recode command requires a single variable, and then a current value (in this case.) that will be replaced or recoded with a different value (in this case 0), and the equal sign separates the two. Therefore, the above command replaces all values of. for lnwage with a 0. Clearly no two variables can share the same name in STATA. At the same time, sometimes a certain variable name seems to be the best possible to use. This happened above when we created race2. The best name to use is race, but it was already taken. At the same time, after we create race2, we don t need race anymore. In order to use the variable name race instead of race2, use the rename and drop commands. drop race rename race2 race In the above sequence of commands, first race is dropped. Then race2 is renamed to be race. The variable race2 no longer exists. You can see this by describing or summarizing the dataset. To see that race2 no longer exists, however, a shortcut would be to enter: desc r* This command tells STATA to describe all variables that begin with the letter r. Notice that race is in the list, but race2 is not. The last set of commands that will be introduced now concerns labeling variables and labeling values (recall the describe command). It is never necessary to label your variables or their values, but it will be useful, especially when looking at results or returning to work you did several weeks in the past and needing to remember how variables were defined. 13

14 First, to label a variable, use the label variable command. After the command, list a single variable, and then in quotes provide a 30 character or less description of the variable. (You can exceed the 30 character limit, but it is best not to as STATA will cut off after 30 characters at times.) For example: label variable race Race of individual label variable wage Hrly wage; = 0 if not working When variables take on just a few values, it is also a good idea to place a value label to each. Consider the race variable. Tabbing it yields: tab race race Freq. Percent Cum , , , Total 5, These results are only informative to someone who knows that the value 1 is for blacks, 2 is for Hispanics, and so on. To make things easier, add value labels. Attaching value labels requires two commands: first the values need to be defined and then the values need to be attached to a variable. Enter the following two commands: label define races 1 black 2 Hispanic 3 white 4 other label values race races The first command defines a value class called races. Notice that each value 1 4 are now associated with a string that is included in quotes. Though not required, it is usually best to keep each label to eight or fewer characters, just to facilitate clear presentation of data and results by STATA. The second command assigns the value class called races to the variable called race. Now tab race again to see the difference: tab race Race of individual Freq. Percent Cum black 1, Hispanic 2, white 1, other Total 5, It is important to know that assigning value labels does exactly that it assigns labels. It does not change the value of the variable. In doing this, the variable race is still a numeric variable that takes on the values from 1 to 4. To see this, enter the following two commands: desc race sum race Notice in the Results window that race is now associated with a value label called races, and there is a variable label as well called Race of individual. 14

15 If you ever need to tab a variable but want the actual values instead of the value labels to be printed in the results, simply include the option of no labels. To do this, enter: tab race, nolabel The results window now produces exactly the same frequency table as above, but this time the actual variable values of 1 through 4 are listed in the left hand side column. Lastly, save this data set as: save welfare2.dta, replace 3. PROGRAMMING IN STATA Programming in STATA is quite easy once you understand how to use STATA interactively. STATA programs are simply sequences of STATA commands that are saved in a single program and, when the program is run in STATA, are executed in order. There are two huge advantages to using programs than using STATA s interactive mode. Most important is that you can execute the same set of commands over and over again, without typing each command each time you want to generate the results. The other advantage is that you can make extensive comments in your program so you know why or how you are doing things. How to best edit a STATA program is debatable. First off, STATA programs must have the extention.do, so, for example, you might call it program.do. You can use any word processing program to edit a program, but be sure to save it in text format. I prefer to edit programs in WordPad. Others prefer to edit programs using STATA s text editor. I would suggest that you learn to use the WordPad approach (make sure you save your do files to u:\stata when you do it this way), but for today let s use the STATA editor. Enter: doedit When you do this, a window will appear called Untitled.do. Let s first give what we are about to do a name. Save the program (CNTL-S or use the menu). Be sure to save the program to your u:\stata folder. Give it the name program1.do. For practice, kill the file by clicking on the red X in the upper right hand corner. Then type doedit program1.do and this will bring your already titled program back into the data editor. We will now start constructing the real program. I start each of my STATA programs with the following two commands (copy these verbatim into lines 1 and 2 of your program): # delimit; set more 1; 15

16 The first command: # delimit; tells STATA that each command to be executed ends with a semicolon. This allows the program to use more than one line per command, which is sometimes necessary. Once this delimit command is entered in a program, STATA will not consider a command complete until it encounters a semicolon. For example, in a STATA program, one would have typed (don t type this into your program): gen race2 = 1*(race== black ) + 2*(race== hispanic ) + 3*(race== white ) + 4*(race== other ); Notice how the semicolon ends the command. Alternatively, some people would enter the following just to keep things looking nicer (don t type this into your program either): gen race2 = 1*(race== black ) + 2*(race== hispanic ) + 3*(race== white ) + 4*(race== other ); The second command, set more 1; tells the Results window to scroll automatically (without the user having to press the spacebar when the window fills up). This is simply for convenience, but it is an important convenience, especially for long programs. After these first two commands, I enter comments to remind me of what the program does, when I wrote it, etc. For example, I might enter: * Written by Rob Lemke; * September 5, 2013; * This program creates the race and education variables for the welfare data set; Enter three similar commands in your program on lines 4 7. It s ok to leave a line blank (in this case, line 3). From this point on, the program is simply a set of STATA commands, all ending with a semicolon. Here is a sample of a very short program that does some of the things we have already done. # delimit; set more 1; log using program1.log, replace; * Written by Rob Lemke for STATA Introduction Program 1; * August 31, 2012; * This program creates the race and education variables for the welfare data set; use welfare.dta; tab race educ; gen lnwage=ln(wage); recode lnwage. = 0; gen highwage=(wage>=10); sum wage if wage>0; 16

17 sum wage if highwage==1; gen race2 = 1*(race== black ) + 2*(race== hispanic ) + 3*(race== white ) + 4*(race== other ); drop race; rename race2 race; label variable race Race of individual ; label define races 1 black 2 Hispanic 3 white 4 other ; label values race races; save dataset3.dta, replace; clear; log close; Enter this program into your program. Be sure to type accurately. Last, to execute a program, the command is do followed by the program name. For example, you might type the preceding program into WordPad, save it as program1.do in your U:\stata folder, and then in STATA, you would enter do program1.do. When using the STATA editor, save your program (CNTL-S or using the menu) and then kill the editing window. And then finally, execute your program by entering log close clear do program1.do After the program runs, you can open the file program1.log in WordPad to view all of the results. As long as you haven t closed the Results window, you can also scroll up to see all of the commands and results. 4. GRAPHING IN STATA In addition to its extraordinary statistical powers, STATA s graphing abilities are top notch. With practice, you can make much better graphs in STATA than in Excel. There are three things to keep in mind. First, graphs are displayed in a graphics window that automatically appears but that you will frequently have to close on your own. Second, you can save graphs as their own file (with a.gph extension) and then recall the graph whenever you like. Third, you can right click on the graph, click on copy, and then paste the graph into a Word document. Using welfare.dta, we will drop all non-workers and all workers with wages that appear to be outliers, and then graph wages against hours worked. clear use welfare.dta drop if wage==0 sum wage, detail drop if wage>20 The cut-point of $20 per hour looks reasonable given the descriptive statistics. Now we will create and save the graph. Enter the following all on one line in STATA s command window: scatter wage hours, xlabel( ) ylabel( ) title(wages by Hours) saving(wages.gph,replace) There are many graphing commands, depending on the type of graph you want to create. In this case, we want to simply plot two sets of points against each other, i.e., a scatter plot. So the command scatter is 17

18 used. Next list the y-axis variable (wage in this case) followed by the x-axis variable (hours in this case). Following the variables, include a comma and then all of the graphing options that you want to employ. There is a manual for graphing in STATA. There are thousands of different options and ways you can control the look of your graph. In the command above, we have elected to tell STATA which numbers to include on the x-axis, which numbers to include on the y-axis, the title of the graph, and to save the graph as wages.gph. Be sure there are no spaces between each qualifying option and the parentheses. That is, the option is xlabel(0 10 it is not xlabel ( 0 10 or even xlabel (0 10 After executing the graphing command, click on the x in the upper right corner to make the graphing box go away. To get the graph back, the command is: graph use wages.gph 18

Introduction to Stata: An In-class Tutorial

Introduction to Stata: An In-class Tutorial Introduction to Stata: An I. The Basics - Stata is a command-driven statistical software program. In other words, you type in a command, and Stata executes it. You can use the drop-down menus to avoid

More information

An Introduction to Stata Exercise 1

An Introduction to Stata Exercise 1 An Introduction to Stata Exercise 1 Anna Folke Larsen, September 2016 1 Table of Contents 1 Introduction... 1 2 Initial options... 3 3 Reading a data set from a spreadsheet... 5 4 Descriptive statistics...

More information

A Short Introduction to STATA

A Short Introduction to STATA A Short Introduction to STATA 1) Introduction: This session serves to link everyone from theoretical equations to tangible results under the amazing promise of Stata! Stata is a statistical package that

More information

BIOSTATISTICS LABORATORY PART 1: INTRODUCTION TO DATA ANALYIS WITH STATA: EXPLORING AND SUMMARIZING DATA

BIOSTATISTICS LABORATORY PART 1: INTRODUCTION TO DATA ANALYIS WITH STATA: EXPLORING AND SUMMARIZING DATA BIOSTATISTICS LABORATORY PART 1: INTRODUCTION TO DATA ANALYIS WITH STATA: EXPLORING AND SUMMARIZING DATA Learning objectives: Getting data ready for analysis: 1) Learn several methods of exploring the

More information

Survey of Math: Excel Spreadsheet Guide (for Excel 2016) Page 1 of 9

Survey of Math: Excel Spreadsheet Guide (for Excel 2016) Page 1 of 9 Survey of Math: Excel Spreadsheet Guide (for Excel 2016) Page 1 of 9 Contents 1 Introduction to Using Excel Spreadsheets 2 1.1 A Serious Note About Data Security.................................... 2 1.2

More information

TYPES OF VARIABLES, STRUCTURE OF DATASETS, AND BASIC STATA LAYOUT

TYPES OF VARIABLES, STRUCTURE OF DATASETS, AND BASIC STATA LAYOUT PRIMER FOR ACS OUTCOMES RESEARCH COURSE: TYPES OF VARIABLES, STRUCTURE OF DATASETS, AND BASIC STATA LAYOUT STEP 1: Install STATA statistical software. STEP 2: Read through this primer and complete the

More information

Econ Stata Tutorial I: Reading, Organizing and Describing Data. Sanjaya DeSilva

Econ Stata Tutorial I: Reading, Organizing and Describing Data. Sanjaya DeSilva Econ 329 - Stata Tutorial I: Reading, Organizing and Describing Data Sanjaya DeSilva September 8, 2008 1 Basics When you open Stata, you will see four windows. 1. The Results window list all the commands

More information

1 Introduction to Using Excel Spreadsheets

1 Introduction to Using Excel Spreadsheets Survey of Math: Excel Spreadsheet Guide (for Excel 2007) Page 1 of 6 1 Introduction to Using Excel Spreadsheets This section of the guide is based on the file (a faux grade sheet created for messing with)

More information

Introduction to Stata - Session 2

Introduction to Stata - Session 2 Introduction to Stata - Session 2 Siv-Elisabeth Skjelbred ECON 3150/4150, UiO January 26, 2016 1 / 29 Before we start Download auto.dta, auto.csv from course home page and save to your stata course folder.

More information

Using Microsoft Excel

Using Microsoft Excel Using Microsoft Excel Introduction This handout briefly outlines most of the basic uses and functions of Excel that we will be using in this course. Although Excel may be used for performing statistical

More information

Create your first workbook

Create your first workbook Create your first workbook You've been asked to enter data in Excel, but you've never worked with Excel. Where do you begin? Or perhaps you have worked in Excel a time or two, but you still wonder how

More information

Document Imaging User Guide

Document Imaging User Guide Release 4.9 IMAGING TECHNOLOGY GROUP Document Imaging Systems Document Imaging User Guide IMAGING TECHNOLOGY GROUP IMIGIT tm Document Imaging User Guide Release 4.91 March 2007 Imaging Technology Group

More information

Learning Worksheet Fundamentals

Learning Worksheet Fundamentals 1.1 LESSON 1 Learning Worksheet Fundamentals After completing this lesson, you will be able to: Create a workbook. Create a workbook from a template. Understand Microsoft Excel window elements. Select

More information

EXCEL BASICS: MICROSOFT OFFICE 2007

EXCEL BASICS: MICROSOFT OFFICE 2007 EXCEL BASICS: MICROSOFT OFFICE 2007 GETTING STARTED PAGE 02 Prerequisites What You Will Learn USING MICROSOFT EXCEL PAGE 03 Opening Microsoft Excel Microsoft Excel Features Keyboard Review Pointer Shapes

More information

Assignment 0. Nothing here to hand in

Assignment 0. Nothing here to hand in Assignment 0 Nothing here to hand in The questions here have solutions attached. Follow the solutions to see what to do, if you cannot otherwise guess. Though there is nothing here to hand in, it is very

More information

After opening Stata for the first time: set scheme s1mono, permanently

After opening Stata for the first time: set scheme s1mono, permanently Stata 13 HELP Getting help Type help command (e.g., help regress). If you don't know the command name, type lookup topic (e.g., lookup regression). Email: tech-support@stata.com. Put your Stata serial

More information

Lastly, in case you don t already know this, and don t have Excel on your computers, you can get it for free through IT s website under software.

Lastly, in case you don t already know this, and don t have Excel on your computers, you can get it for free through IT s website under software. Welcome to Basic Excel, presented by STEM Gateway as part of the Essential Academic Skills Enhancement, or EASE, workshop series. Before we begin, I want to make sure we are clear that this is by no means

More information

EXCEL BASICS: MICROSOFT OFFICE 2010

EXCEL BASICS: MICROSOFT OFFICE 2010 EXCEL BASICS: MICROSOFT OFFICE 2010 GETTING STARTED PAGE 02 Prerequisites What You Will Learn USING MICROSOFT EXCEL PAGE 03 Opening Microsoft Excel Microsoft Excel Features Keyboard Review Pointer Shapes

More information

Using Microsoft Excel

Using Microsoft Excel Using Microsoft Excel in Excel Although calculations are one of the main uses for spreadsheets, Excel can do most of the hard work for you by using a formula. When you enter a formula in to a spreadsheet

More information

ADePT: Labor. Technical User s Guide. Version 1.0. Automated analysis of the labor market conditions in low- and middle-income countries

ADePT: Labor. Technical User s Guide. Version 1.0. Automated analysis of the labor market conditions in low- and middle-income countries Development Research Group, Development Economics, World Bank ADePT: Labor Version 1.0 Automated analysis of the labor market conditions in low- and middle-income countries Technical User s Guide The ADePT

More information

Using Excel This is only a brief overview that highlights some of the useful points in a spreadsheet program.

Using Excel This is only a brief overview that highlights some of the useful points in a spreadsheet program. Using Excel 2007 This is only a brief overview that highlights some of the useful points in a spreadsheet program. 1. Input of data - Generally you should attempt to put the independent variable on the

More information

Excel Basics: Working with Spreadsheets

Excel Basics: Working with Spreadsheets Excel Basics: Working with Spreadsheets E 890 / 1 Unravel the Mysteries of Cells, Rows, Ranges, Formulas and More Spreadsheets are all about numbers: they help us keep track of figures and make calculations.

More information

For many people, learning any new computer software can be an anxietyproducing

For many people, learning any new computer software can be an anxietyproducing 1 Getting to Know Stata 12 For many people, learning any new computer software can be an anxietyproducing task. When that computer program involves statistics, the stress level generally increases exponentially.

More information

Chapter 2 The SAS Environment

Chapter 2 The SAS Environment Chapter 2 The SAS Environment Abstract In this chapter, we begin to become familiar with the basic SAS working environment. We introduce the basic 3-screen layout, how to navigate the SAS Explorer window,

More information

Formulas, LookUp Tables and PivotTables Prepared for Aero Controlex

Formulas, LookUp Tables and PivotTables Prepared for Aero Controlex Basic Topics: Formulas, LookUp Tables and PivotTables Prepared for Aero Controlex Review ribbon terminology such as tabs, groups and commands Navigate a worksheet, workbook, and multiple workbooks Prepare

More information

Using Microsoft Excel

Using Microsoft Excel About Excel Using Microsoft Excel What is a Spreadsheet? Microsoft Excel is a program that s used for creating spreadsheets. So what is a spreadsheet? Before personal computers were common, spreadsheet

More information

Excel for Gen Chem General Chemistry Laboratory September 15, 2014

Excel for Gen Chem General Chemistry Laboratory September 15, 2014 Excel for Gen Chem General Chemistry Laboratory September 15, 2014 Excel is a ubiquitous data analysis software. Mastery of Excel can help you succeed in a first job and in your further studies with expertise

More information

Excel Basics Rice Digital Media Commons Guide Written for Microsoft Excel 2010 Windows Edition by Eric Miller

Excel Basics Rice Digital Media Commons Guide Written for Microsoft Excel 2010 Windows Edition by Eric Miller Excel Basics Rice Digital Media Commons Guide Written for Microsoft Excel 2010 Windows Edition by Eric Miller Table of Contents Introduction!... 1 Part 1: Entering Data!... 2 1.a: Typing!... 2 1.b: Editing

More information

Module 1: Introduction RStudio

Module 1: Introduction RStudio Module 1: Introduction RStudio Contents Page(s) Installing R and RStudio Software for Social Network Analysis 1-2 Introduction to R Language/ Syntax 3 Welcome to RStudio 4-14 A. The 4 Panes 5 B. Calculator

More information

Section 0.3 The Order of Operations

Section 0.3 The Order of Operations Section 0.3 The Contents: Evaluating an Expression Grouping Symbols OPERATIONS The Distributive Property Answers Focus Exercises Let s be reminded of those operations seen thus far in the course: Operation

More information

Civil Engineering Computation

Civil Engineering Computation Civil Engineering Computation First Steps in VBA Homework Evaluation 2 1 Homework Evaluation 3 Based on this rubric, you may resubmit Homework 1 and Homework 2 (along with today s homework) by next Monday

More information

Divisibility Rules and Their Explanations

Divisibility Rules and Their Explanations Divisibility Rules and Their Explanations Increase Your Number Sense These divisibility rules apply to determining the divisibility of a positive integer (1, 2, 3, ) by another positive integer or 0 (although

More information

Depending on the computer you find yourself in front of, here s what you ll need to do to open SPSS.

Depending on the computer you find yourself in front of, here s what you ll need to do to open SPSS. 1 SPSS 11.5 for Windows Introductory Assignment Material covered: Opening an existing SPSS data file, creating new data files, generating frequency distributions and descriptive statistics, obtaining printouts

More information

HTML/CSS Lesson Plans

HTML/CSS Lesson Plans HTML/CSS Lesson Plans Course Outline 8 lessons x 1 hour Class size: 15-25 students Age: 10-12 years Requirements Computer for each student (or pair) and a classroom projector Pencil and paper Internet

More information

Excel 2010: Basics Learning Guide

Excel 2010: Basics Learning Guide Excel 2010: Basics Learning Guide Exploring Excel 2010 At first glance, Excel 2010 is largely the same as before. This guide will help clarify the new changes put into Excel 2010. The File Button The purple

More information

Intro to Stata for Political Scientists

Intro to Stata for Political Scientists Intro to Stata for Political Scientists Andrew S. Rosenberg Junior PRISM Fellow Department of Political Science Workshop Description This is an Introduction to Stata I will assume little/no prior knowledge

More information

The name of our class will be Yo. Type that in where it says Class Name. Don t hit the OK button yet.

The name of our class will be Yo. Type that in where it says Class Name. Don t hit the OK button yet. Mr G s Java Jive #2: Yo! Our First Program With this handout you ll write your first program, which we ll call Yo. Programs, Classes, and Objects, Oh My! People regularly refer to Java as a language that

More information

(Refer Slide Time 3:31)

(Refer Slide Time 3:31) Digital Circuits and Systems Prof. S. Srinivasan Department of Electrical Engineering Indian Institute of Technology Madras Lecture - 5 Logic Simplification In the last lecture we talked about logic functions

More information

Introduction to the workbook and spreadsheet

Introduction to the workbook and spreadsheet Excel Tutorial To make the most of this tutorial I suggest you follow through it while sitting in front of a computer with Microsoft Excel running. This will allow you to try things out as you follow along.

More information

Activity: page 1/10 Introduction to Excel. Getting Started

Activity: page 1/10 Introduction to Excel. Getting Started Activity: page 1/10 Introduction to Excel Excel is a computer spreadsheet program. Spreadsheets are convenient to use for entering and analyzing data. Although Excel has many capabilities for analyzing

More information

2 A little on Spreadsheets

2 A little on Spreadsheets 2 A little on Spreadsheets Spreadsheets are computer versions of an accounts ledger. They are used frequently in business, but have wider uses. In particular they are often used to manipulate experimental

More information

DOWNLOAD PDF MICROSOFT EXCEL ALL FORMULAS LIST WITH EXAMPLES

DOWNLOAD PDF MICROSOFT EXCEL ALL FORMULAS LIST WITH EXAMPLES Chapter 1 : Examples of commonly used formulas - Office Support A collection of useful Excel formulas for sums and counts, dates and times, text manipularion, conditional formatting, percentages, Excel

More information

Stata: A Brief Introduction Biostatistics

Stata: A Brief Introduction Biostatistics Stata: A Brief Introduction Biostatistics 140.621 2005-2006 1. Statistical Packages There are many statistical packages (Stata, SPSS, SAS, Splus, etc.) Statistical packages can be used for Analysis Data

More information

Formulas in Microsoft Excel

Formulas in Microsoft Excel Formulas in Microsoft Excel Formulas are the main reason for wanting to learn to use Excel. This monograph is intended as a quick reference to the basic concepts underlying the use of formulas. It is prepared

More information

API-202 Empirical Methods II Spring 2004 A SHORT INTRODUCTION TO STATA 8.0

API-202 Empirical Methods II Spring 2004 A SHORT INTRODUCTION TO STATA 8.0 API-202 Empirical Methods II Spring 2004 A SHORT INTRODUCTION TO STATA 8.0 Course materials and data sets will assume that you are using Stata to complete the analysis. Stata is available on all of the

More information

Excel (Giant) Handout (3/16/15)

Excel (Giant) Handout (3/16/15) Excel (Giant) Handout (3/16/15) Excel is a spreadsheet processor that is an outgrowth of Lotus 1-2-3 and Symphony. It is a Microsoft Product that is part of Microsoft Office (all versions) along with Microsoft

More information

Chapter 2 Assignment (due Thursday, April 19)

Chapter 2 Assignment (due Thursday, April 19) (due Thursday, April 19) Introduction: The purpose of this assignment is to analyze data sets by creating histograms and scatterplots. You will use the STATDISK program for both. Therefore, you should

More information

Table of Contents. How to use this document. How to use the template. Page 1 of 9

Table of Contents. How to use this document. How to use the template. Page 1 of 9 Table of Contents How to use this document... 1 How to use the template... 1 Template Sections... 2 Blank Section... 2 Signature Sheet... 2 Title Page... 2 Roman Numerals Section (i, ii, iii, iv )... 3

More information

Microsoft Excel 2010 Handout

Microsoft Excel 2010 Handout Microsoft Excel 2010 Handout Excel is an electronic spreadsheet program you can use to enter and organize data, and perform a wide variety of number crunching tasks. Excel helps you organize and track

More information

International Graduate School of Genetic and Molecular Epidemiology (GAME) Computing Notes and Introduction to Stata

International Graduate School of Genetic and Molecular Epidemiology (GAME) Computing Notes and Introduction to Stata International Graduate School of Genetic and Molecular Epidemiology (GAME) Computing Notes and Introduction to Stata Paul Dickman September 2003 1 A brief introduction to Stata Starting the Stata program

More information

Creating a new form with check boxes, drop-down list boxes, and text box fill-ins. Customizing each of the three form fields.

Creating a new form with check boxes, drop-down list boxes, and text box fill-ins. Customizing each of the three form fields. In This Chapter Creating a new form with check boxes, drop-down list boxes, and text box fill-ins. Customizing each of the three form fields. Adding help text to any field to assist users as they fill

More information

IDS 101 Introduction to Spreadsheets

IDS 101 Introduction to Spreadsheets IDS 101 Introduction to Spreadsheets A spreadsheet will be a valuable tool in our analysis of the climate data we will examine this year. The specific goals of this module are to help you learn: how to

More information

Intermediate Excel 2003

Intermediate Excel 2003 Intermediate Excel 2003 Introduction The aim of this document is to introduce some techniques for manipulating data within Excel, including sorting, filtering and how to customise the charts you create.

More information

Running Wordstar 6 on Windows 7 Using vdos

Running Wordstar 6 on Windows 7 Using vdos Running Wordstar 6 on Windows 7 Using vdos Thanks to Dennis McCunney for helping me learn how to set vdos up. DISCLAIMER #1: As explained below, I am running Wordstar 6 for DOS on a Windows 7 (64- bit)

More information

Computer Basics: Step-by-Step Guide (Session 2)

Computer Basics: Step-by-Step Guide (Session 2) Table of Contents Computer Basics: Step-by-Step Guide (Session 2) ABOUT PROGRAMS AND OPERATING SYSTEMS... 2 THE WINDOWS 7 DESKTOP... 3 TWO WAYS TO OPEN A PROGRAM... 4 DESKTOP ICON... 4 START MENU... 5

More information

Get comfortable using computers

Get comfortable using computers Mouse A computer mouse lets us click buttons, pick options, highlight sections, access files and folders, move around your computer, and more. Think of it as your digital hand for operating a computer.

More information

QUICK EXCEL TUTORIAL. The Very Basics

QUICK EXCEL TUTORIAL. The Very Basics QUICK EXCEL TUTORIAL The Very Basics You Are Here. Titles & Column Headers Merging Cells Text Alignment When we work on spread sheets we often need to have a title and/or header clearly visible. Merge

More information

CS1114: Matlab Introduction

CS1114: Matlab Introduction CS1114: Matlab Introduction 1 Introduction The purpose of this introduction is to provide you a brief introduction to the features of Matlab that will be most relevant to your work in this course. Even

More information

D-Optimal Designs. Chapter 888. Introduction. D-Optimal Design Overview

D-Optimal Designs. Chapter 888. Introduction. D-Optimal Design Overview Chapter 888 Introduction This procedure generates D-optimal designs for multi-factor experiments with both quantitative and qualitative factors. The factors can have a mixed number of levels. For example,

More information

You will learn: The structure of the Stata interface How to open files in Stata How to modify variable and value labels How to manipulate variables

You will learn: The structure of the Stata interface How to open files in Stata How to modify variable and value labels How to manipulate variables Jennie Murack You will learn: The structure of the Stata interface How to open files in Stata How to modify variable and value labels How to manipulate variables How to conduct basic descriptive statistics

More information

SPSS Instructions and Guidelines PSCI 2300 Intro to Political Science Research Dr. Paul Hensel Last updated 10 March 2018

SPSS Instructions and Guidelines PSCI 2300 Intro to Political Science Research Dr. Paul Hensel Last updated 10 March 2018 SPSS Instructions and Guidelines PSCI 2300 Intro to Political Science Research Dr. Paul Hensel Last updated 10 March 2018 Table of Contents Introduction... 1 Accessing SPSS... 2 Possible Alternative: PSPP...

More information

T H E I N T E R A C T I V E S H E L L

T H E I N T E R A C T I V E S H E L L 3 T H E I N T E R A C T I V E S H E L L The Analytical Engine has no pretensions whatever to originate anything. It can do whatever we know how to order it to perform. Ada Lovelace, October 1842 Before

More information

SPREADSHEETS. (Data for this tutorial at

SPREADSHEETS. (Data for this tutorial at SPREADSHEETS (Data for this tutorial at www.peteraldhous.com/data) Spreadsheets are great tools for sorting, filtering and running calculations on tables of data. Journalists who know the basics can interview

More information

LOOPS. Repetition using the while statement

LOOPS. Repetition using the while statement 1 LOOPS Loops are an extremely useful feature in any programming language. They allow you to direct the computer to execute certain statements more than once. In Python, there are two kinds of loops: while

More information

Microsoft Office Excel Training

Microsoft Office Excel Training Region One ESC presents: Microsoft Office Excel Training Create your first workbook Course contents Overview: Where to begin? Lesson 1: Meet the workbook Lesson 2: Enter data Lesson 3: Edit data and revise

More information

TOPIC 2 INTRODUCTION TO JAVA AND DR JAVA

TOPIC 2 INTRODUCTION TO JAVA AND DR JAVA 1 TOPIC 2 INTRODUCTION TO JAVA AND DR JAVA Notes adapted from Introduction to Computing and Programming with Java: A Multimedia Approach by M. Guzdial and B. Ericson, and instructor materials prepared

More information

Name: Dr. Fritz Wilhelm Lab 1, Presentation of lab reports Page # 1 of 7 5/17/2012 Physics 120 Section: ####

Name: Dr. Fritz Wilhelm Lab 1, Presentation of lab reports Page # 1 of 7 5/17/2012 Physics 120 Section: #### Name: Dr. Fritz Wilhelm Lab 1, Presentation of lab reports Page # 1 of 7 Lab partners: Lab#1 Presentation of lab reports The first thing we do is to create page headers. In Word 2007 do the following:

More information

A Tutorial for Excel 2002 for Windows

A Tutorial for Excel 2002 for Windows INFORMATION SYSTEMS SERVICES Writing Formulae with Microsoft Excel 2002 A Tutorial for Excel 2002 for Windows AUTHOR: Information Systems Services DATE: August 2004 EDITION: 2.0 TUT 47 UNIVERSITY OF LEEDS

More information

Performing Basic Calculations

Performing Basic Calculations 7.1 LESSON 7 Performing Basic Calculations After completing this lesson, you will be able to: Build formulas. Copy formulas. Edit formulas. Use the SUM function and AutoSum. Use the Insert Function feature.

More information

In this chapter, I introduce you to Excel s statistical functions and data. Understanding Excel s Statistical Capabilities. Chapter 2.

In this chapter, I introduce you to Excel s statistical functions and data. Understanding Excel s Statistical Capabilities. Chapter 2. Chapter 2 Understanding Excel s Statistical Capabilities In This Chapter Working with worksheet functions Creating a shortcut to statistical functions Getting an array of results Naming arrays Tooling

More information

Lesson 1: Creating and formatting an Answers analysis

Lesson 1: Creating and formatting an Answers analysis Lesson 1: Creating and formatting an Answers analysis Answers is the ad-hoc query environment in the OBIEE suite. It is in Answers that you create and format analyses to help analyze business results.

More information

9. MATHEMATICIANS ARE FOND OF COLLECTIONS

9. MATHEMATICIANS ARE FOND OF COLLECTIONS get the complete book: http://wwwonemathematicalcatorg/getfulltextfullbookhtm 9 MATHEMATICIANS ARE FOND OF COLLECTIONS collections Collections are extremely important in life: when we group together objects

More information

Graphing on Excel. Open Excel (2013). The first screen you will see looks like this (it varies slightly, depending on the version):

Graphing on Excel. Open Excel (2013). The first screen you will see looks like this (it varies slightly, depending on the version): Graphing on Excel Open Excel (2013). The first screen you will see looks like this (it varies slightly, depending on the version): The first step is to organize your data in columns. Suppose you obtain

More information

Excel Forecasting Tools Review

Excel Forecasting Tools Review Excel Forecasting Tools Review Duke MBA Computer Preparation Excel Forecasting Tools Review Focus The focus of this assignment is on four Excel 2003 forecasting tools: The Data Table, the Scenario Manager,

More information

Introduction to Stata - Session 1

Introduction to Stata - Session 1 Introduction to Stata - Session 1 Simon, Hong based on Andrea Papini ECON 3150/4150, UiO January 15, 2018 1 / 33 Preparation Before we start Sit in teams of two Download the file auto.dta from the course

More information

Arduino IDE Friday, 26 October 2018

Arduino IDE Friday, 26 October 2018 Arduino IDE Friday, 26 October 2018 12:38 PM Looking Under The Hood Of The Arduino IDE FIND THE ARDUINO IDE DOWNLOAD First, jump on the internet with your favorite browser, and navigate to www.arduino.cc.

More information

FACULTY AND STAFF COMPUTER FOOTHILL-DE ANZA

FACULTY AND STAFF COMPUTER FOOTHILL-DE ANZA FACULTY AND STAFF COMPUTER TRAINING @ FOOTHILL-DE ANZA Office 2001 Excel Worksheets A Quick Reference Guide 1 Getting Started Excel is a powerful spreadsheet program. To open up a new Microsoft Excel 2001

More information

(Refer Slide Time 6:48)

(Refer Slide Time 6:48) Digital Circuits and Systems Prof. S. Srinivasan Department of Electrical Engineering Indian Institute of Technology Madras Lecture - 8 Karnaugh Map Minimization using Maxterms We have been taking about

More information

CS1114: Matlab Introduction

CS1114: Matlab Introduction CS1114: Matlab Introduction 1 Introduction The purpose of this introduction is to provide you a brief introduction to the features of Matlab that will be most relevant to your work in this course. Even

More information

INTRODUCTION TO MICROSOFT EXCEL: DATA ENTRY AND FORMULAS

INTRODUCTION TO MICROSOFT EXCEL: DATA ENTRY AND FORMULAS P a g e 1 INTRODUCTION TO MICROSOFT EXCEL: DATA ENTRY AND FORMULAS MARGERT E HEGGAN FREE PUBLIC LIBRARY SECTION ONE: WHAT IS MICROSOFT EXCEL MICROSOFT EXCEL is a SPREADSHEET program used for organizing

More information

Tips and Guidance for Analyzing Data. Executive Summary

Tips and Guidance for Analyzing Data. Executive Summary Tips and Guidance for Analyzing Data Executive Summary This document has information and suggestions about three things: 1) how to quickly do a preliminary analysis of time-series data; 2) key things to

More information

Course contents. Overview: Goodbye, calculator. Lesson 1: Get started. Lesson 2: Use cell references. Lesson 3: Simplify formulas by using functions

Course contents. Overview: Goodbye, calculator. Lesson 1: Get started. Lesson 2: Use cell references. Lesson 3: Simplify formulas by using functions Course contents Overview: Goodbye, calculator Lesson 1: Get started Lesson 2: Use cell references Lesson 3: Simplify formulas by using functions Overview: Goodbye, calculator Excel is great for working

More information

> printers > copiers > plotters. Print Audit 4 is the most powerful print management tool available.

> printers > copiers > plotters. Print Audit 4 is the most powerful print management tool available. > printers > copiers > plotters Print Audit 4 is the most powerful print management tool available. USER MANUAL Table of Contents WELCOME TO PRINT AUDIT 4!...1 WHAT'S NEW IN PRINT AUDIT 4?...1 New Features...

More information

Excel Shortcuts Increasing YOUR Productivity

Excel Shortcuts Increasing YOUR Productivity Excel Shortcuts Increasing YOUR Productivity CompuHELP Division of Tommy Harrington Enterprises, Inc. tommy@tommyharrington.com https://www.facebook.com/tommyharringtonextremeexcel Excel Shortcuts Increasing

More information

EDIT202 Spreadsheet Lab Prep Sheet

EDIT202 Spreadsheet Lab Prep Sheet EDIT202 Spreadsheet Lab Prep Sheet While it is clear to see how a spreadsheet may be used in a classroom to aid a teacher in marking (as your lab will clearly indicate), it should be noted that spreadsheets

More information

STATISTICAL TECHNIQUES. Interpreting Basic Statistical Values

STATISTICAL TECHNIQUES. Interpreting Basic Statistical Values STATISTICAL TECHNIQUES Interpreting Basic Statistical Values INTERPRETING BASIC STATISTICAL VALUES Sample representative How would one represent the average or typical piece of information from a given

More information

Designed by Jason Wagner, Course Web Programmer, Office of e-learning NOTE ABOUT CELL REFERENCES IN THIS DOCUMENT... 1

Designed by Jason Wagner, Course Web Programmer, Office of e-learning NOTE ABOUT CELL REFERENCES IN THIS DOCUMENT... 1 Excel Essentials Designed by Jason Wagner, Course Web Programmer, Office of e-learning NOTE ABOUT CELL REFERENCES IN THIS DOCUMENT... 1 FREQUENTLY USED KEYBOARD SHORTCUTS... 1 FORMATTING CELLS WITH PRESET

More information

Stata v 12 Illustration. First Session

Stata v 12 Illustration. First Session Launch Stata PC Users Stata v 12 Illustration Mac Users START > ALL PROGRAMS > Stata; or Double click on the Stata icon on your desktop APPLICATIONS > STATA folder > Stata; or Double click on the Stata

More information

Chapter 1 - What s in a program?

Chapter 1 - What s in a program? Chapter 1 - What s in a program? I. Student Learning Outcomes (SLOs) a. You should be able to use Input-Process-Output charts to define basic processes in a programming module. b. You should be able to

More information

GENERAL MATH FOR PASSING

GENERAL MATH FOR PASSING GENERAL MATH FOR PASSING Your math and problem solving skills will be a key element in achieving a passing score on your exam. It will be necessary to brush up on your math and problem solving skills.

More information

Introduction to STATA 6.0 ECONOMICS 626

Introduction to STATA 6.0 ECONOMICS 626 Introduction to STATA 6.0 ECONOMICS 626 Bill Evans Fall 2001 This handout gives a very brief introduction to STATA 6.0 on the Economics Department Network. In a few short years, STATA has become one of

More information

Introduction to Stata

Introduction to Stata Introduction to Stata Introduction In introductory biostatistics courses, you will use the Stata software to apply statistical concepts and practice analyses. Most of the commands you will need are available

More information

Using Custom Number Formats

Using Custom Number Formats APPENDIX B Using Custom Number Formats Although Excel provides a good variety of built-in number formats, you may find that none of these suits your needs. This appendix describes how to create custom

More information

USING DRUPAL. Hampshire College Website Editors Guide https://drupal.hampshire.edu

USING DRUPAL. Hampshire College Website Editors Guide https://drupal.hampshire.edu USING DRUPAL Hampshire College Website Editors Guide 2014 https://drupal.hampshire.edu Asha Kinney Hampshire College Information Technology - 2014 HOW TO GET HELP Your best bet is ALWAYS going to be to

More information

Excel Tips for Compensation Practitioners Weeks Data Validation and Protection

Excel Tips for Compensation Practitioners Weeks Data Validation and Protection Excel Tips for Compensation Practitioners Weeks 29-38 Data Validation and Protection Week 29 Data Validation and Protection One of the essential roles we need to perform as compensation practitioners is

More information

= 3 + (5*4) + (1/2)*(4/2)^2.

= 3 + (5*4) + (1/2)*(4/2)^2. Physics 100 Lab 1: Use of a Spreadsheet to Analyze Data by Kenneth Hahn and Michael Goggin In this lab you will learn how to enter data into a spreadsheet and to manipulate the data in meaningful ways.

More information

Formulas and Functions

Formulas and Functions Conventions used in this document: Keyboard keys that must be pressed will be shown as Enter or Ctrl. Controls to be activated with the mouse will be shown as Start button > Settings > System > About.

More information

STAT:5400 Computing in Statistics

STAT:5400 Computing in Statistics STAT:5400 Computing in Statistics Introduction to SAS Lecture 18 Oct 12, 2015 Kate Cowles 374 SH, 335-0727 kate-cowles@uiowaedu SAS SAS is the statistical software package most commonly used in business,

More information

using cells to create dynamic formulas

using cells to create dynamic formulas excel formulas A forumla is nothing more than an equation that you write up. In Excel a typical formula might contain cells, constants, and even functions. Here is an example Excel formula that we have

More information

DOING MORE WITH EXCEL: MICROSOFT OFFICE 2013

DOING MORE WITH EXCEL: MICROSOFT OFFICE 2013 DOING MORE WITH EXCEL: MICROSOFT OFFICE 2013 GETTING STARTED PAGE 02 Prerequisites What You Will Learn MORE TASKS IN MICROSOFT EXCEL PAGE 03 Cutting, Copying, and Pasting Data Basic Formulas Filling Data

More information