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

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

expert
Anuja SharmaPsychology
(5/5)

976 Answers

Hire Me
expert
Bryan CoxxEconomics
(5/5)

635 Answers

Hire Me
expert
Ata WhbaLaw
(5/5)

971 Answers

Hire Me
expert
Peck KellerTechnical writing
(5/5)

857 Answers

Hire Me
STATA
(5/5)

Use the combined graph command above to generate a scatter plot of maternal height on the x-axis

INSTRUCTIONS TO CANDIDATES
ANSWER ALL QUESTIONS

Quantitative Analysis for International Affairs

Problem Set 3

General Instructions for Problem Sets

Please conduct and document all of your work using a Stata .do ("DO-file) file. You can open a new .do file with Ctrl-9 on a PC and CMD-N on a Mac.

Submitting Your Assignment

Please email your assignment to the IR602 e-mail account at ir602.2021@gmail.com. You do not need to submit any additional write-up, unless you would like further feedback.

Problem 1: Derivation of OLS

a. Open Stata, and generate a data set with 100 observations containing the following variables:

1. height_mother: a random variable with mean 165 cm and standard deviation 10 cm.

2. noise: a normal random variable with mean 5 cm and standard deviation 10 cm.

Remember to set the seed of the dataset before generating the variables above. Set the seed of the dataset to 6023.

Give proper labels to each of the variables. Summarize the variables (provide the mean, standard deviation, minimum, and maximum for each variable), and generate histograms for each of the variables.

b. Generate the height of the child (variable “child height”), β„Žπ‘ , variable which is given by the true relationship defined below:

𝒉𝒄 = 10 + 0.5 ⋅ π’‰π’Ž + π—Œπ’„

where β„Žπ‘š is the height of the mother and πœ€π‘ is the noise term. Summarize this new variable and generate the histogram to show the distribution of child height. What is the mean child height that you obtain?

c. The scatter command in Stata is used to generate a scatter plot for a set of data points in Stata, and the lfit command in Stata can be used to plot the line of best fit for the set of points. These two commands can be combined into a single command on the same graph as follows:

graph twoway (scatter y x)(lfit y x)

where y is the dependent variable and x is the independent variable.

Use the combined graph command above to generate a scatter plot of maternal height on the x-axis and child height on the y-axis and the line of best fit for the data.

d. We will now estimate the slope of the line of best fit that you have drawn in part c, denoted 𝛽-1: 

The egen command in Stata is very useful for generating special functions and extensions of variables that go beyond just the standard gen command. One of the functions that we can use with the egen command is the mean function, which is as follows:

egen y = mean(x)

which generates a new variable y that takes on the average of all of the individual 𝑖 values in the variable x, i.e. 

𝑦 = π‘₯Μ… = 1

𝑁 

𝑁

5 π‘₯6

681 

a. Use the egen and mean syntax above to generate :β„Ž:π‘š:: and :β„Ž::𝑐, which are variables of the mean of the mother’s height and child’s height, respectively.

b. Use the gen command to generate a variable that takes the difference of each individual mother’s height :β„Ž:π‘š:::,=  and β„Ž::𝑐::,=, i.e. β„Žπ‘š,6 - :β„Ž::π‘š:.

c. Use the gen command to generate a variable that takes the difference of each individual child’s height, β„Žπ‘,6  and :β„Ž::𝑐, i.e. β„Žπ‘,6  - β„Ž:::𝑐.

d. Use the gen command to generate a variable that is the square of β„Žπ‘š,6 - β„Ž:::π‘š: from (ii),

i.e. (β„Žπ‘š,6  −  β„Ž:::π‘š:)A.

e. Use the gen command to generate a variable that is the product of β„Žπ‘š,6  - β„Ž:::π‘š: from (ii), 

and β„Žπ‘,6  - :β„Ž::𝑐  from (iii), i.e. (β„Žπ‘,6  −:β„Ž::𝑐) (β„Žπ‘š,6  − :β„Ž::π‘š:).

Another function that we can use with the egen command is the sum function, as follows:

egen y = sum(x)

which generates a new variable y that is the sum of all of the values in the variable x, i.e.

𝑁

𝑦 = 5 π‘₯6

681 

f. Using the egen and sum commands in Stata, generate the sum of the (β„Žπ‘š,6 −

variable from (iv), i.e. 

:β„Ž::π‘š:)A1BB

5(β„Žπ‘š,6  −681 :β„Ž::π‘š:)A 

g. Using the egen and sum commands in Stata, generate the sum of the 

(β„Žπ‘,6 −:β„Ž::𝑐) (β„Žπ‘š,6  − :β„Ž:π‘š::) variable from (v), i.e. 1BB 

5(β„Žπ‘,6  −  :β„Ž::𝑐)(β„Žπ‘š,6  −681 :β„Ž::π‘š:)

h. Generate the variable  𝛽-1, which is the ratio of (vii) and (vi) as follows:

𝛽-1  = 

∑1BB(β„Žπ‘,6  −  :β„Ž::𝑐)(β„Žπ‘š,6  − :β„Ž::π‘š:)

 ∑1BB(β„Žπ‘š,6 − :β„Ž::π‘š:)A

e. Summarize the variable  𝛽-1, which is your estimate for the slope of the line that you drew in part c. What is its mean? How does your mean compare to the true value of the relationship between mother’s height and child height from part b. above? 

f. We will now estimate the intercept of the line of best fit that you have drawn in part c, denoted π‘ŽE. Using the variables that you have generated in the previous sections, generate π‘ŽE as follows: 

π‘ŽE  = :β„Ž::𝑐  −  𝛽-1  βˆ™ 

:β„Ž::π‘š: 

Summarize the variable π‘ŽE, which is your estimate for the intercept of the line that you drew in part c. What is its mean? How does this estimate of π‘ŽE compare with the true value of the constant in the relationship from part b. above?

g. The Stata command reg runs the OLS regression of variable y on variable x as follows:

reg y x

Run the OLS regression of child height β„Žπ‘ on maternal height β„Žπ‘š. What is the value of the coefficient that you obtain on maternal height? What is the value of the constant? How do these values compare to the estimates of the slope and intercept that you calculated in parts e. and f. above?

h. Provide an interpretation for this estimate 𝛽-1.

i. Provide an interpretation for the estimated constant  π‘ŽE.

Problem 2: The Effect of Smoking on Health

A researcher is interested in estimating the effect that the number of cups of coffee that a pregnant mother drinks has on her baby’s health. A common measure of a child’s health and birth is her weight. The researcher decides to estimate the following regression:

π‘Š6 = π‘Ž + 𝛽𝐢6 + πœ€6

where:

π‘Š6 : the weight at birth of mother i’s baby (in ounces)

𝐢6: the daily number of cups of coffee drunk by mother i during the pregnancy πœ€6: the error term

a. Would you expect the estimate of π‘Ž to be positive or negative? What does π‘Ž represent?

b. Would you expect the estimate of 𝛽 to be positive or negative? What does 𝛽 represent?

c. Give an interpretation of πœ€6. Give examples of 3 factors that may end up in πœ€6.

d. Suppose the following estimates are obtained from a sample of 1,388 births:

π‘ŠJ6  = 119.77 − 0.514𝐢6

To obtain a predicted birth weight of 125 ounces, what would 𝐢6 have to be? Is this value of 𝐢6 sensible? Why or why not?

(5/5)
Attachments:

Expert's Answer

625 Times Downloaded

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