% Options for packages loaded elsewhere
\PassOptionsToPackage{unicode}{hyperref}
\PassOptionsToPackage{hyphens}{url}
%
\documentclass[
]{article}
\usepackage{amsmath,amssymb}
\usepackage{lmodern}
\usepackage{iftex}
\ifPDFTeX
  \usepackage[T1]{fontenc}
  \usepackage[utf8]{inputenc}
  \usepackage{textcomp} % provide euro and other symbols
\else % if luatex or xetex
  \usepackage{unicode-math}
  \defaultfontfeatures{Scale=MatchLowercase}
  \defaultfontfeatures[\rmfamily]{Ligatures=TeX,Scale=1}
\fi
% Use upquote if available, for straight quotes in verbatim environments
\IfFileExists{upquote.sty}{\usepackage{upquote}}{}
\IfFileExists{microtype.sty}{% use microtype if available
  \usepackage[]{microtype}
  \UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts
}{}
\makeatletter
\@ifundefined{KOMAClassName}{% if non-KOMA class
  \IfFileExists{parskip.sty}{%
    \usepackage{parskip}
  }{% else
    \setlength{\parindent}{0pt}
    \setlength{\parskip}{6pt plus 2pt minus 1pt}}
}{% if KOMA class
  \KOMAoptions{parskip=half}}
