forked from yimengyin16/Model_Main
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Reproducibility_guide.R
65 lines (44 loc) · 2.73 KB
/
Reproducibility_guide.R
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# Master file for preproducing model results in reports M1 and M2.1
# Yimeng Yin
# Oct 2016
# Report M1: http://www.rockinst.org/pdf/government_finance/2016-06-02-Pension_Funding_Practices.pdf
# Report M2.1a: http://www.rockinst.org/pdf/government_finance/2016-12-07-Demographic_Policy_Brief.pdf
# Report M2.1b: http://www.rockinst.org/pdf/government_finance/2017-01-10-Pension_Investment_Risks.pdf
#**************************************************************************************
# Software requirements ####
#**************************************************************************************
# 1. R https://cran.r-project.org/mirrors.html
# 2. Rtools https://cran.r-project.org/bin/windows/Rtools/ (Choose Rtools version compatible with the version of R)
# 3. Rstudio with packrat support https://www.rstudio.com/products/rstudio/#Desktop
# 4. Java https://java.com/en/download/ (Choose 32-bit or 64-bit version depending on the operating system)
#**************************************************************************************
# Lunch RStudio and open project "Model.Main" in Rstudio ####
#**************************************************************************************
# Packrate will download and install all required packages automatically
#**************************************************************************************
# Running model ####
#**************************************************************************************
## Run model for report M1
source("Model_RunControl_reprod_M1.R")
# Only one simulation will be run by default for illustration,
# User can chnage column C in "/IO_M1_new/Repord_RunControl_M1_new.xlsx)" to
# include more simulations.
## Run model for report M2.1a and M2.1b
source("Model_RunControl_reprod_M2.1.R")
# Only one simulation will be run by default for illustration,
# User can chnage column C in "/IO_M2.1_new/Repord_RunControl_M2.1_new.xlsx)" to
# include more simulations.
## Where are the outputs saved
# Report M1: "IO_M1_new/"
# Report M2.1a/b: "IO_M2.1_new/"
#**************************************************************************************
# Producing graphs and tables ####
#**************************************************************************************
## Producing graphs and tables
source("IO_M1_new/Report_M1.R")
source("IO_M2.1_new/Report_M2.1a.R")
source("IO_M2.1_new/Report_M2.1b.R")
## Where are the outputs saved
# Report M1: "IO_M1_new/"
# Report M2.1a: "IO_M2.1_new/M2.1a_outputs"
# Report M2.1b: "IO_M2.1_new/M2.1b_outputs"