-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.R
More file actions
47 lines (36 loc) · 1.55 KB
/
main.R
File metadata and controls
47 lines (36 loc) · 1.55 KB
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
debugSource(file.path(dirname(rstudioapi::getSourceEditorContext()$path),
"auth.R"))
#debugSource("set-up.R") #-- only run this once
library("devtools") #Needed to install Hans's packages
library("tidyverse") #Not really needed -- see minimalAlvisRun.R for minimal package requirements
`%<>%` <- magrittr::`%<>%`
library("lubridate")
library("boot") #Only needed for bootstrap
library("tictoc") #Only needed for testing
library("stringi") #Not sure where this is needed -- perhaps for debugging? I don't think it's needed for download and harmonise
debugSource("helpers.R")
debugSource("global_vars.R")
debugSource("get_DHS_data_functions.R")
debugSource("bootstrap_functions.R")
debugSource("bootstrap_helpers.R")
debugSource("modified_boot_function.R")
#Now run "get_DHS_data.R" manually
get_DHS_data.R
#Bootstrapping:
#Then run "bootstrap.R" manually
bootstrap.R
#(This isn't related to downloading the DHS data. Rather, it creates
#bootstrap samples of the DHS data.)
#Then need to recalculate IWI on each bootstrap sample
#################################
# OTHER BITS AND PIECES #
#################################
#DEBUGGING:
debugSource("debugging_helpers.R")
#See debugging.R
#Have a look at one dataset to see what it looks like:
library(haven)
CMPR71FL <- read_sav(file.path(living_conditions_file_path,
"DHS-VII/Cameroon 2018/Standard DHS/CMPR71FL.SAV"))
CMPR61FL <- read_sav(file.path(living_conditions_file_path,
"DHS-VI/Cameroon 2011/Standard DHS/CMPR61FL.SAV"))