SOCY 3115
Spring 2020
PEMDAS QUESETIONS
1. Use PEMDAS to evaluate these expressions:
a. 4 + 6*4 =
b. (4+6)*4 =
c. 42 + 6 =
d. (4+6)2 =
e.
2. Assume we have three variables with 5 observations each.
Id x y z
1 10 2 8
2 4 5 5
3 9 12 11
4 0 2 2
5 6 5 4
Use PEMDAS with Summation Signs to evaluate these expressions:
a. ?x =
b. ?y =
c. ?z =
d. ?x + ?z =
e. (?y)2
f. ?y2
g. (?z)2 + ?x2
Questions from First Video
Use GSS2016.dta
1. Use the summarize command on the variable age. Cut-n-paste the command and results/output here:
2. How many respondents have valid answers for age?
3. What is the mean age of the respondents?
4. Use the summarize command on the variable educ (highest year of education completed. Cut-n-paste the command and results/output here:
5. How many respondents have valid answers for educ?
6. What is the mean number of years of education completed?
Use GSS2016.dta
7. Find the variable hompop in the variables section (upper right) and read its description. Use the summarize command on hompop and cut-n-paste the command and output here:
8. Answer the following questions.
a. What do you think was the survey question that produced the variable hompop?
b. How many people answered this question?
c. What is the mean size of household in the US?
9. Use the generate and replace commands to create a new variable called hhsize5. This new variable should = 1 if the persons household size is 5 or more and should =0 if the persons household size is 1-4.
a. Copy the commands here that you used to create this new variable:
b. Use the summarize command on hhsize5 and cut-n-paste the output here:
c. What percent of people live in households with 5 or more people?
Questions of from Second Video
Use GSS2016.dta
1. Use tabulate on the variable called race. Cut-n-paste the command and results/output here:
2. Answer these questions:
a. How many of the respondents had valid answers for this question?
b. What percent of the respondents are black?
3. Use tabulate with the nolabel option on the variable called race (hint: tabulate race, nolabel). Cut-n-paste the command and results/output here:
4. Answer these questions:
a. What is the numeric code associated with the label white
b. What is the numeric code associated with the label black
c. What is the numeric code associated with the label other
5. Use tabulate on the variable called abany. Cut-n-paste the command and results/output here:
6. Answer these questions:
a. How many of the respondents had valid answers for this question?
b. What percent think women should be able to have abortions for any reason?
7. Use tabulate with the nolabel option on the variable called abany (hint: tabulate abany, nolabel). Cut-n-paste the command and results/output here:
8. Indicate the numeric codes for the value labels for the variable abany.
Use WVSWave6.dta
9. Open WVSWave6.dta. V197 represents answers to the question, Do you think science and technology are making the world better or worse. The scale is 1-10 with 1 worse off and 10 better off. Use the tabulate command to generate a frequency table for the variable called V197. Cut-n-paste the command and output here:
10. Now use the tabulate command with the option of nolabel to generate a table for the variable called V197. Cut-n-paste the command and output here:
11. What numeric code corresponds to the label No answer?
12. We want to create a new binary variable called betteroff that =1 if respondent has 6,7,8, 9, or 10 for V197. The first step is to use the generate command to create a new variable called betteroff that is exactly equal to V197. Copy the entire command you used here:
13. We want the observations for respondents who didnt answer the question to be dots, not numbers. The dots indicate missing data. Use the recode command on betteroff to change the values of -5, -2, and -1 to be dots. Here is the code: recode betteroff (-5/-1 = .) Cut-n-paste the code and output here:
14. Now we want to make the binary part of the variable. Use the recode command on betteroff to change the values of 1 5 to be 0 and the values 6-10 to be 1. Cut-n-paste the code and output here:
15. Use tabulate on betteroff. Cut-n-paste the code and output here:
16. According to the frequency table, what percent of respondents think we are better off with technology?