logo Use CA10RAM to get 10%* Discount.
Order Nowlogo
(5/5)

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

(5/5)
Attachments:

Related Questions

. Introgramming & Unix Fall 2018, CRN 44882, Oakland University Homework Assignment 6 - Using Arrays and Functions in C

DescriptionIn this final assignment, the students will demonstrate their ability to apply two ma

. The standard path finding involves finding the (shortest) path from an origin to a destination, typically on a map. This is an

Path finding involves finding a path from A to B. Typically we want the path to have certain properties,such as being the shortest or to avoid going t

. 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. The LineItem class will represent an individual

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

. SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define:

1 Project 1 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of

. Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define:

1 Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of

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

expert
Um e HaniScience

990 Answers

Hire Me
expert
Muhammad Ali HaiderFinance

953 Answers

Hire Me
expert
Husnain SaeedComputer science

921 Answers

Hire Me
expert
Atharva PatilComputer science

956 Answers

Hire Me
June
January
February
March
April
May
June
July
August
September
October
November
December
2025
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
SunMonTueWedThuFriSat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
1
2
3
4
5
00:00
00:30
01:00
01:30
02:00
02:30
03:00
03:30
04:00
04:30
05:00
05:30
06:00
06:30
07:00
07:30
08:00
08:30
09:00
09:30
10:00
10:30
11:00
11:30
12:00
12:30
13:00
13:30
14:00
14:30
15:00
15:30
16:00
16:30
17:00
17:30
18:00
18:30
19:00
19:30
20:00
20:30
21:00
21:30
22:00
22:30
23:00
23:30