Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Instructions The data load from online sources. As you work through the code chunks, remember to turn eval = T if it is set to

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed
image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed
Instructions The data load from online sources. As you work through the code chunks, remember to turn eval = T if it is set to eval = F . Upload HTML file to e-class when done. Its ok, even encouraged, to work in groups of up to four. Please put your group members names at the top. Question 1: Wine Prices For this problem, load the data on the price of wine (Chateau Latour) sold at a 1986 London auction using the link and code provided. Wines sold were from vintage years 1882 to 1983. The data set includes information on rainfall and temperature in the region in France where Chateau Latour grapes are grown. # Read in raw data (requires internet connection) raw % rename_with (tolower, everything() ) %>% drop_na(price) Data manipulation Using the wine data, perform the following tasks: 1. Copy the raw data frame to a new data frame called df , 2. Subset the data to include only observations from 1952 or later using the filter( ) command, 3. Use mutate() to construct a new variable called aveRain that is the average rainfall in August ( aurain ) and September ( aurain ). 4. Construct a new variable called aveTemp that is the average temperature in July ( jltemp ) and August ( autemp ). 5. Construct a new variable called logPrice that is is the log price of wine ( price ). A sketch of the code is provided below. Remember to turn eval = F to eval = T , and then fill in the . . . with correct code. # code sketch df % filter (year >= . ..) %>% mutate (aveRain = (. . . + ...)/2, ave Temp = ( . . . + . . .)/2, . .. = log(price) )Summary statistics Create a table of summary statistics using the package modelsummary and the function datasummary ( ) . You can see examples on this page. The function datasummary() requires as inputs the data frame and a formula. The formula has the syntax rows ~ columns . Thus, if we want variables as rows and summary statistics as columns, we would write variable names ~ summary statistics . I have outlined the code below. # code sketch # Summary statistics datasummary (price + aveRain + aveTemp + time ~ (mean + sd + min + max) , data = . . .) Predicting wine prices The major determinant of wine quality is vintage (i.e., time passed since the wine was bottled.) This suggests that wine prices should increase with age. Let t be the year a bottle of wine is bottled and ?" be the year that it is sold at auction. When sold, the wine is 7 = 7' - t years old. Suppose the unknown price of a wine aged J is an increasing concave function f(J). The present value of wine in the year it is bottled is therefore f ( T) U(T) = (1 +r ) T' where r is the discount (interest) rate used by investors to evaluate future prospects. f(0) is the price of the wine in the year it is bottled. Like financial investors holding a treasury bond, vintners and wine investors can sell their wine now or hold it and sell it at a later date. One theory of asset pricing in financial markets is that market forces will set prices to equalize the present value of an asset sold on different dates. This implies that: log f (T)] = T . T + log f(0)] Where In [f(0)] is an unknown constant and r is an unknown slope coefficient. The 7 is the time since bottled, and is given in the data set by the variable time . The variable log f(T)] is just the log price of wine logPrice . This relationship is approximate. To turn this into an econometric model, we can rewrite: logPrice; = Ho + Hitime; + ei Answer the following: 1. What does i index? 2. What is the interpretation of Ho? 3. What is the interpretation of /1? 4. What is the interpretation of e; answer hereEstimation 3. Use the data for this problem set and the econometric model to estimate the discount rate used by those who buy and sell Chateau Latour. Answer 1. Test whether the discount rate equals 3 percent. 2. Plot the data and tted sample regression line. 3. Esneg.r discuss the t of the regression. What is the R2? 4. For which vintage does the model have the lowest prediction error? the highest? [Hint:The easiest way to do this is to add the residuals to the data frame, and then View the data frame in the data View. Sort by residual]. answer here it! regression fit % mutate(res = residuals(...)) it! add residual. from model. Question 2: CEO Salaries Suppose we wanted to predict a CEO's salary based on the firms return on equity over the previous 2 years. The data set ceosal contains the variables salary (annual salary in thousands) and roe , the return on equity in percent (ie, return * 100). You can see additional information about the data by typing ?ceosal into the console and viewing the help file. Consider the following equation: salary; = Bo + Birde; + Wi (2.1) # This Loads the data ceosal answer here 2. In the following code chunk, change the units of measurement. In particular, roe_decimal; is roe; / 100 or measured as the return in decimals. The variable salary_dollars; is salary measured in dollars rather than a thousands of dollars. # code ceosal % mutate (roe_decimal = roe / 100, salary_dollars = salary * 1000)Estimate salary dollars; = do + ajroe; + Wi and salary; = Yo + roe_decimal; + wi in the code chunk below and interpret both the intercept and the slope coefficient. What is the relationship between , and y1 and o1, and Bo and Yo and Qg # your code here model_2 * group_by ( countyid) *>* arrange(year) %>% mutate(D = ifelse( lag(execs) >0 , 1, 0) ) *>% filter (year > min(year) ) 1. What fraction of counties used capital punishment in 1990? [Hint: This amounts to finding the mean of D for the year 1990]. answer here # code sketch mean ( . . .$. . . [. ..$. ..==1990]) 2. For counties with Di = 0, what is the maximum and minimum murder rate per 100,000? answer here # code sketch. Use summary() to find max of murdrate for D == @ counties summary ( . . .) 2. Write down an econometric model that would allow you to study the causal effect of capital punishment. Describe your model. How do you account for the fact that there seems to be a great deal of variation in murder rates for counties who do not have capital punishment? What sorts of things could account for this variation? murdrate; = Bot. . . (Econometric model) answer here3. Estimate your econometric model. # code sketch # fit model: murders

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

Recommended Textbook for

International Marketing And Export Management

Authors: Gerald Albaum , Alexander Josiassen , Edwin Duerr

8th Edition

1292016922, 978-1292016924

Students also viewed these Economics questions