Assignment #1

Political Science 328

 

This assignment will be due in hard copy form in the department dropbox (outside 745 SWKT) AND uploaded on Learning Suite before 1:30 pm, Thursday, January 17. Turn in the assignment electronically on Learning Suite (separately for each part of the assignment), and on paper (in four separate documents) in the Political Science dropbox. Remember that no late assignments will be accepted.

Type your answers in a regular font (e.g. Times Roman 12). Display Stata .do files and .log files in Courier 8.

This assignment is divided into four parts. You must submit your answers to each part separately, as we will have a different TA grade each part. Make sure that your name, section number as well as the problem set and part number (e.g. Assignment 1, Part 1) are clearly listed on each part. Students who fail to do so may be penalized on the assignment.

If necessary, re-read the section in the syllabus on group work in Academic Honesty and Plagiarism (here) to make sure you are giving proper credit to those you work with and/or the text(s) you use for each problem. For each problem state with whom you worked. If you did not work with anyone, state so explicitly. As a reminder, you are in violation of this course's policies as well as the Honor Code if you are sharing electronic portions of your assignment with other people. That includes emailing other people code (even snippets of code), .do files, .word files, or anything else related to a problem set. Your assignment must represent your own work. Please work together: we encourage you to do so! But remember that when working together you should produce your own independent work product.

Solve the following problems. Show all of your work, but keep your answers concise. Include a copy of your input and output: your .do file and your .log file. However, do not include unnecessary output (i.e. no data dumps), and format any output so that it is easily readable. Convert Stata output (.log and .do files) to Courier 8 with single-spacing. For the third part, showing your work would include steps such as stating the equation you are using, where you got the equation, and the steps you took to obtain your answer. Explanation includes statistical and substantive explanation (explain so that a statistical layperson can understand it, and so that a statistical analyst will see your erudition). Highlight your answer.

  1. {25 points} Stata basics.

    1. What is a .do file used for? How do you create it? What does it mean to "run" a .do file? Create a .do file.

    2. Explain what the different colors of text mean in a .do file.

    3. What is a log file used for? How do you begin and end a log file? Create a .log file (in the .do file).

    4. What is the most important difference between a .do file and a log file?

    5. With a log file open, open the data editor and manually enter data into the first two columns. Enter the number 1-9 in the cells of column 1 and the numbers 10-18 in the cells of column 2. (Note: We can see you enter these by looking at your log file.)

    6. Note the difference between the data editor and the browser and how to toggle back and forth. What are the two different modes?

    7. Clear the data from your Stata center. (Put the command you use into your .do file.)

    8. Online, go to http://wps.pearsoned.com/aw_stock_ie_3/178/45691/11696965.cw/index.html. On the left of the page, click on "Data for Empirical Exercises and Test Bank". Click on "Data for Empirical Exercises and Test Bank (Updated Edition)". Download the Guns Data (Stata Dataset); that is, save the file to your computer. Open this dataset in Stata. Using that dataset, answer the following questions.

    9. How many observations are in this dataset? (Again, put the command you use into your .do file. Continue to do this in the subsequent questions.)

    10. Explain what the variable incarc_rate means? There are two ways to get this information. State the command that gives you this information (and put it in your .do file as well), and describe the other location where you can find it.

    11. In the data editor, reorder the variables so that stateid and year are the first and second variables, respectively, and the rest of the variables follow in any order. There are two ways to accomplish this. Write the command you can use (and put it in your .do file). Also describe how to manually order the variables.

    12. Sort the data by stateid and year (and put the command in your .do file). Open your data browser: how has the data changed? How is it now ordered?

    13. Describe how to find the mean of violent crime rates using the command and the drop-down menus. What is the command you would use. (Put this in your .do file.) What are the (list of) menus in the order that you would click to find this information?

    14. What is the average violent crime rate in state 1? (Include the command you used in your .do file.) [Hint: Remember to use a condition in your command.]

    15. The variable shall is coded 1 if the state has a law allowing citizens to carry concealed weapons in that year and 0 if the state does not have this law. In 1993, what percentage of states had a shall carry law? (Once again, place the command in your .do file. And remember to think of conditional commands.)

    16. The variable pw1064 is the percent of the state population that is white, ages 10 to 64. Place a new name and label on this variable so any person viewing your dataset will know what this variable is. There are two ways of renaming and relabeling. Please provide the two commands below, and explain the process by which you would manually change this information.

    17. Give proper credit below to those you worked with and/or any texts. If you worked alone, state that explicitly.

    18. Remember to close your log (and place the command that closes your log in the .do file). Remember to include your .do file and .log file along with your answers. This is often done by cutting and pasting the file into a Word document (and changing the font to Courier 8).

  2. {25}
  3. {30}
  4. {20} Data Analysis: Yale University political scientists Daniel Butler and David Broockman have recently published an article, "Do Politicians Racially Discriminate against Constituents? A Field Experiment on State Legislators." Their research consisted of sending a fictitious e-mail message to approximately 4,800 state legislators with a request for assistance in registering to vote. Some of the messages were sent using an apparently white name (Jake Mueller) and some under a stereotypical black name (DeShawn Jackson). They then waited to see whether or not legislators responded to these emails. They were interested in not only whether or not the different names (Jake vs. DeShawn) affected whether or not legislators responded, but also whether or not the party and ethnicity of the legislator also had an effect.

    Download the replication dataset from Learning Suite (Butler_Broockman.dta). Record your answers to the following questions in a .log and .do file in STATA. (Remember to turn in both the .log file and the .do file for this portion of the assignment.)

    a. Look at your data! After reading the rest of the problem, visualize your data for variables used below with tools learned in class and lab (and the earlier .do file). Include the graphics and/or tables you use in your answer.

    b. Using Stata, how many legislators received the DeShawn treatment condition?

    c. How many legislators received the Jake treatment condition?

    d. What is the overall probability that a legislator responded to an email?

    e. What is the probability that a legislator responded to an email, conditional on that legislator receiving an email from DeShawn?

    f. What is the probability that a legislator responded to an email, conditional on that legislator receiving an email from Jake?

    g. What is the probability that a legislator responded to an email, conditional on that legislator being a Democrat and receiving an email from DeShawn?

    h. What is the probability that a legislator responded to an email, conditional on that legislator being a Republican and receiving an email from DeShawn?