Question

10. (8 marks) (using dataset: meap93, in R: data(meap93, package-wooldridge)) We want to explore the relationship betweenI need to know the code to do this question in R

thanks

0 0
Add a comment Improve this question Transcribed image text
Answer #1

i) the population model value for sci11, when totcomp =tc  is

\text{sci11}(tc)=\beta_0+\beta_1\log(\text{tc})+u

The value of sci11 when totcomp is increased by 10%, that is when totcomp=tc*1.1 is

= ß0 + β1 (log(tc) log( 1.1)) + u using the fact that log(ab) = log(a) o Bi log(tc)1 log(1.1) -scil1 (tcB1 x 0.095 log(b)

That means for a 10% increase in totcomp, the percentage point change in sci11 is

\begin{align*} \beta_1\times 0.095\approx \beta_1/10 \end{align*}

ii) The R code to estimate the model is below (all statements starting with # are comments and can be removed)

#install the package for the first time
install.packages('wooldridge')

#Load the data meap93
data(meap93,package='wooldridge')
#print some records
head(meap93)

#estimate the regression equation
fit<-lm(sci11~log(totcomp),data=meap93)
summary(fit)

# get this output

Call: lm (formula = sci II ~ log (totcomp), data = meap93) Residuals: 10 Median 3Q Max Min 42.991 -7.810 -0.2507.783 39.534 C

the estimated equation is

-69.771 + 11.286 log(totcomp) scil 1

R20.01858

Sample size n=408

iii) from part i) we can say that if the total compensation increases by 10%, then the estimated percentage point increase in scill is

R code

inc<-log(1.1)*fit$coef[2]
sprintf('The increase in scill is %.2f',inc)

##output is

> sprint f( The increase in scill is %.2f, inc) [11 The increase in scill is 1.08 13 I

Or using the approximation from part i) the increase is

11,286/10 = 1.13 percentage points

ans: If compensation increases by 10% the estimated percentage point increase in sci11 is 1.1

iv) Solving for totcomp using the fitted model we get

sci-69.771 11.286 log(totcomp) log(totcomp)- SCi11 +69.771 11.286 scil1+69.771 totcomp e 11.286

For the fitted values of sci11 to be greater than 100, we need the

-3, 411,343 totcomp 112863

That is the total compensation for the teachers to be more than $3,411,343, which is very unlikely for a school teacher in the US to aspire to. The maximum total compensation in the dataset is $63,518.

max (meap93stotcomp) 1 63518

Hence it is unlikely that in this dataset corresponding to the salary of school teachers, the fitted values of sci11 can be greater than 100.