\makeatother
\usepackage{xcolor}
\usepackage[margin=1in]{geometry}
\usepackage{color}
\usepackage{fancyvrb}
\newcommand{\VerbBar}{|}
\newcommand{\VERB}{\Verb[commandchars=\\\{\}]}
\DefineVerbatimEnvironment{Highlighting}{Verbatim}{commandchars=\\\{\}}
% Add ',fontsize=\small' for more characters per line
\usepackage{framed}
\definecolor{shadecolor}{RGB}{248,248,248}
\newenvironment{Shaded}{\begin{snugshade}}{\end{snugshade}}
\newcommand{\AlertTok}[1]{\textcolor[rgb]{0.94,0.16,0.16}{#1}}
\newcommand{\AnnotationTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{\textbf{\textit{#1}}}}
\newcommand{\AttributeTok}[1]{\textcolor[rgb]{0.77,0.63,0.00}{#1}}
\newcommand{\BaseNTok}[1]{\textcolor[rgb]{0.00,0.00,0.81}{#1}}
\newcommand{\BuiltInTok}[1]{#1}
\newcommand{\CharTok}[1]{\textcolor[rgb]{0.31,0.60,0.02}{#1}}
\newcommand{\CommentTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{\textit{#1}}}
\newcommand{\CommentVarTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{\textbf{\textit{#1}}}}
\newcommand{\ConstantTok}[1]{\textcolor[rgb]{0.00,0.00,0.00}{#1}}
\newcommand{\ControlFlowTok}[1]{\textcolor[rgb]{0.13,0.29,0.53}{\textbf{#1}}}
\newcommand{\DataTypeTok}[1]{\textcolor[rgb]{0.13,0.29,0.53}{#1}}
\newcommand{\DecValTok}[1]{\textcolor[rgb]{0.00,0.00,0.81}{#1}}
\newcommand{\DocumentationTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{\textbf{\textit{#1}}}}
\newcommand{\ErrorTok}[1]{\textcolor[rgb]{0.64,0.00,0.00}{\textbf{#1}}}
\newcommand{\ExtensionTok}[1]{#1}
\newcommand{\FloatTok}[1]{\textcolor[rgb]{0.00,0.00,0.81}{#1}}
\newcommand{\FunctionTok}[1]{\textcolor[rgb]{0.00,0.00,0.00}{#1}}
\newcommand{\ImportTok}[1]{#1}
\newcommand{\InformationTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{\textbf{\textit{#1}}}}
\newcommand{\KeywordTok}[1]{\textcolor[rgb]{0.13,0.29,0.53}{\textbf{#1}}}
\newcommand{\NormalTok}[1]{#1}
\newcommand{\OperatorTok}[1]{\textcolor[rgb]{0.81,0.36,0.00}{\textbf{#1}}}
\newcommand{\OtherTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{#1}}
\newcommand{\PreprocessorTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{\textit{#1}}}
\newcommand{\RegionMarkerTok}[1]{#1}
\newcommand{\SpecialCharTok}[1]{\textcolor[rgb]{0.00,0.00,0.00}{#1}}
\newcommand{\SpecialStringTok}[1]{\textcolor[rgb]{0.31,0.60,0.02}{#1}}
\newcommand{\StringTok}[1]{\textcolor[rgb]{0.31,0.60,0.02}{#1}}
\newcommand{\VariableTok}[1]{\textcolor[rgb]{0.00,0.00,0.00}{#1}}
\newcommand{\VerbatimStringTok}[1]{\textcolor[rgb]{0.31,0.60,0.02}{#1}}
\newcommand{\WarningTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{\textbf{\textit{#1}}}}
\usepackage{graphicx}
\makeatletter
\def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth\else\Gin@nat@width\fi}
\def\maxheight{\ifdim\Gin@nat@height>\textheight\textheight\else\Gin@nat@height\fi}
\makeatother
% Scale images if necessary, so that they will not overflow the page
% margins by default, and it is still possible to overwrite the defaults
% using explicit options in \includegraphics[width, height, ...]{}
\setkeys{Gin}{width=\maxwidth,height=\maxheight,keepaspectratio}
% Set default figure placement to htbp
\makeatletter
\def\fps@figure{htbp}
\makeatother
\setlength{\emergencystretch}{3em} % prevent overfull lines
\providecommand{\tightlist}{%
  \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
\setcounter{secnumdepth}{-\maxdimen} % remove section numbering
\usepackage{booktabs}
\usepackage{siunitx}
\newcolumntype{d}{S[input-symbols = ()]}
\usepackage{longtable}
\usepackage{array}
\usepackage{multirow}
\usepackage{wrapfig}
\usepackage{float}
\usepackage{colortbl}
\usepackage{pdflscape}
\usepackage{tabu}
\usepackage{threeparttable}
\usepackage{threeparttablex}
\usepackage[normalem]{ulem}
\usepackage{makecell}
\usepackage{xcolor}
\ifLuaTeX
  \usepackage{selnolig}  % disable illegal ligatures
\fi
\IfFileExists{bookmark.sty}{\usepackage{bookmark}}{\usepackage{hyperref}}
\IfFileExists{xurl.sty}{\usepackage{xurl}}{} % add URL line breaks if available
\urlstyle{same} % disable monospaced font for URLs
\hypersetup{
  pdftitle={Coping with financial fragility: Dutch households in the Great Depression},
  pdfauthor={Oscar Gelderblom and Tim van der Valk},
  hidelinks,
  pdfcreator={LaTeX via pandoc}}

\title{Coping with financial fragility: Dutch households in the Great
Depression}
\author{Oscar Gelderblom and Tim van der Valk}
\date{2022-10-08}

\begin{document}
\maketitle

\hypertarget{functions}{%
\section{Functions}\label{functions}}

\begin{Shaded}
\begin{Highlighting}[]
\NormalTok{count\_over\_zero100 }\OtherTok{\textless{}{-}} \ControlFlowTok{function}\NormalTok{(x) \{ }\DecValTok{100} \SpecialCharTok{*} \FunctionTok{sum}\NormalTok{(x}\SpecialCharTok{\textgreater{}}\DecValTok{0}\NormalTok{, }\AttributeTok{na.rm =} \ConstantTok{TRUE}\NormalTok{) }\SpecialCharTok{/} \FunctionTok{length}\NormalTok{(}\FunctionTok{na.omit}\NormalTok{(x)) \}}
\end{Highlighting}
\end{Shaded}

\hypertarget{setup-surveys}{%
\section{Setup surveys}\label{setup-surveys}}

\hypertarget{nl-598-employed}{%
\subsection{NL 598 employed}\label{nl-598-employed}}

check fm vs.~fm2 wealth

\begin{Shaded}
\begin{Highlighting}[]
\NormalTok{df.NL598 }\OtherTok{\textless{}{-}} \FunctionTok{read.csv}\NormalTok{(}\StringTok{"data/NL598.csv"}\NormalTok{) }\SpecialCharTok{\%\textgreater{}\%} \FunctionTok{select}\NormalTok{(}\SpecialCharTok{{-}}\NormalTok{X)}

\CommentTok{\# net figures}
\NormalTok{df.NL598}\SpecialCharTok{$}\NormalTok{net\_income }\OtherTok{\textless{}{-}}\NormalTok{ df.NL598}\SpecialCharTok{$}\NormalTok{A }\SpecialCharTok{{-}} \FunctionTok{rowSums}\NormalTok{(df.NL598[}\FunctionTok{c}\NormalTok{(}\StringTok{"A1"}\NormalTok{, }\StringTok{"A2"}\NormalTok{, }\StringTok{"A3"}\NormalTok{, }\StringTok{"A4"}\NormalTok{, }\StringTok{"A5"}\NormalTok{)] )}
\NormalTok{df.NL598}\SpecialCharTok{$}\NormalTok{net\_savings }\OtherTok{\textless{}{-}}\NormalTok{ df.NL598}\SpecialCharTok{$}\NormalTok{E }\SpecialCharTok{{-}}\NormalTok{ df.NL598}\SpecialCharTok{$}\NormalTok{B}
\NormalTok{df.NL598}\SpecialCharTok{$}\NormalTok{net\_credit }\OtherTok{\textless{}{-}}\NormalTok{ df.NL598}\SpecialCharTok{$}\NormalTok{F }\SpecialCharTok{{-}}\NormalTok{ df.NL598}\SpecialCharTok{$}\NormalTok{C}

\CommentTok{\# consumption categories}
\NormalTok{df.NL598}\SpecialCharTok{$}\NormalTok{food }\OtherTok{\textless{}{-}}\NormalTok{ df.NL598}\SpecialCharTok{$}\NormalTok{D1\_16}
\NormalTok{df.NL598}\SpecialCharTok{$}\NormalTok{shelter }\OtherTok{\textless{}{-}} \FunctionTok{rowSums}\NormalTok{(df.NL598[}\FunctionTok{c}\NormalTok{(}\StringTok{"D17"}\NormalTok{, }\StringTok{"D18"}\NormalTok{, }\StringTok{"D19"}\NormalTok{, }\StringTok{"D20"}\NormalTok{, }\StringTok{"D21a"}\NormalTok{, }\StringTok{"D21b"}\NormalTok{, }\StringTok{"D21c"}\NormalTok{)])}
\NormalTok{df.NL598}\SpecialCharTok{$}\NormalTok{clothing }\OtherTok{\textless{}{-}} \FunctionTok{rowSums}\NormalTok{(df.NL598[}\FunctionTok{c}\NormalTok{(}\StringTok{"D25"}\NormalTok{, }\StringTok{"D26"}\NormalTok{, }\StringTok{"D22"}\NormalTok{)])}
\NormalTok{df.NL598}\SpecialCharTok{$}\NormalTok{leisure }\OtherTok{\textless{}{-}} \FunctionTok{rowSums}\NormalTok{(df.NL598[}\FunctionTok{c}\NormalTok{(}\StringTok{"D32"}\NormalTok{, }\StringTok{"D33"}\NormalTok{)])}
\NormalTok{df.NL598}\SpecialCharTok{$}\NormalTok{other }\OtherTok{\textless{}{-}} \FunctionTok{rowSums}\NormalTok{(df.NL598[}\FunctionTok{c}\NormalTok{(}\StringTok{"D23a"}\NormalTok{, }\StringTok{"D23b"}\NormalTok{, }\StringTok{"D24"}\NormalTok{, }\StringTok{"D27"}\NormalTok{, }\StringTok{"D28"}\NormalTok{, }\StringTok{"D29"}\NormalTok{, }\StringTok{"D30"}\NormalTok{, }\StringTok{"D31"}\NormalTok{, }\StringTok{"D34"}\NormalTok{, }\StringTok{"D35"}\NormalTok{,  }\StringTok{"D36"}\NormalTok{, }\StringTok{"D37"}\NormalTok{, }\StringTok{"D38"}\NormalTok{)])}

\CommentTok{\# fragility}
\NormalTok{df.NL598 }\OtherTok{\textless{}{-}}\NormalTok{ df.NL598 }\SpecialCharTok{\%\textgreater{}\%} 
  \FunctionTok{mutate}\NormalTok{(}\AttributeTok{fm =}\NormalTok{ net\_income }\SpecialCharTok{{-}}\NormalTok{ food }\SpecialCharTok{{-}}\NormalTok{ shelter }\SpecialCharTok{{-}}\NormalTok{ clothing) }\SpecialCharTok{\%\textgreater{}\%}
  \FunctionTok{mutate}\NormalTok{(}\AttributeTok{fm2 =}\NormalTok{ net\_income }\SpecialCharTok{+}\NormalTok{ A4 }\SpecialCharTok{{-}}\NormalTok{ food }\SpecialCharTok{{-}}\NormalTok{ shelter }\SpecialCharTok{{-}}\NormalTok{ clothing) }

\CommentTok{\# share of consumption}
\NormalTok{df.NL598 }\OtherTok{\textless{}{-}}\NormalTok{ df.NL598 }\SpecialCharTok{\%\textgreater{}\%} 
  \FunctionTok{mutate}\NormalTok{(}\AttributeTok{fffm2 =} \FunctionTok{ifelse}\NormalTok{(fm2 }\SpecialCharTok{\textless{}} \FunctionTok{quantile}\NormalTok{(fm2, }\AttributeTok{probs =} \FunctionTok{c}\NormalTok{(}\FloatTok{0.33}\NormalTok{)), }\DecValTok{1}\NormalTok{, }
                       \FunctionTok{ifelse}\NormalTok{(fm2 }\SpecialCharTok{\textgreater{}} \FunctionTok{quantile}\NormalTok{(fm2, }\AttributeTok{probs =} \FunctionTok{c}\NormalTok{(}\FloatTok{0.66}\NormalTok{)), }\DecValTok{0}\NormalTok{, }\ConstantTok{NaN}\NormalTok{))) }\SpecialCharTok{\%\textgreater{}\%}
  \FunctionTok{mutate}\NormalTok{(}\AttributeTok{fffm.con =} \FunctionTok{ifelse}\NormalTok{(fm }\SpecialCharTok{\textless{}} \FunctionTok{quantile}\NormalTok{(fm, }\AttributeTok{probs =} \FunctionTok{c}\NormalTok{(}\FloatTok{0.33}\NormalTok{)), fm,}
                           \FunctionTok{ifelse}\NormalTok{(fm }\SpecialCharTok{\textgreater{}} \FunctionTok{quantile}\NormalTok{(fm, }\AttributeTok{probs =} \FunctionTok{c}\NormalTok{(}\FloatTok{0.66}\NormalTok{)), fm, }\ConstantTok{NaN}\NormalTok{)))}

\CommentTok{\# HH size}
\NormalTok{df.NL598 }\OtherTok{\textless{}{-}}\NormalTok{ df.NL598 }\SpecialCharTok{\%\textgreater{}\%}
  \FunctionTok{mutate}\NormalTok{(}\AttributeTok{temp =} \FunctionTok{ifelse}\NormalTok{(}\FunctionTok{is.na}\NormalTok{(age\_m) }\SpecialCharTok{\&} \SpecialCharTok{!}\FunctionTok{is.na}\NormalTok{(age\_f), }\DecValTok{1}\NormalTok{,}
                       \FunctionTok{ifelse}\NormalTok{(}\FunctionTok{is.na}\NormalTok{(age\_f) }\SpecialCharTok{\&} \SpecialCharTok{!}\FunctionTok{is.na}\NormalTok{(age\_m), }\DecValTok{1}\NormalTok{,}\DecValTok{2}\NormalTok{))) }\SpecialCharTok{\%\textgreater{}\%}
  \FunctionTok{mutate}\NormalTok{(}\AttributeTok{HH\_size =}\NormalTok{ temp }\SpecialCharTok{+}\NormalTok{ visitor }\SpecialCharTok{+}\NormalTok{ kids) }\SpecialCharTok{\%\textgreater{}\%}
  \FunctionTok{select}\NormalTok{(}\SpecialCharTok{{-}}\NormalTok{temp)}

\CommentTok{\# Healthcare}
\NormalTok{df.NL598 }\OtherTok{\textless{}{-}}\NormalTok{ df.NL598 }\SpecialCharTok{\%\textgreater{}\%}
  \FunctionTok{mutate}\NormalTok{(}\AttributeTok{healthcare =}\NormalTok{ D28 }\SpecialCharTok{/}\NormalTok{ (net\_income }\SpecialCharTok{+}\NormalTok{ A4)) }\SpecialCharTok{\%\textgreater{}\%}
  \FunctionTok{mutate}\NormalTok{(}\AttributeTok{healthcare\_shock =} \FunctionTok{ifelse}\NormalTok{(healthcare }\SpecialCharTok{\textgreater{}} \FunctionTok{quantile}\NormalTok{(healthcare, }\AttributeTok{probs =} \FunctionTok{c}\NormalTok{(}\FloatTok{0.66}\NormalTok{)), }\DecValTok{1}\NormalTok{, }\DecValTok{0}\NormalTok{))}
\end{Highlighting}
\end{Shaded}

\begin{Shaded}
\begin{Highlighting}[]
\CommentTok{\# land \& pacht}
\NormalTok{df.land }\OtherTok{\textless{}{-}} \FunctionTok{read.csv}\NormalTok{(}\StringTok{"data/land.csv"}\NormalTok{) }\SpecialCharTok{\%\textgreater{}\%}
  \FunctionTok{subset}\NormalTok{(}\SpecialCharTok{!}\FunctionTok{is.na}\NormalTok{(pacht)) }\SpecialCharTok{\%\textgreater{}\%}
  \FunctionTok{select}\NormalTok{(provincie, pacht) }\SpecialCharTok{\%\textgreater{}\%}
  \FunctionTok{as.data.frame}\NormalTok{()}

\NormalTok{df.NL598 }\OtherTok{\textless{}{-}}\NormalTok{ df.NL598 }\SpecialCharTok{\%\textgreater{}\%}
  \FunctionTok{inner\_join}\NormalTok{(df.land, }\AttributeTok{by =} \StringTok{"provincie"}\NormalTok{)}

\CommentTok{\# Wealth}
\NormalTok{df.NL598 }\OtherTok{\textless{}{-}}\NormalTok{ df.NL598 }\SpecialCharTok{\%\textgreater{}\%}
  \FunctionTok{mutate}\NormalTok{(}\AttributeTok{home\_value =}\NormalTok{ home\_value }\SpecialCharTok{*} \DecValTok{1000}\NormalTok{) }\SpecialCharTok{\%\textgreater{}\%}
  \FunctionTok{mutate}\NormalTok{(}\AttributeTok{land\_value =}\NormalTok{ land\_value }\SpecialCharTok{*} \DecValTok{1000}\NormalTok{) }\SpecialCharTok{\%\textgreater{}\%}
  \FunctionTok{mutate}\NormalTok{(}\AttributeTok{npvlife =}\NormalTok{ npvlife }\SpecialCharTok{*} \DecValTok{1000}\NormalTok{) }\SpecialCharTok{\%\textgreater{}\%}
  \FunctionTok{mutate}\NormalTok{(}\AttributeTok{npvpension =}\NormalTok{ npvpension }\SpecialCharTok{*} \DecValTok{1000}\NormalTok{)}
\end{Highlighting}
\end{Shaded}

\hypertarget{nl-700-unemployed}{%
\subsection{NL 700 unemployed}\label{nl-700-unemployed}}

\begin{Shaded}
\begin{Highlighting}[]
\NormalTok{df.NL700 }\OtherTok{\textless{}{-}} \FunctionTok{read.csv}\NormalTok{(}\StringTok{"data/NL700.csv"}\NormalTok{) }\SpecialCharTok{\%\textgreater{}\%} \FunctionTok{select}\NormalTok{(}\SpecialCharTok{{-}}\NormalTok{X)}

\CommentTok{\# towards yearly figures}
\NormalTok{df.NL700 }\OtherTok{\textless{}{-}}\NormalTok{ df.NL700 }\SpecialCharTok{\%\textgreater{}\%}
  \FunctionTok{mutate}\NormalTok{(}\AttributeTok{support =}\NormalTok{ support }\SpecialCharTok{*} \DecValTok{52}\NormalTok{) }\SpecialCharTok{\%\textgreater{}\%}
  \FunctionTok{mutate}\NormalTok{(}\AttributeTok{public\_employment =}\NormalTok{ public\_employment }\SpecialCharTok{*} \DecValTok{52}\NormalTok{) }\SpecialCharTok{\%\textgreater{}\%}
  \FunctionTok{mutate}\NormalTok{(}\AttributeTok{fuel\_subsidy =}\NormalTok{ fuel\_subsidy }\SpecialCharTok{*} \DecValTok{52}\NormalTok{) }\SpecialCharTok{\%\textgreater{}\%}
  \FunctionTok{mutate}\NormalTok{(}\AttributeTok{food\_distr =}\NormalTok{ food\_distr }\SpecialCharTok{*} \DecValTok{52}\NormalTok{) }\SpecialCharTok{\%\textgreater{}\%}
  \FunctionTok{mutate}\NormalTok{(}\AttributeTok{income.HH.head =}\NormalTok{ income.HH.head }\SpecialCharTok{*} \DecValTok{52}\NormalTok{) }\SpecialCharTok{\%\textgreater{}\%}
  \FunctionTok{mutate}\NormalTok{(}\AttributeTok{income.own.company =}\NormalTok{ income.own.company }\SpecialCharTok{*} \DecValTok{52}\NormalTok{) }\SpecialCharTok{\%\textgreater{}\%}
  \FunctionTok{mutate}\NormalTok{(}\AttributeTok{other.HH.income =}\NormalTok{ other.HH.income }\SpecialCharTok{*} \DecValTok{52}\NormalTok{) }\SpecialCharTok{\%\textgreater{}\%}
  \FunctionTok{mutate}\NormalTok{(}\AttributeTok{gifts =}\NormalTok{ gifts }\SpecialCharTok{*} \DecValTok{52}\NormalTok{) }\SpecialCharTok{\%\textgreater{}\%}
  \FunctionTok{mutate}\NormalTok{(}\AttributeTok{stocks =}\NormalTok{ stocks }\SpecialCharTok{*} \DecValTok{52}\NormalTok{) }\SpecialCharTok{\%\textgreater{}\%}
  \FunctionTok{mutate}\NormalTok{(}\AttributeTok{income =}\NormalTok{ income }\SpecialCharTok{*} \DecValTok{52}\NormalTok{) }\SpecialCharTok{\%\textgreater{}\%}
  \FunctionTok{mutate}\NormalTok{(}\AttributeTok{food =}\NormalTok{ food }\SpecialCharTok{*} \DecValTok{52}\NormalTok{) }\SpecialCharTok{\%\textgreater{}\%}
  \FunctionTok{mutate}\NormalTok{(}\AttributeTok{housing =}\NormalTok{ housing }\SpecialCharTok{*} \DecValTok{52}\NormalTok{) }\SpecialCharTok{\%\textgreater{}\%}
  \FunctionTok{mutate}\NormalTok{(}\AttributeTok{fire =}\NormalTok{ fire }\SpecialCharTok{*} \DecValTok{52}\NormalTok{) }\SpecialCharTok{\%\textgreater{}\%}
  \FunctionTok{mutate}\NormalTok{(}\AttributeTok{clothing =}\NormalTok{ clothing }\SpecialCharTok{*} \DecValTok{52}\NormalTok{) }\SpecialCharTok{\%\textgreater{}\%}
  \FunctionTok{mutate}\NormalTok{(}\AttributeTok{insurance =}\NormalTok{ insurance }\SpecialCharTok{*} \DecValTok{52}\NormalTok{) }\SpecialCharTok{\%\textgreater{}\%}
  \FunctionTok{mutate}\NormalTok{(}\AttributeTok{other =}\NormalTok{ other }\SpecialCharTok{*} \DecValTok{52}\NormalTok{) }\SpecialCharTok{\%\textgreater{}\%}
  \FunctionTok{mutate}\NormalTok{(}\AttributeTok{consumption =}\NormalTok{ consumption }\SpecialCharTok{*} \DecValTok{52}\NormalTok{)}

\CommentTok{\# add financial margin and net income}
\NormalTok{df.NL700 }\OtherTok{\textless{}{-}}\NormalTok{ df.NL700 }\SpecialCharTok{\%\textgreater{}\%}
  \FunctionTok{mutate}\NormalTok{(}\AttributeTok{housing =}\NormalTok{ housing }\SpecialCharTok{+}\NormalTok{ fire) }\SpecialCharTok{\%\textgreater{}\%}
  \FunctionTok{mutate}\NormalTok{(}\AttributeTok{fm =}\NormalTok{ income }\SpecialCharTok{{-}}\NormalTok{ stocks }\SpecialCharTok{{-}}\NormalTok{ food }\SpecialCharTok{{-}}\NormalTok{ housing }\SpecialCharTok{{-}}\NormalTok{ clothing) }\SpecialCharTok{\%\textgreater{}\%}
  \FunctionTok{mutate}\NormalTok{(}\AttributeTok{net\_income =}\NormalTok{ support }\SpecialCharTok{+}\NormalTok{ public\_employment }\SpecialCharTok{+}\NormalTok{ fuel\_subsidy }\SpecialCharTok{+}\NormalTok{ food\_distr }\SpecialCharTok{+}\NormalTok{ income.HH.head }\SpecialCharTok{+}\NormalTok{ income.own.company }\SpecialCharTok{+}\NormalTok{ other.HH.income) }\SpecialCharTok{\%\textgreater{}\%} 
  \FunctionTok{mutate}\NormalTok{(}\AttributeTok{social\_security =}\NormalTok{ support }\SpecialCharTok{+}\NormalTok{ public\_employment }\SpecialCharTok{+}\NormalTok{ fuel\_subsidy }\SpecialCharTok{+}\NormalTok{ food\_distr) }\SpecialCharTok{\%\textgreater{}\%}
  \FunctionTok{mutate}\NormalTok{(}\AttributeTok{HHincome =}\NormalTok{ income.HH.head }\SpecialCharTok{+}\NormalTok{ income.own.company }\SpecialCharTok{+}\NormalTok{ other.HH.income)}
\end{Highlighting}
\end{Shaded}

\hypertarget{amsterdam-1934}{%
\subsection{Amsterdam 1934}\label{amsterdam-1934}}

\begin{Shaded}
\begin{Highlighting}[]
\NormalTok{df.A1934 }\OtherTok{\textless{}{-}} \FunctionTok{read.csv}\NormalTok{(}\StringTok{"data/Amsterdam1934.csv"}\NormalTok{) }\SpecialCharTok{\%\textgreater{}\%} 
  \FunctionTok{mutate}\NormalTok{(}\AttributeTok{HHincome =}\NormalTok{ Man }\SpecialCharTok{+}\NormalTok{ Vrouw }\SpecialCharTok{+}\NormalTok{ Kinderen) }\SpecialCharTok{\%\textgreater{}\%}
  \FunctionTok{mutate}\NormalTok{(}\AttributeTok{social\_security =}\NormalTok{ Werkloosheidssteun }\SpecialCharTok{+} \StringTok{\textasciigrave{}}\AttributeTok{Andere.steun}\StringTok{\textasciigrave{}} \SpecialCharTok{+}\NormalTok{ Brandstoffentoeslag) }\SpecialCharTok{\%\textgreater{}\%}
  \FunctionTok{mutate}\NormalTok{(}\AttributeTok{financial =} \StringTok{\textasciigrave{}}\AttributeTok{Invaliditeits..of.weezenrente..Pensioen.e.d.}\StringTok{\textasciigrave{}}\NormalTok{) }\SpecialCharTok{\%\textgreater{}\%}
  \FunctionTok{mutate}\NormalTok{(}\AttributeTok{other\_income =}\NormalTok{ Onderhuur }\SpecialCharTok{+}\NormalTok{ Overige) }\SpecialCharTok{\%\textgreater{}\%}
  \FunctionTok{mutate}\NormalTok{(}\AttributeTok{gifts =} \StringTok{\textasciigrave{}}\AttributeTok{Diverse.voorwerpen}\StringTok{\textasciigrave{}}\SpecialCharTok{+}\NormalTok{ Schoolvoeding }\SpecialCharTok{+}\NormalTok{ Schoolkleding) }\SpecialCharTok{\%\textgreater{}\%}
  \FunctionTok{mutate}\NormalTok{(}\AttributeTok{credit =} \StringTok{\textasciigrave{}}\AttributeTok{Geleend.of.uitbeleening}\StringTok{\textasciigrave{}}\NormalTok{) }\SpecialCharTok{\%\textgreater{}\%}
  \FunctionTok{mutate}\NormalTok{(}\AttributeTok{income =} \FunctionTok{select}\NormalTok{(., HHincome, social\_security,financial,other\_income, gifts) }\SpecialCharTok{\%\textgreater{}\%} \FunctionTok{rowSums}\NormalTok{(}\AttributeTok{na.rm =} \ConstantTok{TRUE}\NormalTok{)) }\SpecialCharTok{\%\textgreater{}\%}
  \FunctionTok{mutate}\NormalTok{(}\AttributeTok{food =}\NormalTok{ Food) }\SpecialCharTok{\%\textgreater{}\%} \FunctionTok{select}\NormalTok{(}\SpecialCharTok{{-}}\NormalTok{Food) }\SpecialCharTok{\%\textgreater{}\%}
  \FunctionTok{mutate}\NormalTok{(}\AttributeTok{shelter =}\NormalTok{ Rent }\SpecialCharTok{+} \StringTok{\textasciigrave{}}\AttributeTok{Gas.El.Fuel}\StringTok{\textasciigrave{}}\NormalTok{) }\SpecialCharTok{\%\textgreater{}\%} \FunctionTok{select}\NormalTok{(}\SpecialCharTok{{-}}\NormalTok{Rent, }\SpecialCharTok{{-}}\StringTok{\textasciigrave{}}\AttributeTok{Gas.El.Fuel}\StringTok{\textasciigrave{}}\NormalTok{) }\SpecialCharTok{\%\textgreater{}\%}
  \FunctionTok{mutate}\NormalTok{(}\AttributeTok{clothing =}\NormalTok{ Clothing }\SpecialCharTok{+}\NormalTok{ Footwear) }\SpecialCharTok{\%\textgreater{}\%} \FunctionTok{select}\NormalTok{(}\SpecialCharTok{{-}}\NormalTok{Clothing, }\SpecialCharTok{{-}}\NormalTok{Footwear) }\SpecialCharTok{\%\textgreater{}\%}
  \FunctionTok{mutate}\NormalTok{(}\AttributeTok{insurance =} \StringTok{\textasciigrave{}}\AttributeTok{Funeral.Health}\StringTok{\textasciigrave{}}\SpecialCharTok{+}\NormalTok{Insurance) }\SpecialCharTok{\%\textgreater{}\%}
  \FunctionTok{mutate}\NormalTok{(}\AttributeTok{other\_cons =}\NormalTok{ Other) }\SpecialCharTok{\%\textgreater{}\%} \FunctionTok{select}\NormalTok{(}\SpecialCharTok{{-}}\NormalTok{Other) }\SpecialCharTok{\%\textgreater{}\%}
  \FunctionTok{mutate}\NormalTok{(}\AttributeTok{consumption =} \FunctionTok{select}\NormalTok{(., food, shelter, clothing,insurance,other\_cons) }\SpecialCharTok{\%\textgreater{}\%} \FunctionTok{rowSums}\NormalTok{(}\AttributeTok{na.rm =} \ConstantTok{TRUE}\NormalTok{)) }\SpecialCharTok{\%\textgreater{}\%}
  \FunctionTok{mutate}\NormalTok{(}\AttributeTok{fm =}\NormalTok{ income }\SpecialCharTok{{-}}\NormalTok{ consumption) }\SpecialCharTok{\%\textgreater{}\%}
  \FunctionTok{mutate\_at}\NormalTok{(}\FunctionTok{vars}\NormalTok{(income, consumption, HHincome, social\_security, financial, other\_income, gifts, }
\NormalTok{                 credit,fm, food, shelter, clothing, insurance, other\_cons), }\FunctionTok{funs}\NormalTok{(. }\SpecialCharTok{/} \StringTok{\textasciigrave{}}\AttributeTok{X.Weeks}\StringTok{\textasciigrave{}} \SpecialCharTok{*} \DecValTok{52}\NormalTok{))}
\end{Highlighting}
\end{Shaded}

\hypertarget{den-haag-1932}{%
\subsection{Den Haag 1932}\label{den-haag-1932}}

\begin{Shaded}
\begin{Highlighting}[]
\NormalTok{df.DH1932 }\OtherTok{\textless{}{-}} \FunctionTok{read.csv}\NormalTok{(}\StringTok{"data/DH1932.csv"}\NormalTok{) }\SpecialCharTok{\%\textgreater{}\%} 
\FunctionTok{mutate}\NormalTok{(}\AttributeTok{HHincome =}\NormalTok{ Man\_loon }\SpecialCharTok{+}\NormalTok{ Vrouw\_loon }\SpecialCharTok{+}\NormalTok{ Zoonloon }\SpecialCharTok{+}\NormalTok{ Dochter\_loon) }\SpecialCharTok{\%\textgreater{}\%}
  \FunctionTok{mutate}\NormalTok{(}\AttributeTok{social\_security =}\NormalTok{ Totaal\_Steun) }\SpecialCharTok{\%\textgreater{}\%}
  \FunctionTok{mutate}\NormalTok{(}\AttributeTok{financial =}\NormalTok{ Ouderdomsrente }\SpecialCharTok{+}\NormalTok{ Dividend }\SpecialCharTok{+}\NormalTok{ Restitutie }\SpecialCharTok{+} \StringTok{\textasciigrave{}}\AttributeTok{Kerst.uitkering}\StringTok{\textasciigrave{}}\NormalTok{) }\SpecialCharTok{\%\textgreater{}\%}
  \FunctionTok{mutate}\NormalTok{(}\AttributeTok{other =} \StringTok{\textasciigrave{}}\AttributeTok{Overig.inkomen}\StringTok{\textasciigrave{}}\NormalTok{) }\SpecialCharTok{\%\textgreater{}\%}
  \FunctionTok{mutate}\NormalTok{(}\AttributeTok{gifts =}\NormalTok{ Voeding }\SpecialCharTok{+}\NormalTok{ Kleding }\SpecialCharTok{+}\NormalTok{ Schoeisel }\SpecialCharTok{+}\NormalTok{ Huisraad }\SpecialCharTok{+}\NormalTok{ Rookwaren }\SpecialCharTok{+}\NormalTok{ Overig) }\SpecialCharTok{\%\textgreater{}\%}
  \FunctionTok{mutate}\NormalTok{(}\AttributeTok{stocks =}\NormalTok{ Voedsel }\SpecialCharTok{+}\NormalTok{ Brandstof) }\SpecialCharTok{\%\textgreater{}\%}
  \FunctionTok{mutate}\NormalTok{(}\AttributeTok{credit =} \StringTok{\textasciigrave{}}\AttributeTok{Lening.1}\StringTok{\textasciigrave{}}\NormalTok{) }\SpecialCharTok{\%\textgreater{}\%}
  \FunctionTok{mutate}\NormalTok{(}\AttributeTok{income =} \FunctionTok{select}\NormalTok{(., HHincome, social\_security,financial,other, gifts, stocks) }\SpecialCharTok{\%\textgreater{}\%} \FunctionTok{rowSums}\NormalTok{(}\AttributeTok{na.rm =} \ConstantTok{TRUE}\NormalTok{)) }\SpecialCharTok{\%\textgreater{}\%}
  \FunctionTok{mutate}\NormalTok{(}\AttributeTok{consumption =}\NormalTok{ Uitgaven) }\SpecialCharTok{\%\textgreater{}\%}
  \FunctionTok{mutate}\NormalTok{(}\AttributeTok{fm =}\NormalTok{ income }\SpecialCharTok{{-}}\NormalTok{ consumption) }\SpecialCharTok{\%\textgreater{}\%}
  \FunctionTok{mutate\_at}\NormalTok{(}\FunctionTok{vars}\NormalTok{(income, consumption, HHincome, social\_security, financial, other, gifts, stocks, credit,fm), }\FunctionTok{funs}\NormalTok{(. }\SpecialCharTok{/} \StringTok{\textasciigrave{}}\AttributeTok{X.weken}\StringTok{\textasciigrave{}} \SpecialCharTok{*} \DecValTok{52}\NormalTok{))}
\end{Highlighting}
\end{Shaded}

\hypertarget{den-haag-1935}{%
\subsection{Den Haag 1935}\label{den-haag-1935}}

\begin{Shaded}
\begin{Highlighting}[]
\NormalTok{df.DH1935 }\OtherTok{\textless{}{-}} \FunctionTok{read.csv}\NormalTok{(}\StringTok{"data/DH1935.csv"}\NormalTok{) }\SpecialCharTok{\%\textgreater{}\%} 
  \FunctionTok{mutate}\NormalTok{(}\AttributeTok{income =}\NormalTok{ Ontvangsten }\SpecialCharTok{+} \StringTok{\textasciigrave{}}\AttributeTok{Waarde.van.schenkingen.in.natura}\StringTok{\textasciigrave{}}\NormalTok{) }\SpecialCharTok{\%\textgreater{}\%}
  \FunctionTok{mutate}\NormalTok{(}\AttributeTok{kind =} \StringTok{\textasciigrave{}}\AttributeTok{Waarde.van.schenkingen.in.natura}\StringTok{\textasciigrave{}}\NormalTok{) }\SpecialCharTok{\%\textgreater{}\%}
  \FunctionTok{mutate}\NormalTok{(}\AttributeTok{social\_security =} \StringTok{\textasciigrave{}}\AttributeTok{steunbedrag.per.week.bij.aanvang.onderzoek}\StringTok{\textasciigrave{}}\NormalTok{) }\SpecialCharTok{\%\textgreater{}\%}
  \FunctionTok{mutate}\NormalTok{(}\AttributeTok{consumption =}\NormalTok{ Uitgaven) }\SpecialCharTok{\%\textgreater{}\%}
  \FunctionTok{mutate}\NormalTok{(}\AttributeTok{fm =}\NormalTok{ income }\SpecialCharTok{{-}}\NormalTok{ consumption) }\SpecialCharTok{\%\textgreater{}\%}
  \FunctionTok{mutate\_at}\NormalTok{(}\FunctionTok{vars}\NormalTok{(income, consumption, fm, social\_security, kind), }\FunctionTok{funs}\NormalTok{(. }\SpecialCharTok{*} \DecValTok{52}\NormalTok{))}
\end{Highlighting}
\end{Shaded}

\hypertarget{figures}{%
\section{Figures}\label{figures}}

\hypertarget{figure-1}{%
\subsection{Figure 1}\label{figure-1}}

\begin{Shaded}
\begin{Highlighting}[]
\NormalTok{fig1 }\OtherTok{\textless{}{-}} \FunctionTok{read.csv}\NormalTok{(}\StringTok{"data/savings.csv"}\NormalTok{) }\SpecialCharTok{\%\textgreater{}\%}
  \FunctionTok{subset}\NormalTok{(year}\SpecialCharTok{\textless{}}\DecValTok{1939}\NormalTok{) }\SpecialCharTok{\%\textgreater{}\%}
  \FunctionTok{subset}\NormalTok{(year }\SpecialCharTok{\textgreater{}} \DecValTok{1899}\NormalTok{) }\SpecialCharTok{\%\textgreater{}\%}
  \CommentTok{\# gather(asset, value, "savings", factor\_key=TRUE) \%\textgreater{}\%}
  \FunctionTok{ggplot}\NormalTok{(}\FunctionTok{aes}\NormalTok{(}\AttributeTok{x=}\NormalTok{year, }\AttributeTok{y=}\NormalTok{savings)) }\SpecialCharTok{+} \FunctionTok{geom\_point}\NormalTok{(}\AttributeTok{shape=}\DecValTok{1}\NormalTok{) }\SpecialCharTok{+}
  \FunctionTok{geom\_point}\NormalTok{()  }\SpecialCharTok{+}
  \FunctionTok{scale\_color\_manual}\NormalTok{(}\AttributeTok{name =} \StringTok{""}\NormalTok{, }\AttributeTok{labels =} \FunctionTok{c}\NormalTok{(}\StringTok{""}\NormalTok{)) }\SpecialCharTok{+}
  \FunctionTok{xlab}\NormalTok{(}\StringTok{"Jaar"}\NormalTok{) }\SpecialCharTok{+}  \FunctionTok{ylim}\NormalTok{(}\DecValTok{0}\NormalTok{,}\DecValTok{350}\NormalTok{) }\SpecialCharTok{+} \FunctionTok{scale\_x\_continuous}\NormalTok{(}\AttributeTok{breaks =} \FunctionTok{seq}\NormalTok{(}\DecValTok{1900}\NormalTok{, }\DecValTok{1940}\NormalTok{, }\AttributeTok{by=}\DecValTok{10}\NormalTok{), }\AttributeTok{limits=}\FunctionTok{c}\NormalTok{(}\DecValTok{1900}\NormalTok{,}\DecValTok{1940}\NormalTok{))}\SpecialCharTok{+}
  \FunctionTok{guides}\NormalTok{(}\AttributeTok{colour =} \FunctionTok{guide\_legend}\NormalTok{(}\AttributeTok{reverse=}\NormalTok{T)) }\SpecialCharTok{+} 
  \FunctionTok{ylab}\NormalTok{(}\StringTok{"1936 Guilders"}\NormalTok{)  }\SpecialCharTok{+} \FunctionTok{xlab}\NormalTok{(}\StringTok{"year"}\NormalTok{)  }\SpecialCharTok{+} \FunctionTok{labs}\NormalTok{(}\AttributeTok{title =} \StringTok{"Household real savings per capita "}\NormalTok{) }\SpecialCharTok{+}
  \FunctionTok{theme\_bw}\NormalTok{() }

\NormalTok{fig2 }\OtherTok{\textless{}{-}} \FunctionTok{read.csv}\NormalTok{(}\StringTok{"data/unemployment.csv"}\NormalTok{)  }\SpecialCharTok{\%\textgreater{}\%}
  \FunctionTok{subset}\NormalTok{(jaar}\SpecialCharTok{\textless{}}\DecValTok{1939}\NormalTok{) }\SpecialCharTok{\%\textgreater{}\%}
  \FunctionTok{mutate}\NormalTok{(}\AttributeTok{unemp =}\NormalTok{ unemp}\SpecialCharTok{/}\DecValTok{100}\NormalTok{) }\SpecialCharTok{\%\textgreater{}\%}
  \FunctionTok{as.data.frame}\NormalTok{() }\SpecialCharTok{\%\textgreater{}\%}
  \FunctionTok{ggplot}\NormalTok{(}\FunctionTok{aes}\NormalTok{(}\AttributeTok{x=}\NormalTok{jaar, }\AttributeTok{y=}\NormalTok{unemp)) }\SpecialCharTok{+} 
  \FunctionTok{geom\_point}\NormalTok{()  }\SpecialCharTok{+}
  \FunctionTok{scale\_color\_manual}\NormalTok{(}\AttributeTok{name =} \StringTok{""}\NormalTok{, }\AttributeTok{labels =} \FunctionTok{c}\NormalTok{(}\StringTok{""}\NormalTok{)) }\SpecialCharTok{+}
  \FunctionTok{xlab}\NormalTok{(}\StringTok{"Jaar"}\NormalTok{) }\SpecialCharTok{+}  \FunctionTok{scale\_x\_continuous}\NormalTok{(}\AttributeTok{breaks =} \FunctionTok{seq}\NormalTok{(}\DecValTok{1900}\NormalTok{, }\DecValTok{1940}\NormalTok{, }\AttributeTok{by=}\DecValTok{10}\NormalTok{), }\AttributeTok{limits=}\FunctionTok{c}\NormalTok{(}\DecValTok{1900}\NormalTok{,}\DecValTok{1940}\NormalTok{))}\SpecialCharTok{+} 
  \FunctionTok{scale\_y\_continuous}\NormalTok{(}\AttributeTok{labels =} \FunctionTok{percent\_format}\NormalTok{(}\AttributeTok{accuracy =} \DecValTok{1}\NormalTok{), }\AttributeTok{breaks =} \FunctionTok{seq}\NormalTok{(}\DecValTok{0}\NormalTok{, }\FloatTok{0.2}\NormalTok{, }\AttributeTok{by =} \FloatTok{0.05}\NormalTok{), }\AttributeTok{limits=} \FunctionTok{c}\NormalTok{(}\DecValTok{0}\NormalTok{,}\FloatTok{0.20}\NormalTok{)) }\SpecialCharTok{+}
  \FunctionTok{guides}\NormalTok{(}\AttributeTok{colour =} \FunctionTok{guide\_legend}\NormalTok{(}\AttributeTok{reverse=}\NormalTok{T)) }\SpecialCharTok{+} 
  \FunctionTok{ylab}\NormalTok{(}\StringTok{""}\NormalTok{)    }\SpecialCharTok{+} \FunctionTok{xlab}\NormalTok{(}\StringTok{"year"}\NormalTok{) }\SpecialCharTok{+}  \FunctionTok{labs}\NormalTok{(}\AttributeTok{title =} \StringTok{"Unemployment"}\NormalTok{) }\SpecialCharTok{+}
  \FunctionTok{theme\_bw}\NormalTok{() }

\NormalTok{fig3 }\OtherTok{\textless{}{-}} \FunctionTok{read.csv}\NormalTok{(}\StringTok{"data/hhbudget.csv"}\NormalTok{) }\SpecialCharTok{\%\textgreater{}\%}
  \FunctionTok{subset}\NormalTok{(year}\SpecialCharTok{\textless{}}\DecValTok{1939}\NormalTok{) }\SpecialCharTok{\%\textgreater{}\%}
  \FunctionTok{as.data.frame}\NormalTok{() }\SpecialCharTok{\%\textgreater{}\%}
  \FunctionTok{ggplot}\NormalTok{(}\FunctionTok{aes}\NormalTok{(}\AttributeTok{x=}\NormalTok{year, }\AttributeTok{y=}\NormalTok{rw)) }\SpecialCharTok{+} \FunctionTok{geom\_point}\NormalTok{(}\AttributeTok{shape=}\DecValTok{1}\NormalTok{) }\SpecialCharTok{+}
  \FunctionTok{geom\_point}\NormalTok{()  }\SpecialCharTok{+}
  \FunctionTok{scale\_color\_manual}\NormalTok{(}\AttributeTok{name =} \StringTok{""}\NormalTok{, }\AttributeTok{labels =} \FunctionTok{c}\NormalTok{(}\StringTok{""}\NormalTok{)) }\SpecialCharTok{+}
  \FunctionTok{xlab}\NormalTok{(}\StringTok{"year"}\NormalTok{) }\SpecialCharTok{+}  \FunctionTok{scale\_x\_continuous}\NormalTok{(}\AttributeTok{breaks =} \FunctionTok{seq}\NormalTok{(}\DecValTok{1900}\NormalTok{, }\DecValTok{1940}\NormalTok{, }\AttributeTok{by=}\DecValTok{10}\NormalTok{), }\AttributeTok{limits=}\FunctionTok{c}\NormalTok{(}\DecValTok{1900}\NormalTok{,}\DecValTok{1940}\NormalTok{))}\SpecialCharTok{+}
  \FunctionTok{scale\_y\_continuous}\NormalTok{(}\AttributeTok{breaks =} \FunctionTok{seq}\NormalTok{(}\DecValTok{0}\NormalTok{, }\DecValTok{50}\NormalTok{, }\AttributeTok{by =} \DecValTok{10}\NormalTok{), }\AttributeTok{limits=} \FunctionTok{c}\NormalTok{(}\DecValTok{0}\NormalTok{,}\DecValTok{50}\NormalTok{)) }\SpecialCharTok{+}
    \FunctionTok{guides}\NormalTok{(}\AttributeTok{colour =} \FunctionTok{guide\_legend}\NormalTok{(}\AttributeTok{reverse=}\NormalTok{T)) }\SpecialCharTok{+} 
  \FunctionTok{ylab}\NormalTok{(}\StringTok{"Guilders"}\NormalTok{)    }\SpecialCharTok{+} \FunctionTok{labs}\NormalTok{(}\AttributeTok{title =} \StringTok{"Real wages building labourer"}\NormalTok{) }\SpecialCharTok{+}
  \FunctionTok{theme\_bw}\NormalTok{() }

\NormalTok{fig4 }\OtherTok{\textless{}{-}} \FunctionTok{read.csv}\NormalTok{(}\StringTok{"data/hhbudgetprimary.csv"}\NormalTok{)  }\SpecialCharTok{\%\textgreater{}\%}
  \FunctionTok{subset}\NormalTok{(year}\SpecialCharTok{\textless{}}\DecValTok{1939}\NormalTok{) }\SpecialCharTok{\%\textgreater{}\%}
  \FunctionTok{as.data.frame}\NormalTok{() }\SpecialCharTok{\%\textgreater{}\%} \FunctionTok{select}\NormalTok{(year, group2, percentage) }\SpecialCharTok{\%\textgreater{}\%}
  \FunctionTok{ggplot}\NormalTok{(}\FunctionTok{aes}\NormalTok{(}\AttributeTok{x=}\NormalTok{year, }\AttributeTok{y=}\NormalTok{percentage, }\AttributeTok{group=}\NormalTok{group2)) }\SpecialCharTok{+}
  \FunctionTok{scale\_shape\_manual}\NormalTok{(}\AttributeTok{values=}\FunctionTok{c}\NormalTok{(}\DecValTok{1}\NormalTok{, }\DecValTok{2}\NormalTok{, }\DecValTok{3}\NormalTok{)) }\SpecialCharTok{+}
  \FunctionTok{geom\_point}\NormalTok{(}\FunctionTok{aes}\NormalTok{(}\AttributeTok{shape =}\NormalTok{ group2))  }\SpecialCharTok{+}
  \FunctionTok{xlab}\NormalTok{(}\StringTok{"Jaar"}\NormalTok{) }\SpecialCharTok{+}  \FunctionTok{scale\_x\_continuous}\NormalTok{(}\AttributeTok{breaks =} \FunctionTok{seq}\NormalTok{(}\DecValTok{1900}\NormalTok{, }\DecValTok{1940}\NormalTok{, }\AttributeTok{by=}\DecValTok{10}\NormalTok{), }\AttributeTok{limits=}\FunctionTok{c}\NormalTok{(}\DecValTok{1900}\NormalTok{,}\DecValTok{1940}\NormalTok{))}\SpecialCharTok{+} 
  \FunctionTok{scale\_y\_continuous}\NormalTok{(}\AttributeTok{labels =} \FunctionTok{percent\_format}\NormalTok{(}\AttributeTok{accuracy =} \DecValTok{1}\NormalTok{), }\AttributeTok{breaks =} \FunctionTok{seq}\NormalTok{(}\DecValTok{0}\NormalTok{, }\DecValTok{1}\NormalTok{, }\AttributeTok{by =} \FloatTok{0.2}\NormalTok{), }\AttributeTok{limits=} \FunctionTok{c}\NormalTok{(}\DecValTok{0}\NormalTok{,}\DecValTok{1}\NormalTok{)) }\SpecialCharTok{+}
  \FunctionTok{guides}\NormalTok{(}\AttributeTok{colour =} \FunctionTok{guide\_legend}\NormalTok{(}\AttributeTok{reverse=}\NormalTok{T)) }\SpecialCharTok{+} \FunctionTok{guides}\NormalTok{(}\AttributeTok{color=}\FunctionTok{guide\_legend}\NormalTok{(}\StringTok{"labour type"}\NormalTok{)) }\SpecialCharTok{+}
  \FunctionTok{ylab}\NormalTok{(}\StringTok{""}\NormalTok{) }\SpecialCharTok{+} \FunctionTok{xlab}\NormalTok{(}\StringTok{"year"}\NormalTok{)    }\SpecialCharTok{+} \FunctionTok{labs}\NormalTok{(}\AttributeTok{title =} \StringTok{"Share of primary expenses"}\NormalTok{, }\AttributeTok{shape =} \StringTok{"Labour type"}\NormalTok{) }\SpecialCharTok{+} \FunctionTok{scale\_size\_area}\NormalTok{(}\AttributeTok{max\_size =} \DecValTok{20}\NormalTok{) }\SpecialCharTok{+}
  \FunctionTok{theme\_bw}\NormalTok{() }\SpecialCharTok{+} \FunctionTok{theme}\NormalTok{(}\AttributeTok{legend.position =} \FunctionTok{c}\NormalTok{(}\FloatTok{0.25}\NormalTok{, }\FloatTok{0.25}\NormalTok{),}\AttributeTok{legend.box.margin =} \FunctionTok{margin}\NormalTok{(}\AttributeTok{t =} \FloatTok{0.5}\NormalTok{, }\AttributeTok{unit=}\StringTok{\textquotesingle{}cm\textquotesingle{}}\NormalTok{), }
                     \AttributeTok{legend.margin =} \FunctionTok{margin}\NormalTok{(}\AttributeTok{t =} \SpecialCharTok{{-}}\FloatTok{0.5}\NormalTok{, }\AttributeTok{unit=}\StringTok{\textquotesingle{}cm\textquotesingle{}}\NormalTok{), }
                     \AttributeTok{legend.background =} \FunctionTok{element\_rect}\NormalTok{(}\AttributeTok{fill =} \StringTok{"white"}\NormalTok{, }\AttributeTok{color =} \StringTok{"black"}\NormalTok{)) }

\FunctionTok{ggarrange}\NormalTok{(fig2, fig3, fig4, fig1,}
              \AttributeTok{labels =} \FunctionTok{c}\NormalTok{(}\StringTok{"A"}\NormalTok{, }\StringTok{"B"}\NormalTok{, }\StringTok{"C"}\NormalTok{, }\StringTok{"D"}\NormalTok{),}
              \AttributeTok{ncol =} \DecValTok{2}\NormalTok{, }\AttributeTok{nrow =} \DecValTok{2}\NormalTok{) }
\end{Highlighting}
\end{Shaded}

\includegraphics{howitsmade_files/figure-latex/fig1-1.pdf}

\begin{Shaded}
\begin{Highlighting}[]
\FunctionTok{rm}\NormalTok{(fig1, fig2, fig3, fig4)}
\end{Highlighting}
\end{Shaded}

\hypertarget{figure-4}{%
\subsection{Figure 4}\label{figure-4}}

\begin{verbatim}
## Reading layer `shapefile598' from data source 
##   `/Users/timvdvalk/Documents/Economics/finkwets/R/howitsmade/data/shapefile598.shp' 
##   using driver `ESRI Shapefile'
## replacing null geometries with empty geometries
## Simple feature collection with 1125 features and 6 fields (with 4 geometries empty)
## Geometry type: POLYGON
## Dimension:     XY
## Bounding box:  xmin: 13240 ymin: 306980 xmax: 278070 ymax: 618430
## CRS:           NA
\end{verbatim}

\includegraphics{howitsmade_files/figure-latex/fig4-1.pdf}

\begin{verbatim}
## Reading layer `shapefile700' from data source 
##   `/Users/timvdvalk/Documents/Economics/finkwets/R/howitsmade/data/shapefile700.shp' 
##   using driver `ESRI Shapefile'
## Simple feature collection with 1121 features and 7 fields
## Geometry type: POLYGON
## Dimension:     XY
## Bounding box:  xmin: 13240 ymin: 306980 xmax: 278070 ymax: 618430
## CRS:           NA
\end{verbatim}

\includegraphics{howitsmade_files/figure-latex/fig4-2.pdf}

\hypertarget{tables}{%
\section{Tables}\label{tables}}

\hypertarget{table-1}{%
\subsection{Table 1}\label{table-1}}

\begin{verbatim}
##            range    NL N     NL share 598 N  598 share 700 N   700 share
## 1      800-1,400 595,384 0.4634940010   154 0.30738523   382 0.957393484
## 2    1,400-2,000 349,502 0.2720800027   162 0.32335329    16 0.040100251
## 3    2,000-3,000 180,867 0.1408011796   102 0.20359281     1 0.002506266
## 4    3,000-5,000  97,444 0.0758581175    55 0.10978044     0 0.000000000
## 5   5,000-10,000  43,846 0.0341331947    22 0.04391218     0 0.000000000
## 6  10,000-20,000  12,492 0.0097247609     6 0.01197605     0 0.000000000
## 7  20,000-30,000   2,730 0.0021252479     0 0.00000000     0 0.000000000
## 8 30,000-100,000   2,084 0.0016223504     0 0.00000000     0 0.000000000
## 9       >100,000     207 0.0001611452     0 0.00000000     0 0.000000000
\end{verbatim}

\hypertarget{table-2}{%
\subsection{Table 2}\label{table-2}}

Income shares for Den Haag and Utrecht 1935 are derived from the
original report

\begin{verbatim}
## 
## Domestic accounts Amsterdam 1934-1935 (N = 78)
## ==========================
## Statistic       N   Mean  
## --------------------------
## income          78 977.559
## social_security 78  0.820 
## HHincome        78  0.121 
## gifts           78  0.039 
## other_income    78  0.020 
## --------------------------
\end{verbatim}

\begin{verbatim}
## 
## Domestic accounts The Hague 1932 (N = 90)
## ============================
## Statistic       N    Mean   
## ----------------------------
## income          90 1,103.925
## social_security 90   0.867  
## HHincome        90   0.051  
## gifts           90   0.049  
## other_income    90   0.032  
## ----------------------------
\end{verbatim}

\begin{verbatim}
## 
## Domestic accounts The Hague 1935 (N = 129)
## =====================
## Statistic  N   Mean  
## ---------------------
## income    129 935.639
## ---------------------
\end{verbatim}

\hypertarget{table-3}{%
\subsection{Table 3}\label{table-3}}

Consumption shares for Den Haag 1932 and 1935 and Utrecht 1935 are
derived from the original report

\begin{verbatim}
## 
## Domestic accounts Amsterdam 1934-1935 (N = 78)
## ========================
## Statistic   N    Mean   
## ------------------------
## consumption 78 1,003.922
## food        78   0.403  
## shelter     78   0.422  
## clothing    78   0.045  
## other_cons  78   0.129  
## ------------------------
\end{verbatim}

\begin{verbatim}
## 
## Domestic accounts The Hague 1932 (N = 90)
## ========================
## Statistic   N    Mean   
## ------------------------
## consumption 90 1,077.354
## ------------------------
\end{verbatim}

\begin{verbatim}
## 
## Domestic accounts The Hague 1935 (N = 129)
## =======================
## Statistic    N   Mean  
## -----------------------
## consumption 129 892.705
## -----------------------
\end{verbatim}

\hypertarget{table-4}{%
\subsection{Table 4}\label{table-4}}

This table is directly taken from the original report.

\hypertarget{table-5}{%
\subsection{Table 5}\label{table-5}}

\begin{table}
\centering
\begin{tabular}[t]{lrrrrrr}
\toprule
  & Share (%) & Mean & Std. Dev. & Min & Max & Median\\
\midrule
Income & \num{100.00} & \num{852.63} & \num{222.58} & \num{409.24} & \num{2048.80} & \num{834.08}\\
Net income & \num{59.29} & \num{138.13} & \num{206.04} & \num{0.00} & \num{1382.16} & \num{40.30}\\
Social sec. & \num{100.00} & \num{645.65} & \num{184.14} & \num{15.60} & \num{1235.00} & \num{660.92}\\
Gifts & \num{70.29} & \num{32.68} & \num{48.21} & \num{0.00} & \num{323.44} & \num{11.96}\\
Stocks & \num{79.00} & \num{35.27} & \num{46.39} & \num{0.00} & \num{250.12} & \num{17.94}\\
Consumption & \num{100.00} & \num{891.65} & \num{230.47} & \num{390.52} & \num{2437.76} & \num{857.48}\\
Food & \num{100.00} & \num{446.95} & \num{145.18} & \num{163.80} & \num{1347.84} & \num{428.48}\\
Shelter & \num{100.00} & \num{241.05} & \num{76.22} & \num{46.28} & \num{528.32} & \num{242.32}\\
Clothing & \num{99.29} & \num{67.11} & \num{51.26} & \num{0.00} & \num{367.64} & \num{53.56}\\
Insurance & \num{97.86} & \num{57.58} & \num{31.50} & \num{0.00} & \num{171.60} & \num{56.68}\\
Other & \num{99.29} & \num{78.05} & \num{74.54} & \num{0.00} & \num{1296.36} & \num{61.10}\\
\bottomrule
\end{tabular}
\end{table}

\hypertarget{table-6}{%
\subsection{Table 6}\label{table-6}}

This table {]}{]} comes from the reported sources in the paper

\hypertarget{table-7}{%
\subsection{Table 7}\label{table-7}}

\begin{table}
\centering
\begin{tabular}[t]{lrrrrrr}
\toprule
  & Share (%) & Mean & Std. Dev. & Min & Max & Median\\
\midrule
Income & \num{100.00} & \num{2255.46} & \num{1863.15} & \num{720.29} & \num{19553.20} & \num{1740.25}\\
Net income & \num{100.00} & \num{2176.17} & \num{1839.08} & \num{574.51} & \num{19553.20} & \num{1692.32}\\
Home prod. & \num{37.90} & \num{12.93} & \num{39.30} & \num{0.00} & \num{566.12} & \num{0.00}\\
Impl. rent & \num{22.29} & \num{29.39} & \num{80.38} & \num{0.00} & \num{652.52} & \num{0.00}\\
Inc. (kind) & \num{25.52} & \num{18.18} & \num{55.62} & \num{0.00} & \num{700.00} & \num{0.00}\\
Sup. (kind) & \num{26.86} & \num{7.61} & \num{20.10} & \num{0.00} & \num{159.58} & \num{0.00}\\
Lodgers & \num{7.05} & \num{11.17} & \num{98.62} & \num{0.00} & \num{1553.80} & \num{0.00}\\
Consumption & \num{100.00} & \num{2198.52} & \num{1702.30} & \num{739.48} & \num{19835.26} & \num{1727.92}\\
Food & \num{100.00} & \num{630.43} & \num{211.16} & \num{276.95} & \num{1651.35} & \num{579.51}\\
Shelter & \num{100.00} & \num{491.24} & \num{281.87} & \num{118.74} & \num{2554.20} & \num{422.99}\\
Clothing & \num{100.00} & \num{231.60} & \num{182.04} & \num{23.94} & \num{1698.20} & \num{180.44}\\
Other & \num{100.00} & \num{736.23} & \num{1041.69} & \num{29.96} & \num{12255.76} & \num{399.02}\\
Savings (net) & \num{52.76} & \num{61.71} & \num{432.60} & \num{-1073.32} & \num{6163.92} & \num{3.13}\\
Credit (net) & \num{38.86} & \num{-4.87} & \num{190.47} & \num{-2454.38} & \num{1409.29} & \num{0.00}\\
\bottomrule
\end{tabular}
\end{table}

\hypertarget{table-8}{%
\subsection{Table 8}\label{table-8}}

This table directly comes from the reported sources in the paper

\hypertarget{table-9}{%
\subsection{Table 9}\label{table-9}}

\hypertarget{table-10}{%
\subsection{Table 10}\label{table-10}}

\begin{verbatim}
## 
## Financial margin Amsterdam 1934-1935 (N = 78)
## ==============================================================
## Statistic        N   Mean     Min    Pctl(25) Pctl(75)   Max  
## --------------------------------------------------------------
## Financial margin 78 -26.364 -308.956 -35.790   4.785   104.880
## --------------------------------------------------------------
\end{verbatim}

\begin{verbatim}
## 
## Financial margin The Hague 1932 (N = 90)
## =============================================================
## Statistic        N   Mean    Min    Pctl(25) Pctl(75)   Max  
## -------------------------------------------------------------
## Financial margin 90 26.571 -194.240 -16.690   83.850  231.010
## -------------------------------------------------------------
\end{verbatim}

\begin{verbatim}
## 
## Financial margin The Hague 1935 (N = 129)
## ==============================================================
## Statistic         N   Mean    Min    Pctl(25) Pctl(75)   Max  
## --------------------------------------------------------------
## Financial margin 129 42.934 -181.220  -1.560   66.300  603.460
## --------------------------------------------------------------
\end{verbatim}

\begin{verbatim}
## 
## Financial margin The Netherlands 1937 (N = 700)
## ==============================================================
## Statistic         N   Mean    Min    Pctl(25) Pctl(75)   Max  
## --------------------------------------------------------------
## Financial margin 700 62.261 -374.920  5.070   121.160  629.720
## --------------------------------------------------------------
\end{verbatim}

\begin{verbatim}
## 
## Financial margin The Netherlands 1936-37 (N = 598)
## ==================================================================
## Statistic         N   Mean     Min    Pctl(25) Pctl(75)    Max    
## ------------------------------------------------------------------
## Financial margin 525 822.902 -632.510 214.970  837.340  13,649.450
## ------------------------------------------------------------------
\end{verbatim}

\hypertarget{table-11}{%
\subsection{Table 11}\label{table-11}}

\begin{verbatim}
## 
## The Determinants of Financial Fragility of Dutch Households in 1936-37
## ======================================================================
##                                  Dependent variable:                  
##                -------------------------------------------------------
##                                                                       
##                     (1)           (2)           (3)           (4)     
## ----------------------------------------------------------------------
## Av. Age          14.650**      16.060**      33.652***     28.983***  
##                   (7.190)       (7.572)       (7.922)       (7.430)   
##                                                                       
## HH size          -41.545*      -46.864**    -61.260***    -64.612***  
##                  (21.800)      (22.846)      (20.626)      (20.805)   
##                                                                       
## HC2 (d)        -1,766.206*** -1,769.582***  -920.535***   -920.309*** 
##                  (350.806)     (348.478)     (260.659)     (254.669)  
##                                                                       
## HC3 (d)        -2,714.342*** -2,755.682*** -1,627.673*** -1,655.356***
##                  (332.114)     (338.446)     (247.325)     (245.594)  
##                                                                       
## HC5 (d)        -2,874.741*** -2,839.641*** -1,693.984*** -1,701.765***
##                  (334.485)     (334.488)     (266.609)     (265.403)  
##                                                                       
## Large (d)                      273.216*       -28.427       -38.343   
##                                (156.651)     (134.714)     (133.286)  
##                                                                       
## Industrial (d)                  -54.386       -98.253      -104.157   
##                                (109.012)     (111.200)     (110.201)  
##                                                                       
## Housing wealth                                0.029*        0.029**   
##                                               (0.015)       (0.015)   
##                                                                       
## Land wealth                                   -0.002        -0.016    
##                                               (0.036)       (0.033)   
##                                                                       
## LI wealth                                    1.296***      1.370***   
##                                               (0.431)       (0.433)   
##                                                                       
## Pension wealth                               -0.459**      -0.530**   
##                                               (0.224)       (0.230)   
##                                                                       
## death (d)                                                   420.938   
##                                                            (307.033)  
##                                                                       
## Newborn (d)                                               -266.799**  
##                                                            (131.314)  
##                                                                       
## Healthcare (d)                                            -287.495*** 
##                                                            (90.750)   
##                                                                       
## Unemployment                                                -2.595    
##                                                             (3.104)   
##                                                                       
## Constant       2,672.911***  2,567.659***     446.290       809.374   
##                  (416.609)     (414.650)     (515.391)     (491.540)  
##                                                                       
## ======================================================================
## ======================================================================
## Note:                                      *p<0.1; **p<0.05; ***p<0.01
\end{verbatim}

\hypertarget{table-12}{%
\subsection{Table 12}\label{table-12}}

\begin{verbatim}
## 
## Cash Flows to Finance the Consumption of Dutch Households in 1936-1937 (N = 525)
## ===============================================================
##                  mean in group 0 mean in group 1   t      .1   
## ---------------------------------------------------------------
##    Net income         1.027           0.888      11.811    0   
##  Income in kind       0.006           0.011      -2.136  0.034 
## Support in kind      0.0002           0.018      -8.550    0   
## Impl. rent (net)      0.013           0.015      -0.676  0.499 
##    Home prod.         0.002           0.025      -5.773 0.00000
##     Lodgers           0.005           0.005      -0.012  0.991 
##  Savings (out)       -0.074          -0.010      -5.658 0.00000
##   Savings (in)        0.019           0.039      -3.526 0.0005 
##   Credit (out)       -0.018          -0.008      -2.411  0.017 
##   Credit (in)         0.021           0.017      0.510   0.611 
## ---------------------------------------------------------------
\end{verbatim}

\hypertarget{table-13}{%
\subsection{Table 13}\label{table-13}}

\begin{verbatim}
## 
## Consumption shares of Dutch Households in 1936-1937 (N = 525)
## ======================================
##          ff = 0 ff = 1    t       p   
## --------------------------------------
##   Food   0.239  0.452  -24.744    0   
## Shelter  0.216  0.245  -5.066  0.00000
## Clothing 0.108  0.101   2.052   0.041 
## Leisure  0.051  0.034   5.967     0   
##  Other   0.387  0.169  25.672     0   
## --------------------------------------
\end{verbatim}

\end{document}
