1. 1.Read Cunha, Menichini, and Crockett (2015) “The retention effects of high years of service cliff-vesting pension plans,” Economics Letters. 2. 2.Reproduce the 2 tables and the 3 survival curves...

1 answer below »

View more »
Answered 8 days AfterJul 21, 2022

Answer To: 1. 1.Read Cunha, Menichini, and Crockett (2015) “The retention effects of high years of service...

Mohd answered on Jul 29 2022
86 Votes
-
-
-
2022-07-29
Importing required packages and Data
library(haven)
library(stargazer)
library(dplyr)
library(psych)
library(survival)
library(survminer)
retirementdata_1 <- read_dta("retirementdata-1.dta")
retirementdata_1%>%
count(superfund)
## # A tibble: 2 x
2
## superfund n
##
## 1 DFRDB 629
## 2 MSBS 5723
retirementdata<-retirementdata_1%>%
mutate(Navy=ifelse(service=="NAVY",1,0))%>%
mutate(Army=ifelse(service=="ARMY",1,0))%>%
mutate(AIR_FORCE=ifelse(service=="AIR FORCE",1,0))%>%
mutate(DFRDB=ifelse(superfund=="DFRDB",1,0))%>%
mutate(MSBS=ifelse(superfund=="MSBS",1,0))%>%
mutate(Female=ifelse(sex=="F",1,0))%>%
mutate(Male=ifelse(sex=="M",1,0))
library(skimr)
skim(retirementdata)
Data summary
    Name
    retirementdata
    Number of rows
    6352
    Number of columns
    14
    _______________________
    
    Column type frequency:
    
    character
    3
    Date
    3
    numeric
    8
    ________________________
    
    Group variables
    None
Variable type: character
    skim_variable
    n_missing
    complete_rate
    min
    max
    empty
    n_unique
    whitespace
    sex
    0
    1
    1
    1
    0
    2
    0
    service
    0
    1
    4
    9
    0
    3
    0
    superfund
    0
    1
    4
    5
    0
    2
    0
Variable type: Date
    skim_variable
    n_missing
    complete_rate
    min
    max
    median
    n_unique
    hiredate
    0
    1.00
    1990-09-03
    1992-09-30
    1991-04-09
    268
    birthdate
    0
    1.00
    1955-05-31
    1976-07-01
    1972-06-05
    2916
    firstseparationdate
    1209
    0.81
    1994-06-30
    2013-07-29
    1999-01-17
    2817
Variable type: numeric
    skim_variable
    n_missing
    complete_rate
    mean
    sd
    p0
    p25
    p50
    p75
    p100
    hist
    officer
    8
    1
    0.16
    0.37
    0
    0
    0
    0
    1
    ▇▁▁▁▂
    Navy
    0
    1
    0.28
    0.45
    0
    0
    0
    1
    1
    ▇▁▁▁▃
    Army
    0
    1
    0.45
    0.50
    0
    0
    0
    1
    1
    ▇▁▁▁▆
    AIR_FORCE
    0
    1
    0.27
    0.44
    0
    0
    0
    1
    1
    ▇▁▁▁▃
    DFRDB
    0
    1
    0.10
    0.30
    0
    0
    0
    0
    1
    ▇▁▁▁▁
    MSBS
    0
    1
    0.90
    0.30
    0
    1
    1
    1
    1
    ▁▁▁▁▇
    Female
    0
    1
    0.18
    0.39
    0
    0
    0
    0
    1
    ▇▁▁▁▂
    Male
    0
    1
    0.82
    0.39
    0
    1
    1
    1
    1
    ▂▁▁▁▇
retirementdata_df<-na.omit(retirementdata)
1. Reproduce the 2 tables and the 3 survival curves presented in the paper using the Stata dataset “retirement_data.dta” with R Studio. I should be able to run your script without errors by only changing the parent directory.
retirementdata<-retirementdata%>%
mutate(Age_enlistemnt=as.numeric(round((hiredate-birthdate)/365,2)))%>%
mutate(Yrs_service=as.numeric(round((firstseparationdate-hiredate)/365,2)))
FY1991_cohort<-retirementdata%>%
filter(hiredate >'1991-10-01' & hiredate<'1992-09-30')
FY1992_cohort<-retirementdata%>%
filter(hiredate <'1991-10-01' | hiredate>'1992-09-30')
#first...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here
April
January
February
March
April
May
June
July
August
September
October
November
December
2025
2025
2026
2027
SunMonTueWedThuFriSat
30
31
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
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