Written Assignment 3
Submit your answer through Canvas.
In this assignment, you are supposed to work with the survey data from the SOM institute at University of Gothenburg. Use the Stata commands and the instructions in the document that was provided for the first Stata Workshop, available through Canvas (Stata_Workshop1.pdf).
The data set that you are supposed to use is available on Canvas, and is the same data set we used in the Stata Workshop. Download the Stata data file “WA3_SOMdata.dta” and save it to your working directory. It is helpful to create a do-file for your commands but you should not attach the do-file with your submitted answers on Canvas.
Once the data are imported, keep the following variables: year, trust_polit, like_party, female, yearofbirth, rural, edu3. Also, keep only surveys from 2010 and onward.
1. In this question, you are supposed to use Stata to compute some descriptive statistics (see Stata_Workshop1.pdf, page 3). Think about which measures of central tendency and measure of dispersion makes sense to compute for each variable, given their scales of measurement. Compute one measure of central tendency and, if possible, one measure of dispersion for each of the following six variables: trust_polit, female, rural, edu3, yearofbirth, like_party.1 What do these measures tell us about these variables?
2. Create the following variables using the existing variables in the data set: A) a measures of the respondents’ age at the time of their participation in the survey (the year of the survey minus their year of birth); B) an indicator of higher education (post high school); and two variables indicating respondents’ party preferences, one for the Sweden Democrats, and one for the Green Party. The indicator variables should take the values 0 or 1.
3. In the next two questions you are supposed to compute conditional means.
a) Compute the share of party sympathizers for the Sweden Democrats and for the Green Party, respectively, among those who responded to the survey in 2018. Do these differ compared to their official vote share on the national level in the 2018 national election? If yes, then why do you think this is the case? Discuss briefly.
b) Compute average shares of Sweden Democrat and Green Party supporters, this time using all survey years (2010-2018), but separately for male and female respondents. Next, repeat the same procedure for urban vs. rural respondents. Do these averages differ? Briefly discuss your findings.
4. In this question, you are supposed to draw a random sample of your data. First, keep only observations from 2018. Next, save this subset of the data as a separate Stata data file.
Imagine that the whole population of voters are included in the data set. However, for some reason we do not have access to the full data on all voters. Instead, we have a survey of only 10% of the voters. Draw a random sample of 10% from your data using the command sample 10 and compute the average share of supporters for the Sweden Democrats and for the Green Party, respectively. Then construct 95% confidence intervals to test whether these estimates are statistically significantly different from the average share of support you computed in question 3 a).
5. Suppose we were able to retrieve a larger sample of 50% of the respondents. Load the data set again with the 2018 respondents but this time, randomly draw 50% of the sample and compute the average support for the Sweden Democrats and the Green Party, respectively. Are the estimates using 50% of the sample closer to the average votes shares in question 3a?
Footnotes
Under the menus Statistics > Summaries, tables and tests > Summary and descriptive statistics > Summary statistics and Statistics > Summaries, tables and tests > Frequency tables > One-way table you will find useful commands (and it will help you a lot if you go to the workshop!). For those with the Swedish version of Stata, it’s Statistik > Summeringar, tabeller och tester > Sammanfattande och beskrivande statistik > Sammanfattande statistik and Statistik > Summeringar, tabeller och tester > Sammanfattande och beskrivande statistik > Frekvenstabeller > Envägstabell.↩︎