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)...
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
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
ADVERTISEMENT