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
Faith BrownnComputer science
(4/5)

636 Answers

Hire Me
expert
Bryce KimEnglish
(5/5)

936 Answers

Hire Me
expert
Jayant KumarFinance
(/5)

801 Answers

Hire Me
expert
Yusuf PathanStatistics
(5/5)

926 Answers

Hire Me
Python Programming

What is the effect of a one unit increase in LSAT score on the log of median salary?

INSTRUCTIONS TO CANDIDATES
ANSWER ALL QUESTIONS

SSID

1.1   Exercise 1: Single Regression

Please don’t forget to comment your code. Failure to do so will result in a loss of points.

Also, remember that all code that is required here (unless otherwise stated) can be found in the lecture Jupyter Notebooks or the coding notebooks from class.

Here are three models for the median starting salary of law school graduates in 1985.

 

log(salaryi) = b0 + b1 LSATi + ei

 (1) log(salaryi) = b0 + b1 LSATi + b2GPAi + ei 

(2) log(salaryi) = b0 + b1 LSATi + b2GPAi + b3log(costi) + b4ranki + ei 

 (3)Each observation i represents a school. The variables in the dataset are:

Variable   Description

  1. rank law school ranking

  2. salary median starting salary

  3. cost law school cost

  4. LSAT median LSAT score

  5. GPA median college GPA

  6. libvol volumes in lib., 1000s

  7. faculty of faculty

  8. age age of law sch., years

  9. clsize size of entering class

  10. north =1 if law sch in north

  11. south =1 if law sch in south

  12. east =1 if law sch in east

  13. west =1 if law sch in west

  14. studfac student-faculty ratio

  15. top10 =1 if ranked in top 10 

  1. In the code cell below, write the appropriate imports you will need for this question (we will need pandas, numpy and formula.api).  You  can do an abbreviated import if you wish (but the standard for pandas is pd, statsmodels.formula.api is smf, and numpy is np). Afterwards, load in the data from here:

https://raw.githubusercontent.com/lordflaron/ARE106data/master/lawsch85.csv

This can be done using the read_csv() function. Name this dataset raw_df. After loading in the data, show the first 10 observations in the output.

  1. Use the describe() method on raw_df to show a table of summary statistics for each variable in the dataset. How many observations do salary have? Write this in a print statement. (Hint: This is in the “count” row the summary table).

NameError Traceback (most recent call last)

<ipython-input-56-894b02c4d62f> in <module>

1 ## b. Put your answer in this cell.

----> 2 describe(raw_df)

3 print("raw_df")

NameError: name 'describe'    is not defined

  1. Since we’ll need a log-transformed version of salaryi for all our models, use assign() to create a new variable which is the log of salaryi. Name this new variable log_salary.

Hints:

Remember that assign is not an inplace operation!

Remember to use a lambda function in this case. To log a variable, you can use np.log()

Remember the syntax for assign(): my_df.assign(new_variable = expression)

After this we now need to also drop any observations that are missing. This isn’t actually how econometricians deal with missing data, but this is good enough for us for now.

You can do this by chaining the dropna() method after the assign() method.

Warning: Do not do dropna BEFORE assign

The end result should look something like this:

df = raw_df.assign(log_salary= expression).dropna()

[3]:

 

  1. Before estimating the model, explain how to interpret b1 in Model

Please write your answer for d here. If you need to use more than one line, you may do so.

 Before estimating the model, explain how to interpret b1 in Model

Please write your answer for e here. If you need to use more than one line, you may do so.

 Before estimating the model, do you expect b1 and b2 to be positive or negative in Model 2? Explain. (Hint: I’m not asking for any rigorous mathematical way to answer this question. Just use your economic intuition and reasoning skills to write an argument).

Please write your answer for f here. If you need to use more than one line, you may do so.

  1. Estimate Model 1. Show the regression

  2. What is the effect of a one unit increase in LSAT score on the log of median salary?

Please write your answer for h here. If you need to use more than one line, you may do so.

  1. What does the R2 measure in the regression? What is the R2 in this case? (Not the adjusted

R2).

Please write your answer for i here. If you need to use more than one line, you may do so.

  • Exercise 2: Multiple Regression

This is a continuation of what we were doing in Exercise 1.

For this exercise, observe the expression for b1 when there are two regressors in the equation:

bˆ        ∑N x1iyi ∑N x2

− ∑N x1ix2i ∑N x2iyivariances and covariances without changing the value of the coefficient (since N2 is 1).

N2

Also notice that the covariance is like an un-normalized correlation coefficient. So if you

calculate the correlation between two variables, you won’t know the covariance between the two, but you’ll know the direction and strength of their relationship. Estimate Model 2. 

Calculate the correlations between log(salary)i, LSAT, and GPA.

Use the slicing notation to first make a subset of the data with only log_salary, LSAT and GPA.

Then use the corr() method to get the correlation for those variables, i.e. it will look something like this:

df[['log_salary', 'GPA', 'LSAT']].corr()

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