logo Hurry, Grab up to 30% discount on the entire course
Order Now logo

Ask This Question To Be Solved By Our ExpertsGet A+ Grade Solution Guaranteed

expert
Writer CenterAccounting
(5/5)

551 Answers

Hire Me
expert
Hunter EdwardsEnglish
(5/5)

667 Answers

Hire Me
expert
StatAnalytica ExpertAccounting
(5/5)

904 Answers

Hire Me
expert
Taimoor KhanFinance
(4/5)

939 Answers

Hire Me
STATA
(5/5)

you will re-label variables and create some new variables which will be used later.

INSTRUCTIONS TO CANDIDATES
ANSWER ALL QUESTIONS

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.)

4. This exercise refers to the following model:

wagei = β0 + β1gradei + ui,

where the wage of individual i is regressed on his/her highest grade completed and a constant term. You are asked to compute the intercept and slope estimates in a variety of ways, and compare your results in each case. First, use the commandkeep if !missing(wage, grade)

to drop people with missing wage or grade from the dataset. How many observations were dropped?

(a) Use the regress command to estimate the OLS coefficients βˆ0 and βˆ1. What is the value of βˆ0? What is the value of βˆ1? (Hint: type regress wage grade, the constant term will be added automatically to the regression.)

(b) You are now asked to compute the same estimates using the formulas we derived in the lecture. Adopt the following procedure:

Compute the sample covariance between wage and grade, and the sample variance of grade, and save them in two scalars, cov wg and var g. (Hint: you can compute the variance-covariance matrix using the corr command, with the option covariance. For instance, if you type corr wage grade, covariance, the output will be a matrix containing the variance of wage, the variance of grade and the covariance between wage and grade; the three values will be stored in r(Var 1), r(Var 2) and r(cov 12), respectively. You can check the list of stored objects by typing return list just after running the corr command.)

• Generate the scalar beta 1 equal to cov wg/var g and display it by typing display beta 1. What is the relation between this estimate for β1 and the one in 4(a)?

• Create two scalars, grade mean and wage mean, equal to the sample means of grade and wage.

• compute your estimate for β0 by typing scalar beta 0 = wage mean - beta 1 * grade mean, and then display beta 0. What is the relation between this estimate for β0 and the one in 4(a)?

(c) Finally, you can compute βˆ1 using a “centered” regression. For this part, Adopt the following procedure:

Define a new variable, wage 0 as wage - wage mean, so that this new variable has a sample mean of 0. Similarly, define grade 0 as grade - grade mean. This is called “demeaning” or “centering” a variable.

Regress the centered variable, wage 0, on the other centered variable, grade 0. What are the intercept and slope estimates in this new regression?

(5/5)
Attachments:

Related Questions

. The fundamental operations of create, read, update, and delete (CRUD) in either Python or Java

CS 340 Milestone One Guidelines and Rubric  Overview: For this assignment, you will implement the fundamental operations of create, read, update,

. Develop a program to emulate a purchase transaction at a retail store. This  program will have two classes, a LineItem class and a Transaction class

Retail Transaction Programming Project  Project Requirements:  Develop a program to emulate a purchase transaction at a retail store. This

. The following program contains five errors. Identify the errors and fix them

7COM1028   Secure Systems Programming   Referral Coursework: Secure

. Accepts the following from a user: Item Name Item Quantity Item Price Allows the user to create a file to store the sales receipt contents

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

. The final project will encompass developing a web service using a software stack and implementing an industry-standard interface. Regardless of whether you choose to pursue application development goals as a pure developer or as a software engineer

CS 340 Final Project Guidelines and Rubric  Overview The final project will encompass developing a web service using a software stack and impleme