Add a comment
Know the answer?
Add Answer to:
I need to know the code to do this question in R thanks 10. (8 marks) (using dataset: "meap93", in R: data(meap9...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • I need to know the code to do this question in R thanks 10. (8 marks)...

    I need to know the code to do this question in R thanks 10. (8 marks) (using dataset: "meap93", in R: data(meap93, package-'wooldridge)) We want to explore the relationship between the math pass rate (scil/) and average teachers' compensation (salary + benefits) in the school (totcomp) In the population model: scill,-β0 + βι log(totcompi-u, prove that β/ 10 is the percentage point change in scill given a 10% increase in totcom. ii Use the data in MEAP93 to estimate the...

  • We used the data in MEAP93.RAW for Example 2.12. Now we want to explore the relationship...

    We used the data in MEAP93.RAW for Example 2.12. Now we want to explore the relationship c6. between the math pass rate (math10) and spending per student (expend). (i) Do you think each additional dollar spent has the same effect on the pass rate, or does a dimini shing effect seem more appropriate? Explain. (i) n the population model math10 5 bO 1 b1 log (expend) 1 u, argue that b1/10 is the percentage point change in math 10 given...

  • please show the steps and the code to solve this in R, thank you 11. (10 marks) (using dataset: "hpricel", in R:...

    please show the steps and the code to solve this in R, thank you 11. (10 marks) (using dataset: "hpricel", in R: data(hprice1, package-wooldridge')) Use the data to 5 estimate the model where price is the house price measured in thousands of dollars iWrite out the results in equation form. iiWhat is the estimated increase in price for a house with one more bedroom, holding square footage and lot size constant? iii What is the estimated increase in price for...

  • For the following exercises you can use the 'Wooldridge' package in R to load the data 9. (7 marks) (using data...

    For the following exercises you can use the 'Wooldridge' package in R to load the data 9. (7 marks) (using dataset: "k401k") The data in 401K are a subset of data analyzed by Papke (1995) to study the relationship between participation in a 401(k) pension plan and the generosity of the plan. The variable prate is the percentage of eligible workers with an active account; this is the variable we would like to explain. The dummy variable sole represents whether...

  • 11. Suppose you are interested in estimating the effect of hours spent in an SAT preparation cour...

    11. Suppose you are interested in estimating the effect of hours spent in an SAT preparation course (hours) on total SAT score (sat). The population is all college-bound high school seniors for a particular year. (i) Suppose you are given a grant to run a controlled experiment. Explain how you would structure the experiment in order to estimate the causal effect of hours on sat. (ii) Consider the more realistic case where students choose how much time to spend in...

  • Using the package “wooldridge’, and the data ‘hprice1’ (in R-Software) to estimate the model price =...

    Using the package “wooldridge’, and the data ‘hprice1’ (in R-Software) to estimate the model price = β0 + β1sqrft + β2bdrms + u , where is the house price measured in thousands of dollars. 1. Write out the results in equation form. 2.  What is the estimated increase in price for a house with one more bedroom, holding square footage constant? 3. What is the estimated increase in price for a house with an additional bedroom that is 140 square feet...

  • R is a little difficult for me, please answer if you can interpret the R code, I want to learn better how to interpret the R code 4. each 2 pts] Below is the R output for a simple linear regression m...

    R is a little difficult for me, please answer if you can interpret the R code, I want to learn better how to interpret the R code 4. each 2 pts] Below is the R output for a simple linear regression model Coefficients: Estimate Std. Error t value Pr(>t) (Intercept) 77.863 4.199 18.544 3.54e-13 3.485 3.386 0.00329* 11.801 Signif. codes: 0 0.0010.010.05 0.11 Residual standard error: 3.597 on 18 degrees of freedom Multiple R-squared: 0.3891, Adjusted R-squared: 0.3552 F-statistic: 11.47...

  • 1. In the simple regression model y = + β1x + u, suppose that E (u)...

    1. In the simple regression model y = + β1x + u, suppose that E (u) 0. Letting oo-E(u), show that the model can always be rewrit ten with the same slope, but a new intercept and error, where the new error has a zero expected value 2. The data set BWGHT contains data on births to women in the United States. Two variables of interest are the dependent variable, nfan birth weight in ounces (bught), and an explanatory variable,...

  • The Book of R (Question 20.2) Please answer using R code. Continue using the survey data...

    The Book of R (Question 20.2) Please answer using R code. Continue using the survey data frame from the package MASS for the next few exercises. The survey data set has a variable named Exer , a factor with k = 3 levels describing the amount of physical exercise time each student gets: none, some, or frequent. Obtain a count of the number of students in each category and produce side-by-side boxplots of student height split by exercise. Assuming independence...

  • For this exercise we will run a regression using Swiss demographic data from around 1888. The...

    For this exercise we will run a regression using Swiss demographic data from around 1888. The sample is a cross-section of French speaking counties in Switzerland This data come with the R package datasets. The first step is to load the package into your current environment by typing the command libraryldatasets) in to the R console. This loads a number of datasets including one called swiss. Type help/swiss) in the console for additional details. The basic variable definitions are as...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
Active Questions
ADVERTISEMENT