Skip to content
R code for analysis of first dissertation chapter
R
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
analyses
code
README.md

README.md

title subtitle author date output
Mothers' work hours and fathers' share of involvement in cross-national perspective
Source file
Brett Ory, Renske Keizer, Pearl A. Dykstra
2018-01-24
html_document pdf_document
default
knitr::opts_chunk$set(eval=F) # don't run any of the chunks, these are all for demonstration purposes only

Purpose

Use this file to:

  1. prepare data
  2. run anayses
  3. make table and figures

Each code below sources a different R document. Data was downloaded in fall 2015 from the Generations and Gender Program, GGS Wave1_V.4.2


Set up global environment


# load packages
## install.packages("pacman") # pacman loads multiple packages & installs if necessary
pacman::p_load(psych, reshape, data.table, foreign, Hmisc, stats, plyr, nFactors, FactoMineR, gdata, XLConnect, diffr, # for data handling
               mcmcplots, mvtnorm, R2jags, rjags, coda, mice, # for Bayesian analysis
               xtable, xlsx, ggplot2, dplyr, foreign, car, VGAM, nnet, DAMisc # for figures 
) 

Prepare data

Source file that loads GGS data & uses NKPS data for Dutch GGS

source("~/code/GGS_loaddata_150118_step1.R")

Make individual-level variables

source("~/code/GGS_makevars_160118_step2.R")

Make macro variables

source("~/code/GGS_macrodata_160118_step3.R")

Subset data

source("~/code/GGS_subsetdata_160118_step4.R")

Analyses

Empty time structuring model:

rm(list=setdiff(ls(), "ggs.resp")) # clean up environment

source("~/analyses/call/call_fistr_emptymodel_160118.R")

Empty time flexible model:

rm(list=setdiff(ls(), "ggs.resp")) # clean up environment

source("~/analyses/call/call_fifle_emptymodel_160118.R")

Random slope of hrwkMom, time structuring

rm(list=setdiff(ls(), "ggs.resp")) # clean up environment

source("~/analyses/call/call_fistr_nomac_160118.R")

Random slope of hrwkMom, time flexible

rm(list=setdiff(ls(), "ggs.resp"))

source("~/data/analyses/call/call_fifle_nomac_160118.R")

Cross-level interaction paternity leave, time structuring

rm(list=setdiff(ls(), "ggs.resp"))

source("~/analyses/call/call_fistr_pat_160118.R")

Cross-level interaction gender pay gap, time structuring

rm(list=setdiff(ls(), "ggs.resp"))

source("~/analyses/call/call_fistr_gpg_160118.R")

Cross-level interaction GEM score, time structuring

rm(list=setdiff(ls(), "ggs.resp"))

source("~/analyses/call/call_fistr_gem_160118.R")

Cross-level interaction paternity leave, time flexible

rm(list=setdiff(ls(), "ggs.resp"))

source("~/analyses/call/call_fifle_pat_160118.R")

Cross-level interaction gender pay gap, time flexible

rm(list=setdiff(ls(), "ggs.resp"))

source("~/analyses/call/call_fifle_gpg_160118.R")

Cross-level interaction GEM score, time flexible

rm(list=setdiff(ls(), "ggs.resp"))

source("~/analyses/call/call_fifle_gem_160118.R")

Make tables and figures

Table 1

source("~/analyses/figures/Table 1/table1_descriptives_180118.R")

Figure 1

source("~/analyses/figures/Figure 1/figure1_bargraph_180118.R")

Figure 2

source("~/analyses/figures/Figure 2/figure2_fistr_180118.R")

Figure 3

source("~/analyses/figures/Figure 3/figure3_fifle_180118.R")
You can’t perform that action at this time.