Question

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

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

code in R


library(wooldridge)
data(k401k,package='woolridge')
m1 <- lm(prate~sole,data=k401k)
summary(m1)

sum(k401k$sole)/nrow(k401k)
mean(k401k[k401k$sole==1 ,'prate' ])

summary(m1)

Call:
lm(formula = prate ~ sole, data = k401k)

Residuals:
    Min      1Q  Median      3Q     Max 
-81.782  -8.282   8.872   9.925  15.218 

Coefficients:
            Estimate Std. Error t value Pr(>|t|)    
(Intercept)  84.7821     0.5889 143.959  < 2e-16 ***
sole          5.2928     0.8434   6.276 4.52e-10 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 16.51 on 1532 degrees of freedom
Multiple R-squared:  0.02506,   Adjusted R-squared:  0.02443 
F-statistic: 39.38 on 1 and 1532 DF,  p-value: 4.522e-10

> 
> 
> 
> sum(k401k$sole)/nrow(k401k)
[1] 0.4876141
> mean(k401k[k401k$sole==1 ,'prate' ])
[1] 90.07487

i)
mean participation rate = 90.07487 that only provide the 401k pension plan
% of firm = 48.76 % only provide the 401k pension plan

ii)

y^= 84.7821 + 5.2928 * sole
iii)
intercept = 84.7821
% of eligible worker with an active account for firm who have other pension plan = 84.7821


slope = 5.2928

percentage of eligible worker with an active account when 401k is firm's sole plan is 5.2928 more than firm who have other pension plan.


iv)
R^2 = 0.02506
hence 2.5 % of variation is explained by sole.

This is very low

Add a comment
Know the answer?
Add Answer to:
For the following exercises you can use the 'Wooldridge' package in R to load the data 9. (7 marks) (using data...
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) (using dataset: "meap93", in R: data(meap9...

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

  • 8. Practice constructing confidence intervals Suppose a data set of 30 observations (N-30) was analyzed using...

    8. Practice constructing confidence intervals Suppose a data set of 30 observations (N-30) was analyzed using OLS to examine the factors influencing the participation rate of employees in a 401(k) retirement plan sponsored by their employer. The regression results are as follows, with standard errors in parentheses: prate = 80.1 + 5.6mrate + 0.046 age + 0.0001 totemp 0.s5) (0.04) (S.OR-5) where prate - percentage of eligible workers with a 401(k) plan mrate match rate for firm age - age...

  • 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...

  • 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...

  • Exercise 1. For this exercise use the bdims data set from the openintro package. Type ?bdims to r...

    Exercise 1. For this exercise use the bdims data set from the openintro package. Type ?bdims to read about this data set in the help menu. Of interest are the variables hgt (height in centimeters), wgt (weight in kilograms), and sex (dummy variable with 1-male, 0-female). Since ggplotO requires that a categorical variable be coded as a factor type in R, run the following code: library (openintro) bdíms$sex2 <-factor (bdins$sex, levels-c (0,1), labels=c('F', 'M')) (a) Use ggplot2 to make a...

  • Data manipulation using R Download and load Most_popular_baby_name.csv to R using the following R code: library('tidyverse')...

    Data manipulation using R Download and load Most_popular_baby_name.csv to R using the following R code: library('tidyverse') baby_names <- read_csv("http://personal.stevens.edu/~fmai/data/Most_Popular_Baby_Names.csv") The file contains the counts of baby names by sex and mother's ethnicity in NYC in 2011-2014. For example, the first record indicates that in 2011, when the mother is Hispanic and the baby is female, 13 were named GERALDINE. BRTH_YR Gender ETHCTY Name Count 2011 FEMALE HISPANIC GERALDINE 13 Only analyze the dataset for the years 2012 - 2014, so...

  • 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...

  • Which team statistic is the best variable to use to predict a team's winning percentage? One...

    Which team statistic is the best variable to use to predict a team's winning percentage? One pitching, one fielding, and one hitting statistic was measured for each major league baseball team at the end of the 2019 season. The dataset is called "2019 MLB Team Statistics. The three explanatory variables as follows. Earned Run Average (ERA): a pitching statistic Fielding %: a fielding statistic Home Runs: a hitting statistic Wis Loss Win Loss 054 Eamed Run Arome 0978 09892098409609 Fielding...

  • 5. Consider the following data (You are allowed to use built-in function in R, but the...

    5. Consider the following data (You are allowed to use built-in function in R, but the code must be attached) X 99.0 101.1 102.7 103.0 105.4 107.0 108.7 110.8 112.1 112.4 113.6 113.8 115.1 115.4 120.0 y 28.8 27.9 27.0 25.2 22.8 21.5 20.9 19.6 17.1 18.9 16.0 16.7 13.0 13.6 10.8 (a) Obtain sample statistics such as sample mean of y and x and swa = n. 2-1(;- T)?, Say = n-1 =1(xi – 7)(yi – ). (b) Obtain...

  • Exercise 2. [Data analysis, requires R] For this questions use the bac data set from the...

    Exercise 2. [Data analysis, requires R] For this questions use the bac data set from the openintro library. To access this data set first install the package using install.packages ("openintro") (this only needs to be done once). Then load the pack- age into R with the command library(openintro). You can read about this data set in the help menu by entering the command ?openintro or help(openintro). Many people believe that gender, weight, drinking habits, and many other factors are much...

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