Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help understanding how to perform this in Stata. Stata Code would be very helpful! Problem I. Bivariate linear regression. In this question we

I need help understanding how to perform this in Stata. Stata Code would be very helpful!

image text in transcribed

Problem I. Bivariate linear regression. In this question we create a synthetic dataset using random number generation commands in Stata. This time we create two random variables that are related to one another, and we fit that relationship using a bivariate linear regression. The beauty of this approach is that we know the population parameters because we pick them when generating the data. We can then check to see how well least squares estimation performs a) Begin by specifying that there are 100 observations and generate the regressor to be: r 10 20 * v where v is a uniform random variable on the unit interval. As a result ar is a random variable uniformly distributed on the interval [10, 30]. Next specify the dependent variable to be linearly related to this regressor according to: y-30+5*x+u, where u is a random draw from a normal distribution with population mean 0 and population standard deviation 100. Hint: use Stata's random number commands runiform) and rnormal (0,100). (b) Perform a scatter plot of r and y, and also insert a linear fit. Hint: use Stata's twoway command to create a scatter graph and overlay a linear fit using the lfit graph c) Next regress y on x (calling for robust standard errors). Is each one of the three OLSE assumptions satisfied in this case? Explain why for each one. Give your assessment of how well least squares regression performs in estimating the true intercept and slope (d) Looking at the results of this regression, assess how close least squares estimation is to the true variance of the error term (e) Generate the regression residuals and confirm they add up to zero. Also, confirm that the residuals are uncorrelated with the regressor. (f) Now generate the variables r and y as you did above but do it for n 1000 observations Run the regression of y on r and compare the results with the earlier case of n 100 Explain the differences, if you can Problem I. Bivariate linear regression. In this question we create a synthetic dataset using random number generation commands in Stata. This time we create two random variables that are related to one another, and we fit that relationship using a bivariate linear regression. The beauty of this approach is that we know the population parameters because we pick them when generating the data. We can then check to see how well least squares estimation performs a) Begin by specifying that there are 100 observations and generate the regressor to be: r 10 20 * v where v is a uniform random variable on the unit interval. As a result ar is a random variable uniformly distributed on the interval [10, 30]. Next specify the dependent variable to be linearly related to this regressor according to: y-30+5*x+u, where u is a random draw from a normal distribution with population mean 0 and population standard deviation 100. Hint: use Stata's random number commands runiform) and rnormal (0,100). (b) Perform a scatter plot of r and y, and also insert a linear fit. Hint: use Stata's twoway command to create a scatter graph and overlay a linear fit using the lfit graph c) Next regress y on x (calling for robust standard errors). Is each one of the three OLSE assumptions satisfied in this case? Explain why for each one. Give your assessment of how well least squares regression performs in estimating the true intercept and slope (d) Looking at the results of this regression, assess how close least squares estimation is to the true variance of the error term (e) Generate the regression residuals and confirm they add up to zero. Also, confirm that the residuals are uncorrelated with the regressor. (f) Now generate the variables r and y as you did above but do it for n 1000 observations Run the regression of y on r and compare the results with the earlier case of n 100 Explain the differences, if you can

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions