1. In this exercise you will re-label variables and create some new variables which will be used later.
(a) Re-label the variable smsa to “lives in urban area” so that it is more informative. Note that SMSA stands for “standard metropolitan statistical area.”
(b) Re-name the variable smsa to urban.
(c) Generate a new variable called wageofc taking the same values as the variable wage, so that we can modify the wage data without loosing the original variable.
(d) The minimum wage in 1988 was $3.35 an hour. Let’s say our fictional bosses at the Bureau of Labor Statistics will be mad if they see evidence of minimum wage law violations in the dataset. Re-classify those earning below minimum wage as “volunteers.” To be more specific, In wageofc, replace wageofc with 0 for workers that earned strictly less than $3.35 an hour. Note that we often find evidence of statutes not being followed in datasets.
(e) How many observations are in this dataset?
(f) How many non-missing observations are in wageofc?
(g) Generate a variable called lnwageofc which is the natural logarithm of wageofc.
(h) How many non-missing observations are in lnwageofc? Why does this make sense?
2. In this exercise, you are asked to compute some simple summary statistics using the binary variable collgrad, contained in the dataset.
(a) Use the command tabulate to show the categories of the variable collgrad and their frequencies. What is the relative frequency of the category college grad ? Please report a number between 0 and 1.
(b) Use the same command, this time specifying the option nolabel, to visualize the numeric values corresponding to the different categories of collgrad. Which numeric value corresponds to the label college grad ?
(c) Use the command summarize to compute the sample mean of collgrad. After executing summarize, Stata stores temporarily the sample mean in the object r(mean). To see this, generate a scalar variable collgrad mean equal to r(mean), by typing scalar collgrad mean = r(mean) in the line just after the command summarize. Finally, display the variable value by typing display collgrad mean, and verify that the value displayed is the same as the one returned by the command summarize. What is the sample mean of collgrad? What is its relation to your answer in 2(a)?
(d) Repeat the steps of 2(c), this time to create a scalar variable, collgrad var, containing the sample variance of collgrad. What is the sample variance of collgrad?
(e) Compute the sample variance of collgrad without the summarize command, using only the variable collgrad mean. (Hint: you can think of collgrad as drawn from a Bernoulli distribution with parameter p, where p is the proba- bility of having graduated from college. The (population) variance of a Bernoulli is p(1 p). What is the relation between p and the sample mean collgrad mean? Finally, remember that the sample variance can be obtained starting from the formula of the population variance by replacing the population mean with the sample mean.)
3. The following problems provide more practice using conditional statements to tabulate and summarize variables.
(a) How many unmarried people in the dataset were married before? (Hint: use the variables, married and never married.)
(b) What is the difference in average hours worked for married and unmarried workers? Please report a positive number. (Hint: use the variables married and hours.)
(c) What is the average hours worked for married college graduates with strictly more than 10 years of experience? (Hint: use the variables married, collgrad, ttl exp, and hours.)
(d) What fraction of laborers or craftsman that live in urban areas are black? Please report a number between 0 and
1. (Hint: use the variables occupation, urban, and race.)
(e) Using the variable wageofc, what fraction of workers that earn strictly more than $7 an hour are in a union? Please report a number between 0 and 1. (Be careful about missing values.)
(f) Using the variable lnwageofc, what fraction of workers that earn strictly more than $7 an hour are in a union? Please report a number between 0 and 1. (That is, you should compare the variable, lnwageofc, to ln 7. Be even more careful about missing values.)
CS 340 Milestone One Guidelines and Rubric Overview: For this assignment, you will implement the fundamental operations of create, read, update,
Retail Transaction Programming Project Project Requirements: Develop a program to emulate a purchase transaction at a retail store. This
7COM1028 Secure Systems Programming Referral Coursework: Secure
Create a GUI program that:Accepts the following from a user:Item NameItem QuantityItem PriceAllows the user to create a file to store the sales receip
CS 340 Final Project Guidelines and Rubric Overview The final project will encompass developing a web service using a software stack and impleme