﻿ Homework代写 exercise代写 bivariate regression model代写 calculate代写

# Homework代写 exercise代写 bivariate regression model代写 calculate代写

2020-09-23 16:19 星期三 所属： 作业代写 浏览：7 ## Homework 2 (due Thursday 2-22-2018)

Homework代写 For this exercise, you will take five data points and calculate the coefficients of the bivariate regression model by hand.

### 1.Theoretical Homework代写

For this exercise, you will take five data points and calculate the coefficients of the bivariate regression model byhand. This is not something you would typically do, but by doing so, I hope the relevant concepts will become more concrete. You will complete this exercise using 5 data points (n = 5) which are combinations of values of a Y variable and an X variable as indicated: Homework代写

 i Y X 1 2 0 2 4 0 3 3 1 4 5Homework代写 1 5 7 1

So for instance: Y1 = 2 and X1 = 0. If it helps, I had in mind the idea that Y indicates the number of college applications sent and X is an indicator (dummy) variable for female. There are a few pieces to this problem outlined below:

a)Use the formulas for the bivariate regression coefficients to calculate the coefficients α and β in the regression model:

𝑌𝑖 = 𝛼 − 𝛽𝑋𝑖 + 𝑒i

##### The basic formulas are:

and:

𝛼 = 𝐸[𝑌𝑖] − 𝛽𝐸[𝑋𝑖]

where you can find how to calculate the covariance, variance, and expectation in any resource about statistics.

b)Find the difference in mean the mean value of 𝑌𝑖 for individuals with 𝑋i = 1 instead of 𝑋i = 0. This should be the same as your coefficient β.

c)Copy the table above and extend it by including columns for the fitted value of 𝑌𝑖 and the resulting residual for 𝑌𝑖, and residual squared for 𝑌𝑖 as well as three additional columns described below.Homework代写

d)Calculate the residual and the residual squared for each observation based on a value of β either one greater than or 1 less than the value of β you calculated. (If you found β = 8 then calculate the fitted values, resiudals, and resiudals squared based on β= 7 or β = 9). Verify that the sum of squared residuals from the correct β is less than the sum of squared residuals from this incorrectβ.

### 2. and 3. ProgrammingQuestions Homework代写

2) You will be doing an exercise that builds on the 1-8 and 2-15 labs. Specifically, you need to analyze a dataset containing information about U.S. States. You will analyze summary statistics, create graphs, break the observations into groups, and run t-tests.Homework代写

Program the following steps in R. Then, copy your commands into a document, comment on them (using #) and submit the document as the answer to question 2. Please email my TA the code (document with commands) at [email protected] with the phrase “ECON 4850 HW 2” in the subject heading.

Dataset notes: This is a dataset about the 50 U.S. states in the 1970’s. A description of the dataset was in homework 1.

#### Instructions: Homework代写

A.Place or find the folder you have been using for this class on the computer. Create a new subfoldercalled “HW 2”.

B.Change the project to the folder you just

C.The dataset we are going to use x77 should be on your computer. But, make your own copy of the dataset using the followingcommand:

myState2 <- as.data.frame(state.x77) Homework代写

Normally we wouldn’t need the as.data.frame part, but this dataset is weird.

D.Make a dummy variable called “BigState” that indicates if a state has more than 2,500,000 (Remember that Population is measured in1,000’s.)Homework代写

E.Create a new dataframe “myState3” that contains both myState2 and the new BigState

F.Look at the summary statistics for the new

G.Use the cov command to find the covariance between Income and

H.Use the var command to find the variance ofBigState Homework代写

I.Run a bivariate regression with Income determined by BigState: Specification1:

𝐼𝑛𝑐𝑜𝑚𝑒𝑖 = 𝛼 + 𝛽1𝐵𝑖𝑔𝑆𝑡𝑎𝑡𝑒𝑖 + 𝑒i

J.Verify that the coefficient from this regression is the same as the ratio of the covariance between Income and BigState to the variance of

K.Create a variable called Density that contains the ratio of Population to

L.Add the Density variable to the myState3 Homework代写

M.Run the following regression specification:

Specification 2:

𝐼𝑛𝑐𝑜𝑚𝑒𝑖 = 𝛼 + 𝛽1𝐼𝑙𝑙𝑖𝑡𝑒𝑟𝑎𝑐𝑦𝑖 + 𝛽2𝐷𝑒𝑛𝑠𝑖𝑡𝑦 + 𝑒i

N.Run a finalregression:

𝐼𝑛𝑐𝑜𝑚𝑒𝑖 = 𝛼 + 𝛽1𝐼𝑙𝑙𝑖𝑡𝑒𝑟𝑎𝑐𝑦𝑖 + 𝛽2𝐷𝑒𝑛𝑠𝑖𝑡𝑦 + 𝛽3𝑀𝑢𝑟𝑑𝑒𝑟𝑖 + ei

Specification 3:

O.Submit a printed version of your code with comments along with the answers to questions 1 and 3. Email your code to the TA at [email protected] with “ECON 4850 HW 2” in the subject

ⅰHow many observations do youhave?

ⅱHow many variables are in thedataset?

ⅲFind the mean and standard deviation for BigState andIncome

b.Specification1:

ⅰAssuming the regression in specification 1 is correctly specified, what is the interpretation of the coefficient on BigState? Give a reason why you might have guessed this coefficient would be positive. Give a reason why you might have guessed this coefficient wouldbe

ⅱWas the result statistically significant? How do we knowthis?Homework代写

ⅲVerify (by showing your work) that the coefficient on BigState can be calculated as shown on the bottom of page 86 of the “Mastering Metrics” text (or the formula for Beta shown in Problem

c.Specification2:

ⅰAssuming the regression in specification 2 is correctly specified, what is the interpretation of the coefficient on Density?

ⅱWas the effect of Density statistically significant? How do we knowthis?

ⅲAssuming the regression in specification 2 is correctly specified, what is the interpretation of the coefficient on Illiteracy?Homework代写

d.Specification3:

ⅰAssuming the regression with independent variables in specification 3 is correctly specified, what is the interpretation of the coefficient on Density? Explain why the coefficient might have changed (relative to specification2).

ⅱWas the effect of Density statistically significant? How do we knowthis? 