diff --git a/04_NE.Rmd b/04_NE.Rmd new file mode 100644 index 0000000..e4ef72a --- /dev/null +++ b/04_NE.Rmd @@ -0,0 +1,35 @@ +# (PART) Natural Experiments {-} + +# Natural Experiments + +## Finding Experiments in Nature + +## Instrumental Variables + +```{r, eval=TRUE, echo=FALSE} +if (knitr:::is_latex_output()) { + knitr::asis_output('\\url{http://nickchk.com/anim/Animation%20of%20IV.gif}') +} else { + knitr::include_graphics("animations/IV.gif") +} +``` + +## Difference-in-Differences + +```{r, eval=TRUE, echo=FALSE} +if (knitr:::is_latex_output()) { + knitr::asis_output('\\url{http://nickchk.com/anim/Animation%20of%20DID.gif}') +} else { + knitr::include_graphics("animations/DID.gif") +} +``` + +## Regression Discontinuity + +```{r, eval=TRUE, echo=FALSE} +if (knitr:::is_latex_output()) { + knitr::asis_output('\\url{NOLINKYET}') +} else { + knitr::include_graphics("animations/RDDSmooth.gif") +} +``` diff --git a/05_OM.Rmd b/05_OM.Rmd new file mode 100644 index 0000000..fec2f14 --- /dev/null +++ b/05_OM.Rmd @@ -0,0 +1,233 @@ + +# (PART) Observational Methods {-} + +# The Purpose of Observational Methods + +In the previous chapter on [Randomized Controlled Trials]('03_RCT.html'), we showed that, by randomizing treatment, we could identify causal effects because the random variation sidestepped the impact of omitted variables or sample selection that could drive a non-causal correlation between treatement and outcome. In [Natural Experiments]('04_NE.html'), we mimicked that strategy by finding sources of near-random variation in treatment, and isolating the part of treatment that was driven by the near-random variation. + +Using Randomized Controlled Trials or Natural Experiments, if they are properly applied, it is possible to ignore *any* confounding variables, whether or not we can measure them in our data or even imagine what they are. + +However, it is not always possible to run an experiment or find a natural experiment. In this chapter, we will consider ways of identifying causal effects using *Observational* methods, relying only on the data we have actually collected and observed. Natural Experiments often make use of additional Observational methods, correcting for confounding variables that the design of the natural experiment cannot account for. + +This chapter contains four sections: the first two cover multiple regression and matching, respectively, which are two common ways of adjusting for observed variables. The third covers the sufficient adjustment set, which allows you to determine which variables should and should not be adjusted for to identify a causal effect. The fourth covers fixed effects, which is a method that allows you to adjust for some unmeasured confounding variables. + +## Multiple Regression + +```{r, eval=TRUE, echo=FALSE} +if (knitr:::is_latex_output()) { + knitr::asis_output('\\url{http://nickchk.com/anim/Animation%20of%20Control.gif}') +} else { + knitr::include_graphics("animations/Control.gif") +} +``` + + +## Matching + +```{r, eval=TRUE, echo=FALSE} +if (knitr:::is_latex_output()) { + knitr::asis_output('\\url{http://nickchk.com/anim/Animation%20of%20Matching.gif}') +} else { + knitr::include_graphics("animations/Matching.gif") +} +``` + +## Sufficient Adjustment Set + +## Fixed Effects + +### Between and Within Variation + +Fixed effects is a method that can be applied when you have *panel data*: multiple observations of the same individual over time. + +When you have multiple observations per individual, variation in the outcome variable $Y$ comes from two places: *between variation* and *within variation*. Between variation is the difference *between* individuals in their average level of $Y$. Within variation is the difference *within* a given individual comparing one time period to another. + +For example, consider the below data. + +```{r, eval=TRUE, echo=FALSE} +knitr::kable(data.frame(Person = c('Anna','Anna','Bill','Bill'), + Time = c(1,2,1,2), + Y = c(4,8,3,1), + D = c(0,1,1,0)), + caption='Y over Two Time Periods for Two People') +``` + +Anna's average $Y$ is `(4+8)/2 = 6`, and Bill's average is `(3+1)/2 = 2`. The difference between the `6` and the `2` is the difference *between* Anna and Bill. And Anna's change from 4 to 8, and Bill's change from 3 to 1 are the differences *within* Anna and Bill. + +Fixed effects eliminates *all* between variation and uses only within variation. In effect, you are *controlling for individual identity*. For this reason it is also known as the "within estimator". + +The reason fixed effects does this is that it in effect controls for *all* differences between people that are constant across time, whether or not we control for them. + +### Demonstration of Fixed Effects + +Fixed effects works by simply removing all the between variation in each variable before performing an analysis of choice. + +Using the above example with Anna and Bill, we can subtract all between variation in $Y$ and $D$ by calculating the average of $Y$ and $D$ for Anna and Bill, separately, and subtracting it out. Notice that $\bar{Y}_{Anna}=6, \bar{Y}_{Bill}=2, \bar{D}_{Anna}=.5, \bar{D}_{Bill}=.5$. + +```{r, eval=TRUE, echo=FALSE} +knitr::kable(data.frame(Person = c('Anna','Anna','Bill','Bill'), + Time = c(1,2,1,2), + Y = c(4,8,3,1), + D = c(0,1,1,0), + Within.Y = c(-2,2,1,-1), + Within.D = c(-.5,.5,.5,-.5)), + caption='Within Variation in Y and D') +``` + +With this modified data, the relationship between `Within.Y` and `Within.D` will tell us about the effect of `D` on `Y`, as long as all confounding variables were a part of the between variation. + +This process is demonstrated in animation below. + +```{r, eval=TRUE, echo=FALSE} +if (knitr:::is_latex_output()) { + knitr::asis_output('\\url{http://nickchk.com/anim/Animation%20of%20Fixed%20Effects.gif}') +} else { + knitr::include_graphics("animations/FixedEffects.gif") +} +``` + +### Fixed Effects with Regression + +Fixed effects estimation is usually performed using regression. In the below model, each individual $i$ has their own intercept $\alpha_{i}$. + +\begin{align} + Y_{it} = \alpha_i + \beta D_{it} + \varepsilon_{it} (\#eq:fe1) +\end{align} + +where $\varepsilon_{it}$ is an error term. This can also be seen as a regression of $Y_{it}$ on $D_{it}$ and a series of binary variables, one for each individual. + +\begin{align} + Y_{it} = \alpha + \sum_{i=0^N}\alpha_iI(i) + \beta D_{it} + \varepsilon_{it} (\#eq:fe2) +\end{align} + +where $I(i)$ is a function equal to 1 for individual $i$ and 0 otherwise. + +Either Equation \@ref(eq:fe1) or Equation \@ref(eq:fe2) will provide identical estimates of $\beta$ as though you had run the regression + +\begin{align} + Within.Y_{it} = \alpha + \beta Within.D_{it} + \varepsilon_{it} (\#eq:fe3) +\end{align} + +Any variable that is *constant within individual* will be controlled for using fixed effects, whether or not it is measured. For example, imagine that $i$ is an index of people, $D_{it}$ is being exposed to a pollution-reduction policy, and $Y_{it}$ is a measure of health. The variable $G_i$ measures a genetic endowment at birth, which may affect health and also whether you live in the area with the policy. Notice that $G_i$ does not have a $t$ subscript, indicating that it is *constant over time* for each person. Even without measuring $G_i$, it will be controlled for, since $G_i$ is just $I(i)$ multiplied by some constant, and we're already controlling for $I(i)$. + +Equation \@ref(eq:fe2) also makes clear that we are not controlling for anything that varies within person over time. For example, $Inc_{it}$ is income, which may affect health, and also whether you can afford to live in the area with the policy. Fixed effects alone does not control for $Inc_{it}$, and so we may need to add it as a control. + +Similarly, fixed effects assumes that identity has a linear and constant effect. For example, if genetic endowment $G_i$ has a stronger effect in some years than others, fixed effects will not account for this. Or, if genetic endowment modifies how effective the policy is, fixed effects will not account for this unless $G_i$ can be measured and the nonlinearity can be directly modeled. + +However, if all confounding variables are between-individual, linearity holds, and several other assumptions hold (see Treatment Effect Heterogeneity below), then fixed effects will identify the Average Treatment Effect. + +Notice that the modeling in this section is very similar to *Random Effects*, not addressed in this chapter, which are similar to fixed effects but combine both between and within variation. + +### Common Extensions + +#### Clustered Standard Errors + +The standard approach to calculating standard errors for Equations \@ref(eq:fe1), \@ref(eq:fe2), or \@ref(eq:fe3) makes the assumption that the error term $\varepsilon_{it}$ is independent and identically distributed. However, it may be reasonable to assume that $\varepsilon_{it}$ is correlated within individual. + +Under this condition, standard errors will be underestimated. For this reason, it is common to estimate fixed effects regressions using clustered standard errors. See [Cameron & Miller 2013](http://cameron.econ.ucdavis.edu/research/Cameron_Miller_Cluster_Robust_October152013.pdf) (or the published version [Cameron & Mill 2015](http://jhr.uwpress.org/content/50/2/317.short)) for a practitioner's guide to whether clustering is necessary in a given fixed effects context, and how it can be performed. + +#### Two-Way Fixed Effects + +In many fixed effects contexts, some of the within variation in $Y_{it}$ may not just be specific to person $i$, but may be shared across all individuals. For example, if the sample includes many individuals in the same economy, the overall health of the economy changes over time and would affect everyone. If the treatment variable $D_{it}$ is correlated with time as well, then these shared time effects will bias our estimate of the causal effect. + +In cases like this it is common to include two sets of fixed effects - one for individual, $\alpha_i$, and one for time, $\alpha_t$. The regression equation is then + +\begin{align} + Y_{it} = \alpha_{i} + \alpha_{t} + \beta D_{it} + \varepsilon_{it} (\#eq:fe4) +\end{align} + +#### Treatment Effect Heterogeneity + +Under the assumptions discussed above, the estimate produced by a fixed effects regression will be a weighted average of the treatment effect for each individual. To see this, consider a data set that has only two time periods in it, and each individual is treated in exactly one of these periods, like our example above: + +```{r, eval=TRUE, echo=FALSE} +knitr::kable(data.frame(Person = c('Anna','Anna','Bill','Bill'), + Time = c(1,2,1,2), + Y = c(4,8,3,1), + D = c(0,1,1,0), + Within.Y = c(-2,2,1,-1), + Within.D = c(-.5,.5,.5,-.5)), + caption='Within Variation in Y and D') +``` + +Anna sees an increase of 4 when the treatment is applied, and Bill sees an increase of 2. The fixed effects estimate will be `(2+1)/2 - (-2 + -1)/2 = 1.5 - -1.5 = 3`, which is also `(4+2)/3 = 3`, the average treatment effect in the sample. + +In this case, Anna and Bill received equal weight. That is because Anna and Bill had the exact same amount of variation in $D$. Fixed effects will more heavily weight individuals with more variation in $D$. For example, imagine that Bill always has $D = 0$ and thus no variation in $D$: + +```{r, eval=TRUE, echo=FALSE} +knitr::kable(data.frame(Person = c('Anna','Anna','Bill','Bill'), + Time = c(1,2,1,2), + Y = c(4,8,1,1), + D = c(0,1,0,0), + Within.Y = c(-2,2,0,0), + Within.D = c(-.5,.5,0,0)), + caption='Within Variation in Y and D, where Bill Always Has D = 0') +``` + +The fixed effects estimate is now `2 - -2 = 4`, which is Anna's treatment effect. Bill has no variation in $D$ and thus receives no weight. We have failed to estimate the Average Treatment Effect. + +One way to adjust for this is to use weighted least squares, where each observation is weighted by the inverse standard deviation of treatment within individual $(\sigma^D_i)^{-1}$, where + +\begin{align} + \sigma^D_i = (\sum_t(D_{it} - \bar{D}_i)^2)^{1/2} (\#eq:fe5) +\end{align} + +While this will not account for observations with no variation in $D_{it}$, this will otherwise recover the average treatment effect ([Gibbons, Serrato, & Urbancic, 2018](https://www.degruyter.com/view/j/jem.2019.8.issue-1/jem-2017-0002/jem-2017-0002.xml)). + +### Coding Up Fixed Effects + +Each of the following coding examples uses `D` as a treatment variable of interest, `Y` as the outcome variable, `id` as a variable encoding the individual, and `t` as a variable with the time period. In the R examples, all variables are stored in the data frame `df`. + +Fixed effects is easy to implement using regression by simply including a set of dummy variables, one for each individual. This method can be implemented as: + +```{r, echo=TRUE, eval = FALSE} +#in R: +fe <- lm(Y~D+factor(id), data = df) +summary(fe) + +#in Stata: +regress Y D i.id +``` + +Many statistics packages also allow you to identify the panel structure of the data, and have a specific command for implementing fixed effects. + +```{r, echo=TRUE, eval = FALSE} +#in R: +library(plm) +df.p <- pdata.frame(df,index=c("id","t")) +fe <- plm(Y~D,data=df.p,model="within") +summary(fe) +#Add clustered standard errors +library(lmtest) +fe.cluster <- coeftest(fe,vcov=vcovHC(model,type = "HC1", cluster="group")) +summary(fe.cluster) + +#in Stata: +xtset id t +xtreg Y D, fe +#Add clustered standard errors +xtreg Y D, fe vce(cluster id) +``` + +Two-way fixed effects can be handled, as normal, by adding dummy variables for time period. There are also more formal ways of handling two-way fixed effects that work more quickly or handle standard errors in a more accurate way. + +```{r, echo=TRUE, eval = FALSE} +#in R: +#Just using dummies +fe <- lm(Y~D+factor(id)+factor(t), data = df) +#Using PLM +library(plm) +df.p <- pdata.frame(df,index=c("id","t")) +fe.twoways <- plm(Y~D,data=df.p,model="twoways") +summary(fe.twoways) + +#in Stata: +#Using dummies and xtreg +xtset id t +xtreg Y D i.t, fe +#Using reghdfe +ssc install reghdfe +#You may also have to install gtools +#and in some cases do "reghdfe, compile" before use +reghdfe Y D, absorb(id t) +``` diff --git a/STCI.Rproj b/STCI.Rproj new file mode 100644 index 0000000..827cca1 --- /dev/null +++ b/STCI.Rproj @@ -0,0 +1,15 @@ +Version: 1.0 + +RestoreWorkspace: Default +SaveWorkspace: Default +AlwaysSaveHistory: Default + +EnableCodeIndexing: Yes +UseSpacesForTab: Yes +NumSpacesForTab: 2 +Encoding: UTF-8 + +RnwWeave: Sweave +LaTeX: pdfLaTeX + +BuildType: Website diff --git a/_bookdown_files/STCI_files/figure-epub3/histpotout-1.png b/_bookdown_files/STCI_files/figure-epub3/histpotout-1.png new file mode 100644 index 0000000..e222285 Binary files /dev/null and b/_bookdown_files/STCI_files/figure-epub3/histpotout-1.png differ diff --git a/_bookdown_files/STCI_files/figure-epub3/histyb-1.png b/_bookdown_files/STCI_files/figure-epub3/histyb-1.png new file mode 100644 index 0000000..6993e2d Binary files /dev/null and b/_bookdown_files/STCI_files/figure-epub3/histyb-1.png differ diff --git a/_bookdown_files/STCI_files/figure-epub3/ploty1y0yB-1.png b/_bookdown_files/STCI_files/figure-epub3/ploty1y0yB-1.png new file mode 100644 index 0000000..6a362fc Binary files /dev/null and b/_bookdown_files/STCI_files/figure-epub3/ploty1y0yB-1.png differ diff --git a/_bookdown_files/STCI_files/figure-epub3/plotyyB-1.png b/_bookdown_files/STCI_files/figure-epub3/plotyyB-1.png new file mode 100644 index 0000000..6d58581 Binary files /dev/null and b/_bookdown_files/STCI_files/figure-epub3/plotyyB-1.png differ diff --git a/_bookdown_files/STCI_files/figure-html/histpotout-1.png b/_bookdown_files/STCI_files/figure-html/histpotout-1.png new file mode 100644 index 0000000..f2b0c39 Binary files /dev/null and b/_bookdown_files/STCI_files/figure-html/histpotout-1.png differ diff --git a/_bookdown_files/STCI_files/figure-html/histyb-1.png b/_bookdown_files/STCI_files/figure-html/histyb-1.png new file mode 100644 index 0000000..77af70a Binary files /dev/null and b/_bookdown_files/STCI_files/figure-html/histyb-1.png differ diff --git a/_bookdown_files/STCI_files/figure-html/ploty1y0yB-1.png b/_bookdown_files/STCI_files/figure-html/ploty1y0yB-1.png new file mode 100644 index 0000000..840954d Binary files /dev/null and b/_bookdown_files/STCI_files/figure-html/ploty1y0yB-1.png differ diff --git a/_bookdown_files/STCI_files/figure-html/plotyyB-1.png b/_bookdown_files/STCI_files/figure-html/plotyyB-1.png new file mode 100644 index 0000000..e757c95 Binary files /dev/null and b/_bookdown_files/STCI_files/figure-html/plotyyB-1.png differ diff --git a/_bookdown_files/STCI_files/figure-latex/histpotout-1.pdf b/_bookdown_files/STCI_files/figure-latex/histpotout-1.pdf new file mode 100644 index 0000000..8fd2ab2 Binary files /dev/null and b/_bookdown_files/STCI_files/figure-latex/histpotout-1.pdf differ diff --git a/_bookdown_files/STCI_files/figure-latex/histyb-1.pdf b/_bookdown_files/STCI_files/figure-latex/histyb-1.pdf new file mode 100644 index 0000000..ceb9375 Binary files /dev/null and b/_bookdown_files/STCI_files/figure-latex/histyb-1.pdf differ diff --git a/_bookdown_files/STCI_files/figure-latex/ploty1y0yB-1.pdf b/_bookdown_files/STCI_files/figure-latex/ploty1y0yB-1.pdf new file mode 100644 index 0000000..63ed5d6 Binary files /dev/null and b/_bookdown_files/STCI_files/figure-latex/ploty1y0yB-1.pdf differ diff --git a/_bookdown_files/STCI_files/figure-latex/plotyyB-1.pdf b/_bookdown_files/STCI_files/figure-latex/plotyyB-1.pdf new file mode 100644 index 0000000..e8e2708 Binary files /dev/null and b/_bookdown_files/STCI_files/figure-latex/plotyyB-1.pdf differ diff --git a/animations/Control.gif b/animations/Control.gif new file mode 100644 index 0000000..4e9877f Binary files /dev/null and b/animations/Control.gif differ diff --git a/animations/DID.gif b/animations/DID.gif new file mode 100644 index 0000000..9544550 Binary files /dev/null and b/animations/DID.gif differ diff --git a/animations/FixedEffects.gif b/animations/FixedEffects.gif new file mode 100644 index 0000000..d21894e Binary files /dev/null and b/animations/FixedEffects.gif differ diff --git a/animations/IV.gif b/animations/IV.gif new file mode 100644 index 0000000..989a5b8 Binary files /dev/null and b/animations/IV.gif differ diff --git a/animations/Matching.gif b/animations/Matching.gif new file mode 100644 index 0000000..ddfa3db Binary files /dev/null and b/animations/Matching.gif differ diff --git a/animations/RDDSmooth.gif b/animations/RDDSmooth.gif new file mode 100644 index 0000000..98ada00 Binary files /dev/null and b/animations/RDDSmooth.gif differ diff --git a/docs/STCI.epub b/docs/STCI.epub index 1c9949d..46aa9f6 100644 Binary files a/docs/STCI.epub and b/docs/STCI.epub differ diff --git a/docs/STCI.pdf b/docs/STCI.pdf index 160f888..e1a4200 100644 Binary files a/docs/STCI.pdf and b/docs/STCI.pdf differ diff --git a/docs/STCI.tex b/docs/STCI.tex index 9826f1a..99518b2 100644 --- a/docs/STCI.tex +++ b/docs/STCI.tex @@ -107,22 +107,23 @@ \usepackage{titling} % Create subtitle command for use in maketitle -\newcommand{\subtitle}[1]{ +\providecommand{\subtitle}[1]{ \posttitle{ \begin{center}\large#1\end{center} } } \setlength{\droptitle}{-2em} + \title{Statistical Tools for Causal Inference} - \pretitle{\vspace{\droptitle}\centering\huge} + \pretitle{\vspace{\droptitle}\centering\huge} \posttitle{\par} - \author{The SKY Community} - \preauthor{\centering\large\emph} + \author{The SKY Community} + \preauthor{\centering\large\emph} \postauthor{\par} - \predate{\centering\large\emph} + \predate{\centering\large\emph} \postdate{\par} - \date{2019-04-13} + \date{2019-04-13} \usepackage{dsfont} \newcommand{\uns}[1]{\mathds{1}[ #1 ]} @@ -131,10 +132,11 @@ \usepackage{amsthm} \newtheorem{theorem}{Theorem}[chapter] \newtheorem{lemma}{Lemma}[chapter] -\theoremstyle{definition} -\newtheorem{definition}{Definition}[chapter] \newtheorem{corollary}{Corollary}[chapter] \newtheorem{proposition}{Proposition}[chapter] +\newtheorem{conjecture}{Conjecture}[chapter] +\theoremstyle{definition} +\newtheorem{definition}{Definition}[chapter] \theoremstyle{definition} \newtheorem{example}{Example}[chapter] \theoremstyle{definition} @@ -400,11 +402,11 @@ \subsubsection{The sharp cutoff rule}\label{the-sharp-cutoff-rule} \end{Highlighting} \end{Shaded} -\begin{table} +\begin{table}[t] \caption{\label{tab:tableDsharp}Treatment allocation with sharp cutoff rule} \centering -\begin{tabular}[t]{lr} +\begin{tabular}{lr} \toprule 0 & 771\\ 1 & 229\\ @@ -689,5 +691,410 @@ \subsection{The switching equation}\label{the-switching-equation} \ref{fig:plotyyB} only shows observed outcomes, and is thus silent on the values of the missing potential outcomes. +\part{Natural Experiments}\label{part-natural-experiments} + +\chapter{Natural Experiments}\label{natural-experiments} + +\section{Finding Experiments in +Nature}\label{finding-experiments-in-nature} + +\section{Instrumental Variables}\label{instrumental-variables} + +\url{http://nickchk.com/anim/Animation%20of%20IV.gif} + +\section{Difference-in-Differences}\label{difference-in-differences} + +\url{http://nickchk.com/anim/Animation%20of%20DID.gif} + +\section{Regression Discontinuity}\label{regression-discontinuity} + +\url{NOLINKYET} + +\part{Observational +Methods}\label{part-observational-methods} + +\chapter{The Purpose of Observational +Methods}\label{the-purpose-of-observational-methods} + +In the previous chapter on \href{'03_RCT.html'}{Randomized Controlled +Trials}, we showed that, by randomizing treatment, we could identify +causal effects because the random variation sidestepped the impact of +omitted variables or sample selection that could drive a non-causal +correlation between treatement and outcome. In +\href{'04_NE.html'}{Natural Experiments}, we mimicked that strategy by +finding sources of near-random variation in treatment, and isolating the +part of treatment that was driven by the near-random variation. + +Using Randomized Controlled Trials or Natural Experiments, if they are +properly applied, it is possible to ignore \emph{any} confounding +variables, whether or not we can measure them in our data or even +imagine what they are. + +However, it is not always possible to run an experiment or find a +natural experiment. In this chapter, we will consider ways of +identifying causal effects using \emph{Observational} methods, relying +only on the data we have actually collected and observed. Natural +Experiments often make use of additional Observational methods, +correcting for confounding variables that the design of the natural +experiment cannot account for. + +This chapter contains four sections: the first two cover multiple +regression and matching, respectively, which are two common ways of +adjusting for observed variables. The third covers the sufficient +adjustment set, which allows you to determine which variables should and +should not be adjusted for to identify a causal effect. The fourth +covers fixed effects, which is a method that allows you to adjust for +some unmeasured confounding variables. + +\section{Multiple Regression}\label{multiple-regression} + +\url{http://nickchk.com/anim/Animation%20of%20Control.gif} + +\section{Matching}\label{matching} + +\url{http://nickchk.com/anim/Animation%20of%20Matching.gif} + +\section{Sufficient Adjustment Set}\label{sufficient-adjustment-set} + +\section{Fixed Effects}\label{fixed-effects} + +\subsection{Between and Within +Variation}\label{between-and-within-variation} + +Fixed effects is a method that can be applied when you have \emph{panel +data}: multiple observations of the same individual over time. + +When you have multiple observations per individual, variation in the +outcome variable \(Y\) comes from two places: \emph{between variation} +and \emph{within variation}. Between variation is the difference +\emph{between} individuals in their average level of \(Y\). Within +variation is the difference \emph{within} a given individual comparing +one time period to another. + +For example, consider the below data. + +\begin{table}[t] + +\caption{\label{tab:unnamed-chunk-11}Y over Two Time Periods for Two People} +\centering +\begin{tabular}{l|r|r|r} +\hline +Person & Time & Y & D\\ +\hline +Anna & 1 & 4 & 0\\ +\hline +Anna & 2 & 8 & 1\\ +\hline +Bill & 1 & 3 & 1\\ +\hline +Bill & 2 & 1 & 0\\ +\hline +\end{tabular} +\end{table} + +Anna's average \(Y\) is \texttt{(4+8)/2\ =\ 6}, and Bill's average is +\texttt{(3+1)/2\ =\ 2}. The difference between the \texttt{6} and the +\texttt{2} is the difference \emph{between} Anna and Bill. And Anna's +change from 4 to 8, and Bill's change from 3 to 1 are the differences +\emph{within} Anna and Bill. + +Fixed effects eliminates \emph{all} between variation and uses only +within variation. In effect, you are \emph{controlling for individual +identity}. For this reason it is also known as the ``within estimator''. + +The reason fixed effects does this is that it in effect controls for +\emph{all} differences between people that are constant across time, +whether or not we control for them. + +\subsection{Demonstration of Fixed +Effects}\label{demonstration-of-fixed-effects} + +Fixed effects works by simply removing all the between variation in each +variable before performing an analysis of choice. + +Using the above example with Anna and Bill, we can subtract all between +variation in \(Y\) and \(D\) by calculating the average of \(Y\) and +\(D\) for Anna and Bill, separately, and subtracting it out. Notice that +\(\bar{Y}_{Anna}=6, \bar{Y}_{Bill}=2, \bar{D}_{Anna}=.5, \bar{D}_{Bill}=.5\). + +\begin{table}[t] + +\caption{\label{tab:unnamed-chunk-12}Within Variation in Y and D} +\centering +\begin{tabular}{l|r|r|r|r|r} +\hline +Person & Time & Y & D & Within.Y & Within.D\\ +\hline +Anna & 1 & 4 & 0 & -2 & -0.5\\ +\hline +Anna & 2 & 8 & 1 & 2 & 0.5\\ +\hline +Bill & 1 & 3 & 1 & 1 & 0.5\\ +\hline +Bill & 2 & 1 & 0 & -1 & -0.5\\ +\hline +\end{tabular} +\end{table} + +With this modified data, the relationship between \texttt{Within.Y} and +\texttt{Within.D} will tell us about the effect of \texttt{D} on +\texttt{Y}, as long as all confounding variables were a part of the +between variation. + +This process is demonstrated in animation below. + +\url{http://nickchk.com/anim/Animation%20of%20Fixed%20Effects.gif} + +\subsection{Fixed Effects with +Regression}\label{fixed-effects-with-regression} + +Fixed effects estimation is usually performed using regression. In the +below model, each individual \(i\) has their own intercept +\(\alpha_{i}\). + +\begin{align} + Y_{it} = \alpha_i + \beta D_{it} + \varepsilon_{it} \label{eq:fe1} +\end{align} + +where \(\varepsilon_{it}\) is an error term. This can also be seen as a +regression of \(Y_{it}\) on \(D_{it}\) and a series of binary variables, +one for each individual. + +\begin{align} + Y_{it} = \alpha + \sum_{i=0^N}\alpha_iI(i) + \beta D_{it} + \varepsilon_{it} \label{eq:fe2} +\end{align} + +where \(I(i)\) is a function equal to 1 for individual \(i\) and 0 +otherwise. + +Either Equation \eqref{eq:fe1} or Equation \eqref{eq:fe2} will provide +identical estimates of \(\beta\) as though you had run the regression + +\begin{align} + Within.Y_{it} = \alpha + \beta Within.D_{it} + \varepsilon_{it} \label{eq:fe3} +\end{align} + +Any variable that is \emph{constant within individual} will be +controlled for using fixed effects, whether or not it is measured. For +example, imagine that \(i\) is an index of people, \(D_{it}\) is being +exposed to a pollution-reduction policy, and \(Y_{it}\) is a measure of +health. The variable \(G_i\) measures a genetic endowment at birth, +which may affect health and also whether you live in the area with the +policy. Notice that \(G_i\) does not have a \(t\) subscript, indicating +that it is \emph{constant over time} for each person. Even without +measuring \(G_i\), it will be controlled for, since \(G_i\) is just +\(I(i)\) multiplied by some constant, and we're already controlling for +\(I(i)\). + +Equation \eqref{eq:fe2} also makes clear that we are not controlling for +anything that varies within person over time. For example, \(Inc_{it}\) +is income, which may affect health, and also whether you can afford to +live in the area with the policy. Fixed effects alone does not control +for \(Inc_{it}\), and so we may need to add it as a control. + +Similarly, fixed effects assumes that identity has a linear and constant +effect. For example, if genetic endowment \(G_i\) has a stronger effect +in some years than others, fixed effects will not account for this. Or, +if genetic endowment modifies how effective the policy is, fixed effects +will not account for this unless \(G_i\) can be measured and the +nonlinearity can be directly modeled. + +However, if all confounding variables are between-individual, linearity +holds, and several other assumptions hold (see Treatment Effect +Heterogeneity below), then fixed effects will identify the Average +Treatment Effect. + +Notice that the modeling in this section is very similar to \emph{Random +Effects}, not addressed in this chapter, which are similar to fixed +effects but combine both between and within variation. + +\subsection{Common Extensions}\label{common-extensions} + +\subsubsection{Clustered Standard +Errors}\label{clustered-standard-errors} + +The standard approach to calculating standard errors for Equations +\eqref{eq:fe1}, \eqref{eq:fe2}, or \eqref{eq:fe3} makes the assumption that +the error term \(\varepsilon_{it}\) is independent and identically +distributed. However, it may be reasonable to assume that +\(\varepsilon_{it}\) is correlated within individual. + +Under this condition, standard errors will be underestimated. For this +reason, it is common to estimate fixed effects regressions using +clustered standard errors. See +\href{http://cameron.econ.ucdavis.edu/research/Cameron_Miller_Cluster_Robust_October152013.pdf}{Cameron +\& Miller 2013} (or the published version +\href{http://jhr.uwpress.org/content/50/2/317.short}{Cameron \& Mill +2015}) for a practitioner's guide to whether clustering is necessary in +a given fixed effects context, and how it can be performed. + +\subsubsection{Two-Way Fixed Effects}\label{two-way-fixed-effects} + +In many fixed effects contexts, some of the within variation in +\(Y_{it}\) may not just be specific to person \(i\), but may be shared +across all individuals. For example, if the sample includes many +individuals in the same economy, the overall health of the economy +changes over time and would affect everyone. If the treatment variable +\(D_{it}\) is correlated with time as well, then these shared time +effects will bias our estimate of the causal effect. + +In cases like this it is common to include two sets of fixed effects - +one for individual, \(\alpha_i\), and one for time, \(\alpha_t\). The +regression equation is then + +\begin{align} + Y_{it} = \alpha_{i} + \alpha_{t} + \beta D_{it} + \varepsilon_{it} \label{eq:fe4} +\end{align} + +\subsubsection{Treatment Effect +Heterogeneity}\label{treatment-effect-heterogeneity} + +Under the assumptions discussed above, the estimate produced by a fixed +effects regression will be a weighted average of the treatment effect +for each individual. To see this, consider a data set that has only two +time periods in it, and each individual is treated in exactly one of +these periods, like our example above: + +\begin{table}[t] + +\caption{\label{tab:unnamed-chunk-14}Within Variation in Y and D} +\centering +\begin{tabular}{l|r|r|r|r|r} +\hline +Person & Time & Y & D & Within.Y & Within.D\\ +\hline +Anna & 1 & 4 & 0 & -2 & -0.5\\ +\hline +Anna & 2 & 8 & 1 & 2 & 0.5\\ +\hline +Bill & 1 & 3 & 1 & 1 & 0.5\\ +\hline +Bill & 2 & 1 & 0 & -1 & -0.5\\ +\hline +\end{tabular} +\end{table} + +Anna sees an increase of 4 when the treatment is applied, and Bill sees +an increase of 2. The fixed effects estimate will be +\texttt{(2+1)/2\ -\ (-2\ +\ -1)/2\ =\ 1.5\ -\ -1.5\ =\ 3}, which is also +\texttt{(4+2)/3\ =\ 3}, the average treatment effect in the sample. + +In this case, Anna and Bill received equal weight. That is because Anna +and Bill had the exact same amount of variation in \(D\). Fixed effects +will more heavily weight individuals with more variation in \(D\). For +example, imagine that Bill always has \(D = 0\) and thus no variation in +\(D\): + +\begin{table}[t] + +\caption{\label{tab:unnamed-chunk-15}Within Variation in Y and D, where Bill Always Has D = 0} +\centering +\begin{tabular}{l|r|r|r|r|r} +\hline +Person & Time & Y & D & Within.Y & Within.D\\ +\hline +Anna & 1 & 4 & 0 & -2 & -0.5\\ +\hline +Anna & 2 & 8 & 1 & 2 & 0.5\\ +\hline +Bill & 1 & 1 & 0 & 0 & 0.0\\ +\hline +Bill & 2 & 1 & 0 & 0 & 0.0\\ +\hline +\end{tabular} +\end{table} + +The fixed effects estimate is now \texttt{2\ -\ -2\ =\ 4}, which is +Anna's treatment effect. Bill has no variation in \(D\) and thus +receives no weight. We have failed to estimate the Average Treatment +Effect. + +One way to adjust for this is to use weighted least squares, where each +observation is weighted by the inverse standard deviation of treatment +within individual \((\sigma^D_i)^{-1}\), where + +\begin{align} + \sigma^D_i = (\sum_t(D_{it} - \bar{D}_i)^2)^{1/2} \label{eq:fe5} +\end{align} + +While this will not account for observations with no variation in +\(D_{it}\), this will otherwise recover the average treatment effect +(\href{https://www.degruyter.com/view/j/jem.2019.8.issue-1/jem-2017-0002/jem-2017-0002.xml}{Gibbons, +Serrato, \& Urbancic, 2018}). + +\subsection{Coding Up Fixed Effects}\label{coding-up-fixed-effects} + +Each of the following coding examples uses \texttt{D} as a treatment +variable of interest, \texttt{Y} as the outcome variable, \texttt{id} as +a variable encoding the individual, and \texttt{t} as a variable with +the time period. In the R examples, all variables are stored in the data +frame \texttt{df}. + +Fixed effects is easy to implement using regression by simply including +a set of dummy variables, one for each individual. This method can be +implemented as: + +\begin{Shaded} +\begin{Highlighting}[] +\CommentTok{#in R:} +\NormalTok{fe <-}\StringTok{ }\KeywordTok{lm}\NormalTok{(Y}\OperatorTok{~}\NormalTok{D}\OperatorTok{+}\KeywordTok{factor}\NormalTok{(id), }\DataTypeTok{data =}\NormalTok{ df)} +\KeywordTok{summary}\NormalTok{(fe)} + +\CommentTok{#in Stata:} +\NormalTok{regress Y D i.id} +\end{Highlighting} +\end{Shaded} + +Many statistics packages also allow you to identify the panel structure +of the data, and have a specific command for implementing fixed effects. + +\begin{Shaded} +\begin{Highlighting}[] +\CommentTok{#in R:} +\KeywordTok{library}\NormalTok{(plm)} +\NormalTok{df.p <-}\StringTok{ }\KeywordTok{pdata.frame}\NormalTok{(df,}\DataTypeTok{index=}\KeywordTok{c}\NormalTok{(}\StringTok{"id"}\NormalTok{,}\StringTok{"t"}\NormalTok{))} +\NormalTok{fe <-}\StringTok{ }\KeywordTok{plm}\NormalTok{(Y}\OperatorTok{~}\NormalTok{D,}\DataTypeTok{data=}\NormalTok{df.p,}\DataTypeTok{model=}\StringTok{"within"}\NormalTok{)} +\KeywordTok{summary}\NormalTok{(fe)} +\CommentTok{#Add clustered standard errors} +\KeywordTok{library}\NormalTok{(lmtest)} +\NormalTok{fe.cluster <-}\StringTok{ }\KeywordTok{coeftest}\NormalTok{(fe,}\DataTypeTok{vcov=}\KeywordTok{vcovHC}\NormalTok{(model,}\DataTypeTok{type =} \StringTok{"HC1"}\NormalTok{, }\DataTypeTok{cluster=}\StringTok{"group"}\NormalTok{))} +\KeywordTok{summary}\NormalTok{(fe.cluster)} + +\CommentTok{#in Stata:} +\NormalTok{xtset id t} +\NormalTok{xtreg Y D, fe} +\CommentTok{#Add clustered standard errors} +\NormalTok{xtreg Y D, fe }\KeywordTok{vce}\NormalTok{(cluster id)} +\end{Highlighting} +\end{Shaded} + +Two-way fixed effects can be handled, as normal, by adding dummy +variables for time period. There are also more formal ways of handling +two-way fixed effects that work more quickly or handle standard errors +in a more accurate way. + +\begin{Shaded} +\begin{Highlighting}[] +\CommentTok{#in R:} +\CommentTok{#Just using dummies} +\NormalTok{fe <-}\StringTok{ }\KeywordTok{lm}\NormalTok{(Y}\OperatorTok{~}\NormalTok{D}\OperatorTok{+}\KeywordTok{factor}\NormalTok{(id)}\OperatorTok{+}\KeywordTok{factor}\NormalTok{(t), }\DataTypeTok{data =}\NormalTok{ df)} +\CommentTok{#Using PLM} +\KeywordTok{library}\NormalTok{(plm)} +\NormalTok{df.p <-}\StringTok{ }\KeywordTok{pdata.frame}\NormalTok{(df,}\DataTypeTok{index=}\KeywordTok{c}\NormalTok{(}\StringTok{"id"}\NormalTok{,}\StringTok{"t"}\NormalTok{))} +\NormalTok{fe.twoways <-}\StringTok{ }\KeywordTok{plm}\NormalTok{(Y}\OperatorTok{~}\NormalTok{D,}\DataTypeTok{data=}\NormalTok{df.p,}\DataTypeTok{model=}\StringTok{"twoways"}\NormalTok{)} +\KeywordTok{summary}\NormalTok{(fe.twoways)} + +\CommentTok{#in Stata:} +\CommentTok{#Using dummies and xtreg} +\NormalTok{xtset id t} +\NormalTok{xtreg Y D i.t, fe} +\CommentTok{#Using reghdfe} +\NormalTok{ssc install reghdfe} +\CommentTok{#You may also have to install gtools} +\CommentTok{#and in some cases do "reghdfe, compile" before use} +\NormalTok{reghdfe Y D, }\KeywordTok{absorb}\NormalTok{(id t)} +\end{Highlighting} +\end{Shaded} + \end{document} diff --git a/docs/STCI_files/figure-html/histpotout-1.png b/docs/STCI_files/figure-html/histpotout-1.png index 93a5c1b..f2b0c39 100644 Binary files a/docs/STCI_files/figure-html/histpotout-1.png and b/docs/STCI_files/figure-html/histpotout-1.png differ diff --git a/docs/STCI_files/figure-html/histyb-1.png b/docs/STCI_files/figure-html/histyb-1.png index 928b725..77af70a 100644 Binary files a/docs/STCI_files/figure-html/histyb-1.png and b/docs/STCI_files/figure-html/histyb-1.png differ diff --git a/docs/STCI_files/figure-html/ploty1y0yB-1.png b/docs/STCI_files/figure-html/ploty1y0yB-1.png index f128e0a..840954d 100644 Binary files a/docs/STCI_files/figure-html/ploty1y0yB-1.png and b/docs/STCI_files/figure-html/ploty1y0yB-1.png differ diff --git a/docs/STCI_files/figure-html/plotyyB-1.png b/docs/STCI_files/figure-html/plotyyB-1.png index d03f249..e757c95 100644 Binary files a/docs/STCI_files/figure-html/plotyyB-1.png and b/docs/STCI_files/figure-html/plotyyB-1.png differ diff --git a/docs/animations/Animation of Control.gif b/docs/animations/Animation of Control.gif new file mode 100644 index 0000000..4e9877f Binary files /dev/null and b/docs/animations/Animation of Control.gif differ diff --git a/docs/animations/Animation of Fixed Effects.gif b/docs/animations/Animation of Fixed Effects.gif new file mode 100644 index 0000000..d21894e Binary files /dev/null and b/docs/animations/Animation of Fixed Effects.gif differ diff --git a/docs/animations/Animation of Matching.gif b/docs/animations/Animation of Matching.gif new file mode 100644 index 0000000..ddfa3db Binary files /dev/null and b/docs/animations/Animation of Matching.gif differ diff --git a/docs/animations/Control.gif b/docs/animations/Control.gif new file mode 100644 index 0000000..4e9877f Binary files /dev/null and b/docs/animations/Control.gif differ diff --git a/docs/animations/DID.gif b/docs/animations/DID.gif new file mode 100644 index 0000000..9544550 Binary files /dev/null and b/docs/animations/DID.gif differ diff --git a/docs/animations/FixedEffects.gif b/docs/animations/FixedEffects.gif new file mode 100644 index 0000000..d21894e Binary files /dev/null and b/docs/animations/FixedEffects.gif differ diff --git a/docs/animations/IV.gif b/docs/animations/IV.gif new file mode 100644 index 0000000..989a5b8 Binary files /dev/null and b/docs/animations/IV.gif differ diff --git a/docs/animations/Matching.gif b/docs/animations/Matching.gif new file mode 100644 index 0000000..ddfa3db Binary files /dev/null and b/docs/animations/Matching.gif differ diff --git a/docs/animations/RDDSmooth.gif b/docs/animations/RDDSmooth.gif new file mode 100644 index 0000000..98ada00 Binary files /dev/null and b/docs/animations/RDDSmooth.gif differ diff --git a/docs/basic-observational-methods.html b/docs/basic-observational-methods.html new file mode 100644 index 0000000..a8ccfd8 --- /dev/null +++ b/docs/basic-observational-methods.html @@ -0,0 +1,232 @@ + + + + + + + + Chapter 2 Basic Observational Methods | Statistical Tools for Causal Inference + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +$$ +\newcommand{\uns}[1]{\mathbf{1}[#1]} +$$ + + + + + + + + + + + +
+ +
+ +
+ +
+
+ + +
+
+ +
+
+

Chapter 2 Basic Observational Methods

+

This chapter contains four sections: the first two cover multiple regression and matching, respectively, which are two common ways of adjusting for observed variables. The third covers the sufficient adjustment set, which allows you to determine which variables should and should not be adjusted for to identify a causal effect. The fourth covers fixed effects, which is a method that allows you to adjust for some unmeasured confounding variables.

+
+

2.1 Multiple Regression

+

+
+
+

2.2 Matching

+

+
+
+

2.3 Sufficient Adjustment Set

+
+
+

2.4 Fixed Effects

+

+ +
+
+
+ +
+
+
+ + +
+
+ + + + + + + + + + + + + + diff --git a/docs/index.html b/docs/index.html index 5ec03eb..70a860d 100644 --- a/docs/index.html +++ b/docs/index.html @@ -7,7 +7,7 @@ Statistical Tools for Causal Inference - + @@ -36,6 +36,7 @@ + @@ -115,6 +116,26 @@
  • 1.1.3 The switching equation
  • +
  • II Natural Experiments
  • +
  • 2 Natural Experiments
  • +
  • III Observational Methods
  • +
  • 3 The Purpose of Observational Methods
  • Published with bookdown
  • @@ -137,8 +158,8 @@

    Introduction

    @@ -185,7 +206,7 @@

    Introduction

    "google": false, "linkedin": false, "weibo": false, -"instapper": false, +"instapaper": false, "vk": false, "all": ["facebook", "google", "twitter", "linkedin", "weibo", "instapaper"] }, @@ -198,6 +219,10 @@

    Introduction

    "link": "https://github.com/chabefer/STCI/index.Rmd", "text": "Edit" }, +"history": { +"link": null, +"text": null +}, "download": ["STCI.pdf", "STCI.epub"], "toc": { "collapse": "subsection" @@ -212,7 +237,7 @@

    Introduction

    var script = document.createElement("script"); script.type = "text/javascript"; var src = ""; - if (src === "" || src === "true") src = "https://cdn.bootcss.com/mathjax/2.7.1/MathJax.js?config=TeX-MML-AM_CHTML"; + if (src === "" || src === "true") src = "https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-MML-AM_CHTML"; if (location.protocol !== "file:" && /^https?:/.test(src)) src = src.replace(/^https?:/, ''); script.src = src; diff --git a/docs/libs/gitbook-2.6.7/css/plugin-bookdown.css b/docs/libs/gitbook-2.6.7/css/plugin-bookdown.css index a56b9e9..8e5bb8a 100644 --- a/docs/libs/gitbook-2.6.7/css/plugin-bookdown.css +++ b/docs/libs/gitbook-2.6.7/css/plugin-bookdown.css @@ -84,10 +84,10 @@ span.search-highlight { border-bottom: none; } -div.theorem, div.lemma, div.corollary, div.proposition { +div.theorem, div.lemma, div.corollary, div.proposition, div.conjecture { font-style: italic; } -span.theorem, span.lemma, span.corollary, span.proposition { +span.theorem, span.lemma, span.corollary, span.proposition, span.conjecture { font-style: normal; } div.proof:after { diff --git a/docs/libs/gitbook-2.6.7/css/plugin-fontsettings.css b/docs/libs/gitbook-2.6.7/css/plugin-fontsettings.css index 26591fe..87236b4 100644 --- a/docs/libs/gitbook-2.6.7/css/plugin-fontsettings.css +++ b/docs/libs/gitbook-2.6.7/css/plugin-fontsettings.css @@ -104,7 +104,8 @@ background-color: inherit; } .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal blockquote { - border-color: inherit; + border-color: #c4b29f; + opacity: 0.9; } .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre, .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code { diff --git a/docs/libs/gitbook-2.6.7/css/style.css b/docs/libs/gitbook-2.6.7/css/style.css index 9356f5b..b896892 100644 --- a/docs/libs/gitbook-2.6.7/css/style.css +++ b/docs/libs/gitbook-2.6.7/css/style.css @@ -6,5 +6,5 @@ */.link-inherit,.link-inherit:focus,.link-inherit:hover{color:inherit}.fa,.fa-stack{display:inline-block}/*! * Font Awesome 4.1.0 by @davegandy - http://fontawesome.io - @fontawesome * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) - */@font-face{font-family:FontAwesome;src:url(./fontawesome/fontawesome-webfont.ttf?v=4.1.0) format('truetype');font-weight:400;font-style:normal}.fa{font-family:FontAwesome;font-style:normal;font-weight:400;line-height:1;-moz-osx-font-smoothing:grayscale}.book .book-header,.book .book-summary{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif}.fa-lg{font-size:1.33333333em;line-height:.75em;vertical-align:-15%}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-fw{width:1.28571429em;text-align:center}.fa-ul{padding-left:0;margin-left:2.14285714em;list-style-type:none}.fa-li{position:absolute;left:-2.14285714em;width:2.14285714em;top:.14285714em;text-align:center}.fa-li.fa-lg{left:-1.85714286em}.fa-border{padding:.2em .25em .15em;border:.08em solid #eee;border-radius:.1em}.pull-right{float:right}.pull-left{float:left}.fa.pull-left{margin-right:.3em}.fa.pull-right{margin-left:.3em}.fa-spin{-webkit-animation:spin 2s infinite linear;-moz-animation:spin 2s infinite linear;-o-animation:spin 2s infinite linear;animation:spin 2s infinite linear}@-moz-keyframes spin{0%{-moz-transform:rotate(0)}100%{-moz-transform:rotate(359deg)}}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0)}100%{-webkit-transform:rotate(359deg)}}@-o-keyframes spin{0%{-o-transform:rotate(0)}100%{-o-transform:rotate(359deg)}}@keyframes spin{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.fa-rotate-90{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=1);-webkit-transform:rotate(90deg);-moz-transform:rotate(90deg);-ms-transform:rotate(90deg);-o-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=2);-webkit-transform:rotate(180deg);-moz-transform:rotate(180deg);-ms-transform:rotate(180deg);-o-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=3);-webkit-transform:rotate(270deg);-moz-transform:rotate(270deg);-ms-transform:rotate(270deg);-o-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1);-webkit-transform:scale(-1,1);-moz-transform:scale(-1,1);-ms-transform:scale(-1,1);-o-transform:scale(-1,1);transform:scale(-1,1)}.fa-flip-vertical{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1);-webkit-transform:scale(1,-1);-moz-transform:scale(1,-1);-ms-transform:scale(1,-1);-o-transform:scale(1,-1);transform:scale(1,-1)}.fa-stack{position:relative;width:2em;height:2em;line-height:2em;vertical-align:middle}.fa-stack-1x,.fa-stack-2x{position:absolute;left:0;width:100%;text-align:center}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-inverse{color:#fff}.fa-glass:before{content:"\f000"}.fa-music:before{content:"\f001"}.fa-search:before{content:"\f002"}.fa-envelope-o:before{content:"\f003"}.fa-heart:before{content:"\f004"}.fa-star:before{content:"\f005"}.fa-star-o:before{content:"\f006"}.fa-user:before{content:"\f007"}.fa-film:before{content:"\f008"}.fa-th-large:before{content:"\f009"}.fa-th:before{content:"\f00a"}.fa-th-list:before{content:"\f00b"}.fa-check:before{content:"\f00c"}.fa-times:before{content:"\f00d"}.fa-search-plus:before{content:"\f00e"}.fa-search-minus:before{content:"\f010"}.fa-power-off:before{content:"\f011"}.fa-signal:before{content:"\f012"}.fa-cog:before,.fa-gear:before{content:"\f013"}.fa-trash-o:before{content:"\f014"}.fa-home:before{content:"\f015"}.fa-file-o:before{content:"\f016"}.fa-clock-o:before{content:"\f017"}.fa-road:before{content:"\f018"}.fa-download:before{content:"\f019"}.fa-arrow-circle-o-down:before{content:"\f01a"}.fa-arrow-circle-o-up:before{content:"\f01b"}.fa-inbox:before{content:"\f01c"}.fa-play-circle-o:before{content:"\f01d"}.fa-repeat:before,.fa-rotate-right:before{content:"\f01e"}.fa-refresh:before{content:"\f021"}.fa-list-alt:before{content:"\f022"}.fa-lock:before{content:"\f023"}.fa-flag:before{content:"\f024"}.fa-headphones:before{content:"\f025"}.fa-volume-off:before{content:"\f026"}.fa-volume-down:before{content:"\f027"}.fa-volume-up:before{content:"\f028"}.fa-qrcode:before{content:"\f029"}.fa-barcode:before{content:"\f02a"}.fa-tag:before{content:"\f02b"}.fa-tags:before{content:"\f02c"}.fa-book:before{content:"\f02d"}.fa-bookmark:before{content:"\f02e"}.fa-print:before{content:"\f02f"}.fa-camera:before{content:"\f030"}.fa-font:before{content:"\f031"}.fa-bold:before{content:"\f032"}.fa-italic:before{content:"\f033"}.fa-text-height:before{content:"\f034"}.fa-text-width:before{content:"\f035"}.fa-align-left:before{content:"\f036"}.fa-align-center:before{content:"\f037"}.fa-align-right:before{content:"\f038"}.fa-align-justify:before{content:"\f039"}.fa-list:before{content:"\f03a"}.fa-dedent:before,.fa-outdent:before{content:"\f03b"}.fa-indent:before{content:"\f03c"}.fa-video-camera:before{content:"\f03d"}.fa-image:before,.fa-photo:before,.fa-picture-o:before{content:"\f03e"}.fa-pencil:before{content:"\f040"}.fa-map-marker:before{content:"\f041"}.fa-adjust:before{content:"\f042"}.fa-tint:before{content:"\f043"}.fa-edit:before,.fa-pencil-square-o:before{content:"\f044"}.fa-share-square-o:before{content:"\f045"}.fa-check-square-o:before{content:"\f046"}.fa-arrows:before{content:"\f047"}.fa-step-backward:before{content:"\f048"}.fa-fast-backward:before{content:"\f049"}.fa-backward:before{content:"\f04a"}.fa-play:before{content:"\f04b"}.fa-pause:before{content:"\f04c"}.fa-stop:before{content:"\f04d"}.fa-forward:before{content:"\f04e"}.fa-fast-forward:before{content:"\f050"}.fa-step-forward:before{content:"\f051"}.fa-eject:before{content:"\f052"}.fa-chevron-left:before{content:"\f053"}.fa-chevron-right:before{content:"\f054"}.fa-plus-circle:before{content:"\f055"}.fa-minus-circle:before{content:"\f056"}.fa-times-circle:before{content:"\f057"}.fa-check-circle:before{content:"\f058"}.fa-question-circle:before{content:"\f059"}.fa-info-circle:before{content:"\f05a"}.fa-crosshairs:before{content:"\f05b"}.fa-times-circle-o:before{content:"\f05c"}.fa-check-circle-o:before{content:"\f05d"}.fa-ban:before{content:"\f05e"}.fa-arrow-left:before{content:"\f060"}.fa-arrow-right:before{content:"\f061"}.fa-arrow-up:before{content:"\f062"}.fa-arrow-down:before{content:"\f063"}.fa-mail-forward:before,.fa-share:before{content:"\f064"}.fa-expand:before{content:"\f065"}.fa-compress:before{content:"\f066"}.fa-plus:before{content:"\f067"}.fa-minus:before{content:"\f068"}.fa-asterisk:before{content:"\f069"}.fa-exclamation-circle:before{content:"\f06a"}.fa-gift:before{content:"\f06b"}.fa-leaf:before{content:"\f06c"}.fa-fire:before{content:"\f06d"}.fa-eye:before{content:"\f06e"}.fa-eye-slash:before{content:"\f070"}.fa-exclamation-triangle:before,.fa-warning:before{content:"\f071"}.fa-plane:before{content:"\f072"}.fa-calendar:before{content:"\f073"}.fa-random:before{content:"\f074"}.fa-comment:before{content:"\f075"}.fa-magnet:before{content:"\f076"}.fa-chevron-up:before{content:"\f077"}.fa-chevron-down:before{content:"\f078"}.fa-retweet:before{content:"\f079"}.fa-shopping-cart:before{content:"\f07a"}.fa-folder:before{content:"\f07b"}.fa-folder-open:before{content:"\f07c"}.fa-arrows-v:before{content:"\f07d"}.fa-arrows-h:before{content:"\f07e"}.fa-bar-chart-o:before{content:"\f080"}.fa-twitter-square:before{content:"\f081"}.fa-facebook-square:before{content:"\f082"}.fa-camera-retro:before{content:"\f083"}.fa-key:before{content:"\f084"}.fa-cogs:before,.fa-gears:before{content:"\f085"}.fa-comments:before{content:"\f086"}.fa-thumbs-o-up:before{content:"\f087"}.fa-thumbs-o-down:before{content:"\f088"}.fa-star-half:before{content:"\f089"}.fa-heart-o:before{content:"\f08a"}.fa-sign-out:before{content:"\f08b"}.fa-linkedin-square:before{content:"\f08c"}.fa-thumb-tack:before{content:"\f08d"}.fa-external-link:before{content:"\f08e"}.fa-sign-in:before{content:"\f090"}.fa-trophy:before{content:"\f091"}.fa-github-square:before{content:"\f092"}.fa-upload:before{content:"\f093"}.fa-lemon-o:before{content:"\f094"}.fa-phone:before{content:"\f095"}.fa-square-o:before{content:"\f096"}.fa-bookmark-o:before{content:"\f097"}.fa-phone-square:before{content:"\f098"}.fa-twitter:before{content:"\f099"}.fa-facebook:before{content:"\f09a"}.fa-github:before{content:"\f09b"}.fa-unlock:before{content:"\f09c"}.fa-credit-card:before{content:"\f09d"}.fa-rss:before{content:"\f09e"}.fa-hdd-o:before{content:"\f0a0"}.fa-bullhorn:before{content:"\f0a1"}.fa-bell:before{content:"\f0f3"}.fa-certificate:before{content:"\f0a3"}.fa-hand-o-right:before{content:"\f0a4"}.fa-hand-o-left:before{content:"\f0a5"}.fa-hand-o-up:before{content:"\f0a6"}.fa-hand-o-down:before{content:"\f0a7"}.fa-arrow-circle-left:before{content:"\f0a8"}.fa-arrow-circle-right:before{content:"\f0a9"}.fa-arrow-circle-up:before{content:"\f0aa"}.fa-arrow-circle-down:before{content:"\f0ab"}.fa-globe:before{content:"\f0ac"}.fa-wrench:before{content:"\f0ad"}.fa-tasks:before{content:"\f0ae"}.fa-filter:before{content:"\f0b0"}.fa-briefcase:before{content:"\f0b1"}.fa-arrows-alt:before{content:"\f0b2"}.fa-group:before,.fa-users:before{content:"\f0c0"}.fa-chain:before,.fa-link:before{content:"\f0c1"}.fa-cloud:before{content:"\f0c2"}.fa-flask:before{content:"\f0c3"}.fa-cut:before,.fa-scissors:before{content:"\f0c4"}.fa-copy:before,.fa-files-o:before{content:"\f0c5"}.fa-paperclip:before{content:"\f0c6"}.fa-floppy-o:before,.fa-save:before{content:"\f0c7"}.fa-square:before{content:"\f0c8"}.fa-bars:before,.fa-navicon:before,.fa-reorder:before{content:"\f0c9"}.fa-list-ul:before{content:"\f0ca"}.fa-list-ol:before{content:"\f0cb"}.fa-strikethrough:before{content:"\f0cc"}.fa-underline:before{content:"\f0cd"}.fa-table:before{content:"\f0ce"}.fa-magic:before{content:"\f0d0"}.fa-truck:before{content:"\f0d1"}.fa-pinterest:before{content:"\f0d2"}.fa-pinterest-square:before{content:"\f0d3"}.fa-google-plus-square:before{content:"\f0d4"}.fa-google-plus:before{content:"\f0d5"}.fa-money:before{content:"\f0d6"}.fa-caret-down:before{content:"\f0d7"}.fa-caret-up:before{content:"\f0d8"}.fa-caret-left:before{content:"\f0d9"}.fa-caret-right:before{content:"\f0da"}.fa-columns:before{content:"\f0db"}.fa-sort:before,.fa-unsorted:before{content:"\f0dc"}.fa-sort-desc:before,.fa-sort-down:before{content:"\f0dd"}.fa-sort-asc:before,.fa-sort-up:before{content:"\f0de"}.fa-envelope:before{content:"\f0e0"}.fa-linkedin:before{content:"\f0e1"}.fa-rotate-left:before,.fa-undo:before{content:"\f0e2"}.fa-gavel:before,.fa-legal:before{content:"\f0e3"}.fa-dashboard:before,.fa-tachometer:before{content:"\f0e4"}.fa-comment-o:before{content:"\f0e5"}.fa-comments-o:before{content:"\f0e6"}.fa-bolt:before,.fa-flash:before{content:"\f0e7"}.fa-sitemap:before{content:"\f0e8"}.fa-umbrella:before{content:"\f0e9"}.fa-clipboard:before,.fa-paste:before{content:"\f0ea"}.fa-lightbulb-o:before{content:"\f0eb"}.fa-exchange:before{content:"\f0ec"}.fa-cloud-download:before{content:"\f0ed"}.fa-cloud-upload:before{content:"\f0ee"}.fa-user-md:before{content:"\f0f0"}.fa-stethoscope:before{content:"\f0f1"}.fa-suitcase:before{content:"\f0f2"}.fa-bell-o:before{content:"\f0a2"}.fa-coffee:before{content:"\f0f4"}.fa-cutlery:before{content:"\f0f5"}.fa-file-text-o:before{content:"\f0f6"}.fa-building-o:before{content:"\f0f7"}.fa-hospital-o:before{content:"\f0f8"}.fa-ambulance:before{content:"\f0f9"}.fa-medkit:before{content:"\f0fa"}.fa-fighter-jet:before{content:"\f0fb"}.fa-beer:before{content:"\f0fc"}.fa-h-square:before{content:"\f0fd"}.fa-plus-square:before{content:"\f0fe"}.fa-angle-double-left:before{content:"\f100"}.fa-angle-double-right:before{content:"\f101"}.fa-angle-double-up:before{content:"\f102"}.fa-angle-double-down:before{content:"\f103"}.fa-angle-left:before{content:"\f104"}.fa-angle-right:before{content:"\f105"}.fa-angle-up:before{content:"\f106"}.fa-angle-down:before{content:"\f107"}.fa-desktop:before{content:"\f108"}.fa-laptop:before{content:"\f109"}.fa-tablet:before{content:"\f10a"}.fa-mobile-phone:before,.fa-mobile:before{content:"\f10b"}.fa-circle-o:before{content:"\f10c"}.fa-quote-left:before{content:"\f10d"}.fa-quote-right:before{content:"\f10e"}.fa-spinner:before{content:"\f110"}.fa-circle:before{content:"\f111"}.fa-mail-reply:before,.fa-reply:before{content:"\f112"}.fa-github-alt:before{content:"\f113"}.fa-folder-o:before{content:"\f114"}.fa-folder-open-o:before{content:"\f115"}.fa-smile-o:before{content:"\f118"}.fa-frown-o:before{content:"\f119"}.fa-meh-o:before{content:"\f11a"}.fa-gamepad:before{content:"\f11b"}.fa-keyboard-o:before{content:"\f11c"}.fa-flag-o:before{content:"\f11d"}.fa-flag-checkered:before{content:"\f11e"}.fa-terminal:before{content:"\f120"}.fa-code:before{content:"\f121"}.fa-mail-reply-all:before,.fa-reply-all:before{content:"\f122"}.fa-star-half-empty:before,.fa-star-half-full:before,.fa-star-half-o:before{content:"\f123"}.fa-location-arrow:before{content:"\f124"}.fa-crop:before{content:"\f125"}.fa-code-fork:before{content:"\f126"}.fa-chain-broken:before,.fa-unlink:before{content:"\f127"}.fa-question:before{content:"\f128"}.fa-info:before{content:"\f129"}.fa-exclamation:before{content:"\f12a"}.fa-superscript:before{content:"\f12b"}.fa-subscript:before{content:"\f12c"}.fa-eraser:before{content:"\f12d"}.fa-puzzle-piece:before{content:"\f12e"}.fa-microphone:before{content:"\f130"}.fa-microphone-slash:before{content:"\f131"}.fa-shield:before{content:"\f132"}.fa-calendar-o:before{content:"\f133"}.fa-fire-extinguisher:before{content:"\f134"}.fa-rocket:before{content:"\f135"}.fa-maxcdn:before{content:"\f136"}.fa-chevron-circle-left:before{content:"\f137"}.fa-chevron-circle-right:before{content:"\f138"}.fa-chevron-circle-up:before{content:"\f139"}.fa-chevron-circle-down:before{content:"\f13a"}.fa-html5:before{content:"\f13b"}.fa-css3:before{content:"\f13c"}.fa-anchor:before{content:"\f13d"}.fa-unlock-alt:before{content:"\f13e"}.fa-bullseye:before{content:"\f140"}.fa-ellipsis-h:before{content:"\f141"}.fa-ellipsis-v:before{content:"\f142"}.fa-rss-square:before{content:"\f143"}.fa-play-circle:before{content:"\f144"}.fa-ticket:before{content:"\f145"}.fa-minus-square:before{content:"\f146"}.fa-minus-square-o:before{content:"\f147"}.fa-level-up:before{content:"\f148"}.fa-level-down:before{content:"\f149"}.fa-check-square:before{content:"\f14a"}.fa-pencil-square:before{content:"\f14b"}.fa-external-link-square:before{content:"\f14c"}.fa-share-square:before{content:"\f14d"}.fa-compass:before{content:"\f14e"}.fa-caret-square-o-down:before,.fa-toggle-down:before{content:"\f150"}.fa-caret-square-o-up:before,.fa-toggle-up:before{content:"\f151"}.fa-caret-square-o-right:before,.fa-toggle-right:before{content:"\f152"}.fa-eur:before,.fa-euro:before{content:"\f153"}.fa-gbp:before{content:"\f154"}.fa-dollar:before,.fa-usd:before{content:"\f155"}.fa-inr:before,.fa-rupee:before{content:"\f156"}.fa-cny:before,.fa-jpy:before,.fa-rmb:before,.fa-yen:before{content:"\f157"}.fa-rouble:before,.fa-rub:before,.fa-ruble:before{content:"\f158"}.fa-krw:before,.fa-won:before{content:"\f159"}.fa-bitcoin:before,.fa-btc:before{content:"\f15a"}.fa-file:before{content:"\f15b"}.fa-file-text:before{content:"\f15c"}.fa-sort-alpha-asc:before{content:"\f15d"}.fa-sort-alpha-desc:before{content:"\f15e"}.fa-sort-amount-asc:before{content:"\f160"}.fa-sort-amount-desc:before{content:"\f161"}.fa-sort-numeric-asc:before{content:"\f162"}.fa-sort-numeric-desc:before{content:"\f163"}.fa-thumbs-up:before{content:"\f164"}.fa-thumbs-down:before{content:"\f165"}.fa-youtube-square:before{content:"\f166"}.fa-youtube:before{content:"\f167"}.fa-xing:before{content:"\f168"}.fa-xing-square:before{content:"\f169"}.fa-youtube-play:before{content:"\f16a"}.fa-dropbox:before{content:"\f16b"}.fa-stack-overflow:before{content:"\f16c"}.fa-instagram:before{content:"\f16d"}.fa-flickr:before{content:"\f16e"}.fa-adn:before{content:"\f170"}.fa-bitbucket:before{content:"\f171"}.fa-bitbucket-square:before{content:"\f172"}.fa-tumblr:before{content:"\f173"}.fa-tumblr-square:before{content:"\f174"}.fa-long-arrow-down:before{content:"\f175"}.fa-long-arrow-up:before{content:"\f176"}.fa-long-arrow-left:before{content:"\f177"}.fa-long-arrow-right:before{content:"\f178"}.fa-apple:before{content:"\f179"}.fa-windows:before{content:"\f17a"}.fa-android:before{content:"\f17b"}.fa-linux:before{content:"\f17c"}.fa-dribbble:before{content:"\f17d"}.fa-skype:before{content:"\f17e"}.fa-foursquare:before{content:"\f180"}.fa-trello:before{content:"\f181"}.fa-female:before{content:"\f182"}.fa-male:before{content:"\f183"}.fa-gittip:before{content:"\f184"}.fa-sun-o:before{content:"\f185"}.fa-moon-o:before{content:"\f186"}.fa-archive:before{content:"\f187"}.fa-bug:before{content:"\f188"}.fa-vk:before{content:"\f189"}.fa-weibo:before{content:"\f18a"}.fa-renren:before{content:"\f18b"}.fa-pagelines:before{content:"\f18c"}.fa-stack-exchange:before{content:"\f18d"}.fa-arrow-circle-o-right:before{content:"\f18e"}.fa-arrow-circle-o-left:before{content:"\f190"}.fa-caret-square-o-left:before,.fa-toggle-left:before{content:"\f191"}.fa-dot-circle-o:before{content:"\f192"}.fa-wheelchair:before{content:"\f193"}.fa-vimeo-square:before{content:"\f194"}.fa-try:before,.fa-turkish-lira:before{content:"\f195"}.fa-plus-square-o:before{content:"\f196"}.fa-space-shuttle:before{content:"\f197"}.fa-slack:before{content:"\f198"}.fa-envelope-square:before{content:"\f199"}.fa-wordpress:before{content:"\f19a"}.fa-openid:before{content:"\f19b"}.fa-bank:before,.fa-institution:before,.fa-university:before{content:"\f19c"}.fa-graduation-cap:before,.fa-mortar-board:before{content:"\f19d"}.fa-yahoo:before{content:"\f19e"}.fa-google:before{content:"\f1a0"}.fa-reddit:before{content:"\f1a1"}.fa-reddit-square:before{content:"\f1a2"}.fa-stumbleupon-circle:before{content:"\f1a3"}.fa-stumbleupon:before{content:"\f1a4"}.fa-delicious:before{content:"\f1a5"}.fa-digg:before{content:"\f1a6"}.fa-pied-piper-square:before,.fa-pied-piper:before{content:"\f1a7"}.fa-pied-piper-alt:before{content:"\f1a8"}.fa-drupal:before{content:"\f1a9"}.fa-joomla:before{content:"\f1aa"}.fa-language:before{content:"\f1ab"}.fa-fax:before{content:"\f1ac"}.fa-building:before{content:"\f1ad"}.fa-child:before{content:"\f1ae"}.fa-paw:before{content:"\f1b0"}.fa-spoon:before{content:"\f1b1"}.fa-cube:before{content:"\f1b2"}.fa-cubes:before{content:"\f1b3"}.fa-behance:before{content:"\f1b4"}.fa-behance-square:before{content:"\f1b5"}.fa-steam:before{content:"\f1b6"}.fa-steam-square:before{content:"\f1b7"}.fa-recycle:before{content:"\f1b8"}.fa-automobile:before,.fa-car:before{content:"\f1b9"}.fa-cab:before,.fa-taxi:before{content:"\f1ba"}.fa-tree:before{content:"\f1bb"}.fa-spotify:before{content:"\f1bc"}.fa-deviantart:before{content:"\f1bd"}.fa-soundcloud:before{content:"\f1be"}.fa-database:before{content:"\f1c0"}.fa-file-pdf-o:before{content:"\f1c1"}.fa-file-word-o:before{content:"\f1c2"}.fa-file-excel-o:before{content:"\f1c3"}.fa-file-powerpoint-o:before{content:"\f1c4"}.fa-file-image-o:before,.fa-file-photo-o:before,.fa-file-picture-o:before{content:"\f1c5"}.fa-file-archive-o:before,.fa-file-zip-o:before{content:"\f1c6"}.fa-file-audio-o:before,.fa-file-sound-o:before{content:"\f1c7"}.fa-file-movie-o:before,.fa-file-video-o:before{content:"\f1c8"}.fa-file-code-o:before{content:"\f1c9"}.fa-vine:before{content:"\f1ca"}.fa-codepen:before{content:"\f1cb"}.fa-jsfiddle:before{content:"\f1cc"}.fa-life-bouy:before,.fa-life-ring:before,.fa-life-saver:before,.fa-support:before{content:"\f1cd"}.fa-circle-o-notch:before{content:"\f1ce"}.fa-ra:before,.fa-rebel:before{content:"\f1d0"}.fa-empire:before,.fa-ge:before{content:"\f1d1"}.fa-git-square:before{content:"\f1d2"}.fa-git:before{content:"\f1d3"}.fa-hacker-news:before{content:"\f1d4"}.fa-tencent-weibo:before{content:"\f1d5"}.fa-qq:before{content:"\f1d6"}.fa-wechat:before,.fa-weixin:before{content:"\f1d7"}.fa-paper-plane:before,.fa-send:before{content:"\f1d8"}.fa-paper-plane-o:before,.fa-send-o:before{content:"\f1d9"}.fa-history:before{content:"\f1da"}.fa-circle-thin:before{content:"\f1db"}.fa-header:before{content:"\f1dc"}.fa-paragraph:before{content:"\f1dd"}.fa-sliders:before{content:"\f1de"}.fa-share-alt:before{content:"\f1e0"}.fa-share-alt-square:before{content:"\f1e1"}.fa-bomb:before{content:"\f1e2"}.book-langs-index{width:100%;height:100%;padding:40px 0;margin:0;overflow:auto}@media (max-width:600px){.book-langs-index{padding:0}}.book-langs-index .inner{max-width:600px;width:100%;margin:0 auto;padding:30px;background:#fff;border-radius:3px}.book-langs-index .inner h3{margin:0}.book-langs-index .inner .languages{list-style:none;padding:20px 30px;margin-top:20px;border-top:1px solid #eee}.book-langs-index .inner .languages:after,.book-langs-index .inner .languages:before{content:" ";display:table;line-height:0}.book-langs-index .inner .languages li{width:50%;float:left;padding:10px 5px;font-size:16px}@media (max-width:600px){.book-langs-index .inner .languages li{width:100%;max-width:100%}}.book .book-header{overflow:visible;height:50px;padding:0 8px;z-index:2;font-size:.85em;color:#7e888b;background:0 0}.book .book-header .btn{display:block;height:50px;padding:0 15px;border-bottom:none;color:#ccc;text-transform:uppercase;line-height:50px;-webkit-box-shadow:none!important;box-shadow:none!important;position:relative;font-size:14px}.book .book-header .btn:hover{position:relative;text-decoration:none;color:#444;background:0 0}.book .book-header h1{margin:0;font-size:20px;font-weight:200;text-align:center;line-height:50px;opacity:0;padding-left:200px;padding-right:200px;-webkit-transition:opacity .2s ease;-moz-transition:opacity .2s ease;-o-transition:opacity .2s ease;transition:opacity .2s ease;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.book .book-header h1 a,.book .book-header h1 a:hover{color:inherit;text-decoration:none}@media (max-width:1000px){.book .book-header h1{display:none}}.book .book-header h1 i{display:none}.book .book-header:hover h1{opacity:1}.book.is-loading .book-header h1 i{display:inline-block}.book.is-loading .book-header h1 a{display:none}.dropdown{position:relative}.dropdown-menu{position:absolute;top:100%;left:0;z-index:100;display:none;float:left;min-width:160px;padding:0;margin:2px 0 0;list-style:none;font-size:14px;background-color:#fafafa;border:1px solid rgba(0,0,0,.07);border-radius:1px;-webkit-box-shadow:0 6px 12px rgba(0,0,0,.175);box-shadow:0 6px 12px rgba(0,0,0,.175);background-clip:padding-box}.dropdown-menu.open{display:block}.dropdown-menu.dropdown-left{left:auto;right:4%}.dropdown-menu.dropdown-left .dropdown-caret{right:14px;left:auto}.dropdown-menu .dropdown-caret{position:absolute;top:-8px;left:14px;width:18px;height:10px;float:left;overflow:hidden}.dropdown-menu .dropdown-caret .caret-inner,.dropdown-menu .dropdown-caret .caret-outer{display:inline-block;top:0;border-left:9px solid transparent;border-right:9px solid transparent;position:absolute}.dropdown-menu .dropdown-caret .caret-outer{border-bottom:9px solid rgba(0,0,0,.1);height:auto;left:0;width:auto;margin-left:-1px}.dropdown-menu .dropdown-caret .caret-inner{margin-top:-1px;top:1px;border-bottom:9px solid #fafafa}.dropdown-menu .buttons{border-bottom:1px solid rgba(0,0,0,.07)}.dropdown-menu .buttons:after,.dropdown-menu .buttons:before{content:" ";display:table;line-height:0}.dropdown-menu .buttons:last-child{border-bottom:none}.dropdown-menu .buttons .button{border:0;background-color:transparent;color:#a6a6a6;width:100%;text-align:center;float:left;line-height:1.42857143;padding:8px 4px}.alert,.dropdown-menu .buttons .button:hover{color:#444}.dropdown-menu .buttons .button:focus,.dropdown-menu .buttons .button:hover{outline:0}.dropdown-menu .buttons .button.size-2{width:50%}.dropdown-menu .buttons .button.size-3{width:33%}.alert{padding:15px;margin-bottom:20px;background:#eee;border-bottom:5px solid #ddd}.alert-success{background:#dff0d8;border-color:#d6e9c6;color:#3c763d}.alert-info{background:#d9edf7;border-color:#bce8f1;color:#31708f}.alert-danger{background:#f2dede;border-color:#ebccd1;color:#a94442}.alert-warning{background:#fcf8e3;border-color:#faebcc;color:#8a6d3b}.book .book-summary{position:absolute;top:0;left:-300px;bottom:0;z-index:1;width:300px;color:#364149;background:#fafafa;border-right:1px solid rgba(0,0,0,.07);-webkit-transition:left 250ms ease;-moz-transition:left 250ms ease;-o-transition:left 250ms ease;transition:left 250ms ease}.book .book-summary ul.summary{position:absolute;top:0;left:0;right:0;bottom:0;overflow-y:auto;list-style:none;margin:0;padding:0;-webkit-transition:top .5s ease;-moz-transition:top .5s ease;-o-transition:top .5s ease;transition:top .5s ease}.book .book-summary ul.summary li{list-style:none}.book .book-summary ul.summary li.divider{height:1px;margin:7px 0;overflow:hidden;background:rgba(0,0,0,.07)}.book .book-summary ul.summary li i.fa-check{display:none;position:absolute;right:9px;top:16px;font-size:9px;color:#3c3}.book .book-summary ul.summary li.done>a{color:#364149;font-weight:400}.book .book-summary ul.summary li.done>a i{display:inline}.book .book-summary ul.summary li a,.book .book-summary ul.summary li span{display:block;padding:10px 15px;border-bottom:none;color:#364149;background:0 0;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;position:relative}.book .book-summary ul.summary li span{cursor:not-allowed;opacity:.3;filter:alpha(opacity=30)}.book .book-summary ul.summary li a:hover,.book .book-summary ul.summary li.active>a{color:#008cff;background:0 0;text-decoration:none}.book .book-summary ul.summary li ul{padding-left:20px}@media (max-width:600px){.book .book-summary{width:calc(100% - 60px);bottom:0;left:-100%}}.book.with-summary .book-summary{left:0}.book.without-animation .book-summary{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;transition:none!important}.book{position:relative;width:100%;height:100%}.book .book-body,.book .book-body .body-inner{position:absolute;top:0;left:0;overflow-y:auto;bottom:0;right:0}.book .book-body{color:#000;background:#fff;-webkit-transition:left 250ms ease;-moz-transition:left 250ms ease;-o-transition:left 250ms ease;transition:left 250ms ease}.book .book-body .page-wrapper{position:relative;outline:0}.book .book-body .page-wrapper .page-inner{max-width:800px;margin:0 auto;padding:20px 0 40px}.book .book-body .page-wrapper .page-inner section{margin:0;padding:5px 15px;background:#fff;border-radius:2px;line-height:1.7;font-size:1.6rem}.book .book-body .page-wrapper .page-inner .btn-group .btn{border-radius:0;background:#eee;border:0}@media (max-width:1240px){.book .book-body{-webkit-transition:-webkit-transform 250ms ease;-moz-transition:-moz-transform 250ms ease;-o-transition:-o-transform 250ms ease;transition:transform 250ms ease;padding-bottom:20px}.book .book-body .body-inner{position:static;min-height:calc(100% - 50px)}}@media (min-width:600px){.book.with-summary .book-body{left:300px}}@media (max-width:600px){.book.with-summary{overflow:hidden}.book.with-summary .book-body{-webkit-transform:translate(calc(100% - 60px),0);-moz-transform:translate(calc(100% - 60px),0);-ms-transform:translate(calc(100% - 60px),0);-o-transform:translate(calc(100% - 60px),0);transform:translate(calc(100% - 60px),0)}}.book.without-animation .book-body{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;transition:none!important}.buttons:after,.buttons:before{content:" ";display:table;line-height:0}.button{border:0;background:#eee;color:#666;width:100%;text-align:center;float:left;line-height:1.42857143;padding:8px 4px}.button:hover{color:#444}.button:focus,.button:hover{outline:0}.button.size-2{width:50%}.button.size-3{width:33%}.book .book-body .page-wrapper .page-inner section{display:none}.book .book-body .page-wrapper .page-inner section.normal{display:block;word-wrap:break-word;overflow:hidden;color:#333;line-height:1.7;text-size-adjust:100%;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;-moz-text-size-adjust:100%}.book .book-body .page-wrapper .page-inner section.normal *{box-sizing:border-box;-webkit-box-sizing:border-box;font-size:inherit}.book .book-body .page-wrapper .page-inner section.normal>:first-child{margin-top:0!important}.book .book-body .page-wrapper .page-inner section.normal>:last-child{margin-bottom:0!important}.book .book-body .page-wrapper .page-inner section.normal blockquote,.book .book-body .page-wrapper .page-inner section.normal code,.book .book-body .page-wrapper .page-inner section.normal figure,.book .book-body .page-wrapper .page-inner section.normal img,.book .book-body .page-wrapper .page-inner section.normal pre,.book .book-body .page-wrapper .page-inner section.normal table,.book .book-body .page-wrapper .page-inner section.normal tr{page-break-inside:avoid}.book .book-body .page-wrapper .page-inner section.normal h2,.book .book-body .page-wrapper .page-inner section.normal h3,.book .book-body .page-wrapper .page-inner section.normal h4,.book .book-body .page-wrapper .page-inner section.normal h5,.book .book-body .page-wrapper .page-inner section.normal p{orphans:3;widows:3}.book .book-body .page-wrapper .page-inner section.normal h1,.book .book-body .page-wrapper .page-inner section.normal h2,.book .book-body .page-wrapper .page-inner section.normal h3,.book .book-body .page-wrapper .page-inner section.normal h4,.book .book-body .page-wrapper .page-inner section.normal h5{page-break-after:avoid}.book .book-body .page-wrapper .page-inner section.normal b,.book .book-body .page-wrapper .page-inner section.normal strong{font-weight:700}.book .book-body .page-wrapper .page-inner section.normal em{font-style:italic}.book .book-body .page-wrapper .page-inner section.normal blockquote,.book .book-body .page-wrapper .page-inner section.normal dl,.book .book-body .page-wrapper .page-inner section.normal ol,.book .book-body .page-wrapper .page-inner section.normal p,.book .book-body .page-wrapper .page-inner section.normal table,.book .book-body .page-wrapper .page-inner section.normal ul{margin-top:0;margin-bottom:.85em}.book .book-body .page-wrapper .page-inner section.normal a{color:#4183c4;text-decoration:none;background:0 0}.book .book-body .page-wrapper .page-inner section.normal a:active,.book .book-body .page-wrapper .page-inner section.normal a:focus,.book .book-body .page-wrapper .page-inner section.normal a:hover{outline:0;text-decoration:underline}.book .book-body .page-wrapper .page-inner section.normal img{border:0;max-width:100%}.book .book-body .page-wrapper .page-inner section.normal hr{height:4px;padding:0;margin:1.7em 0;overflow:hidden;background-color:#e7e7e7;border:none}.book .book-body .page-wrapper .page-inner section.normal hr:after,.book .book-body .page-wrapper .page-inner section.normal hr:before{display:table;content:" "}.book .book-body .page-wrapper .page-inner section.normal h1,.book .book-body .page-wrapper .page-inner section.normal h2,.book .book-body .page-wrapper .page-inner section.normal h3,.book .book-body .page-wrapper .page-inner section.normal h4,.book .book-body .page-wrapper .page-inner section.normal h5,.book .book-body .page-wrapper .page-inner section.normal h6{margin-top:1.275em;margin-bottom:.85em;}.book .book-body .page-wrapper .page-inner section.normal h1{font-size:2em}.book .book-body .page-wrapper .page-inner section.normal h2{font-size:1.75em}.book .book-body .page-wrapper .page-inner section.normal h3{font-size:1.5em}.book .book-body .page-wrapper .page-inner section.normal h4{font-size:1.25em}.book .book-body .page-wrapper .page-inner section.normal h5{font-size:1em}.book .book-body .page-wrapper .page-inner section.normal h6{font-size:1em;color:#777}.book .book-body .page-wrapper .page-inner section.normal code,.book .book-body .page-wrapper .page-inner section.normal pre{font-family:Consolas,"Liberation Mono",Menlo,Courier,monospace;direction:ltr;border:none;color:inherit}.book .book-body .page-wrapper .page-inner section.normal pre{overflow:auto;word-wrap:normal;margin:0 0 1.275em;padding:.85em 1em;background:#f7f7f7}.book .book-body .page-wrapper .page-inner section.normal pre>code{display:inline;max-width:initial;padding:0;margin:0;overflow:initial;line-height:inherit;font-size:.85em;white-space:pre;background:0 0}.book .book-body .page-wrapper .page-inner section.normal pre>code:after,.book .book-body .page-wrapper .page-inner section.normal pre>code:before{content:normal}.book .book-body .page-wrapper .page-inner section.normal code{padding:.2em;margin:0;font-size:.85em;background-color:#f7f7f7}.book .book-body .page-wrapper .page-inner section.normal code:after,.book .book-body .page-wrapper .page-inner section.normal code:before{letter-spacing:-.2em;content:"\00a0"}.book .book-body .page-wrapper .page-inner section.normal table{display:table;width:100%;border-collapse:collapse;border-spacing:0;overflow:auto}.book .book-body .page-wrapper .page-inner section.normal table td,.book .book-body .page-wrapper .page-inner section.normal table th{padding:6px 13px;border:1px solid #ddd}.book .book-body .page-wrapper .page-inner section.normal table tr{background-color:#fff;border-top:1px solid #ccc}.book .book-body .page-wrapper .page-inner section.normal table tr:nth-child(2n){background-color:#f8f8f8}.book .book-body .page-wrapper .page-inner section.normal table th{font-weight:700}.book .book-body .page-wrapper .page-inner section.normal ol,.book .book-body .page-wrapper .page-inner section.normal ul{padding:0 0 0 2em;margin:0 0 .85em}.book .book-body .page-wrapper .page-inner section.normal ol ol,.book .book-body .page-wrapper .page-inner section.normal ol ul,.book .book-body .page-wrapper .page-inner section.normal ul ol,.book .book-body .page-wrapper .page-inner section.normal ul ul{margin-top:0;margin-bottom:0}.book .book-body .page-wrapper .page-inner section.normal ol ol{list-style-type:lower-roman}.book .book-body .page-wrapper .page-inner section.normal blockquote{margin:0 0 .85em;padding:0 15px;color:#858585;border-left:4px solid #e5e5e5}.book .book-body .page-wrapper .page-inner section.normal blockquote:first-child{margin-top:0}.book .book-body .page-wrapper .page-inner section.normal blockquote:last-child{margin-bottom:0}.book .book-body .page-wrapper .page-inner section.normal dl{padding:0}.book .book-body .page-wrapper .page-inner section.normal dl dt{padding:0;margin-top:.85em;font-style:italic;font-weight:700}.book .book-body .page-wrapper .page-inner section.normal dl dd{padding:0 .85em;margin-bottom:.85em}.book .book-body .page-wrapper .page-inner section.normal dd{margin-left:0}.book .book-body .page-wrapper .page-inner section.normal .glossary-term{cursor:help;text-decoration:underline}.book .book-body .navigation{position:absolute;top:50px;bottom:0;margin:0;max-width:150px;min-width:90px;display:flex;justify-content:center;align-content:center;flex-direction:column;font-size:40px;color:#ccc;text-align:center;-webkit-transition:all 350ms ease;-moz-transition:all 350ms ease;-o-transition:all 350ms ease;transition:all 350ms ease}.book .book-body .navigation:hover{text-decoration:none;color:#444}.book .book-body .navigation.navigation-next{right:0}.book .book-body .navigation.navigation-prev{left:0}@media (max-width:1240px){.book .book-body .navigation{position:static;top:auto;max-width:50%;width:50%;display:inline-block;float:left}.book .book-body .navigation.navigation-unique{max-width:100%;width:100%}}.book .book-body .page-wrapper .page-inner section.glossary{margin-bottom:40px}.book .book-body .page-wrapper .page-inner section.glossary h2 a,.book .book-body .page-wrapper .page-inner section.glossary h2 a:hover{color:inherit;text-decoration:none}.book .book-body .page-wrapper .page-inner section.glossary .glossary-index{list-style:none;margin:0;padding:0}.book .book-body .page-wrapper .page-inner section.glossary .glossary-index li{display:inline;margin:0 8px;white-space:nowrap}*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-overflow-scrolling:touch;-webkit-tap-highlight-color:transparent;-webkit-text-size-adjust:none;-webkit-touch-callout:none}a{text-decoration:none}body,html{height:100%}html{font-size:62.5%}body{text-rendering:optimizeLegibility;font-smoothing:antialiased;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;letter-spacing:.2px;text-size-adjust:100%} + */@font-face{font-family:FontAwesome;src:url(./fontawesome/fontawesome-webfont.ttf?v=4.1.0) format('truetype');font-weight:400;font-style:normal}.fa{font-family:FontAwesome;font-style:normal;font-weight:400;line-height:1;-moz-osx-font-smoothing:grayscale}.book .book-header,.book .book-summary{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif}.fa-lg{font-size:1.33333333em;line-height:.75em;vertical-align:-15%}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-fw{width:1.28571429em;text-align:center}.fa-ul{padding-left:0;margin-left:2.14285714em;list-style-type:none}.fa-li{position:absolute;left:-2.14285714em;width:2.14285714em;top:.14285714em;text-align:center}.fa-li.fa-lg{left:-1.85714286em}.fa-border{padding:.2em .25em .15em;border:.08em solid #eee;border-radius:.1em}.pull-right{float:right}.pull-left{float:left}.fa.pull-left{margin-right:.3em}.fa.pull-right{margin-left:.3em}.fa-spin{-webkit-animation:spin 2s infinite linear;-moz-animation:spin 2s infinite linear;-o-animation:spin 2s infinite linear;animation:spin 2s infinite linear}@-moz-keyframes spin{0%{-moz-transform:rotate(0)}100%{-moz-transform:rotate(359deg)}}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0)}100%{-webkit-transform:rotate(359deg)}}@-o-keyframes spin{0%{-o-transform:rotate(0)}100%{-o-transform:rotate(359deg)}}@keyframes spin{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.fa-rotate-90{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=1);-webkit-transform:rotate(90deg);-moz-transform:rotate(90deg);-ms-transform:rotate(90deg);-o-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=2);-webkit-transform:rotate(180deg);-moz-transform:rotate(180deg);-ms-transform:rotate(180deg);-o-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=3);-webkit-transform:rotate(270deg);-moz-transform:rotate(270deg);-ms-transform:rotate(270deg);-o-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1);-webkit-transform:scale(-1,1);-moz-transform:scale(-1,1);-ms-transform:scale(-1,1);-o-transform:scale(-1,1);transform:scale(-1,1)}.fa-flip-vertical{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1);-webkit-transform:scale(1,-1);-moz-transform:scale(1,-1);-ms-transform:scale(1,-1);-o-transform:scale(1,-1);transform:scale(1,-1)}.fa-stack{position:relative;width:2em;height:2em;line-height:2em;vertical-align:middle}.fa-stack-1x,.fa-stack-2x{position:absolute;left:0;width:100%;text-align:center}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-inverse{color:#fff}.fa-glass:before{content:"\f000"}.fa-music:before{content:"\f001"}.fa-search:before{content:"\f002"}.fa-envelope-o:before{content:"\f003"}.fa-heart:before{content:"\f004"}.fa-star:before{content:"\f005"}.fa-star-o:before{content:"\f006"}.fa-user:before{content:"\f007"}.fa-film:before{content:"\f008"}.fa-th-large:before{content:"\f009"}.fa-th:before{content:"\f00a"}.fa-th-list:before{content:"\f00b"}.fa-check:before{content:"\f00c"}.fa-times:before{content:"\f00d"}.fa-search-plus:before{content:"\f00e"}.fa-search-minus:before{content:"\f010"}.fa-power-off:before{content:"\f011"}.fa-signal:before{content:"\f012"}.fa-cog:before,.fa-gear:before{content:"\f013"}.fa-trash-o:before{content:"\f014"}.fa-home:before{content:"\f015"}.fa-file-o:before{content:"\f016"}.fa-clock-o:before{content:"\f017"}.fa-road:before{content:"\f018"}.fa-download:before{content:"\f019"}.fa-arrow-circle-o-down:before{content:"\f01a"}.fa-arrow-circle-o-up:before{content:"\f01b"}.fa-inbox:before{content:"\f01c"}.fa-play-circle-o:before{content:"\f01d"}.fa-repeat:before,.fa-rotate-right:before{content:"\f01e"}.fa-refresh:before{content:"\f021"}.fa-list-alt:before{content:"\f022"}.fa-lock:before{content:"\f023"}.fa-flag:before{content:"\f024"}.fa-headphones:before{content:"\f025"}.fa-volume-off:before{content:"\f026"}.fa-volume-down:before{content:"\f027"}.fa-volume-up:before{content:"\f028"}.fa-qrcode:before{content:"\f029"}.fa-barcode:before{content:"\f02a"}.fa-tag:before{content:"\f02b"}.fa-tags:before{content:"\f02c"}.fa-book:before{content:"\f02d"}.fa-bookmark:before{content:"\f02e"}.fa-print:before{content:"\f02f"}.fa-camera:before{content:"\f030"}.fa-font:before{content:"\f031"}.fa-bold:before{content:"\f032"}.fa-italic:before{content:"\f033"}.fa-text-height:before{content:"\f034"}.fa-text-width:before{content:"\f035"}.fa-align-left:before{content:"\f036"}.fa-align-center:before{content:"\f037"}.fa-align-right:before{content:"\f038"}.fa-align-justify:before{content:"\f039"}.fa-list:before{content:"\f03a"}.fa-dedent:before,.fa-outdent:before{content:"\f03b"}.fa-indent:before{content:"\f03c"}.fa-video-camera:before{content:"\f03d"}.fa-image:before,.fa-photo:before,.fa-picture-o:before{content:"\f03e"}.fa-pencil:before{content:"\f040"}.fa-map-marker:before{content:"\f041"}.fa-adjust:before{content:"\f042"}.fa-tint:before{content:"\f043"}.fa-edit:before,.fa-pencil-square-o:before{content:"\f044"}.fa-share-square-o:before{content:"\f045"}.fa-check-square-o:before{content:"\f046"}.fa-arrows:before{content:"\f047"}.fa-step-backward:before{content:"\f048"}.fa-fast-backward:before{content:"\f049"}.fa-backward:before{content:"\f04a"}.fa-play:before{content:"\f04b"}.fa-pause:before{content:"\f04c"}.fa-stop:before{content:"\f04d"}.fa-forward:before{content:"\f04e"}.fa-fast-forward:before{content:"\f050"}.fa-step-forward:before{content:"\f051"}.fa-eject:before{content:"\f052"}.fa-chevron-left:before{content:"\f053"}.fa-chevron-right:before{content:"\f054"}.fa-plus-circle:before{content:"\f055"}.fa-minus-circle:before{content:"\f056"}.fa-times-circle:before{content:"\f057"}.fa-check-circle:before{content:"\f058"}.fa-question-circle:before{content:"\f059"}.fa-info-circle:before{content:"\f05a"}.fa-crosshairs:before{content:"\f05b"}.fa-times-circle-o:before{content:"\f05c"}.fa-check-circle-o:before{content:"\f05d"}.fa-ban:before{content:"\f05e"}.fa-arrow-left:before{content:"\f060"}.fa-arrow-right:before{content:"\f061"}.fa-arrow-up:before{content:"\f062"}.fa-arrow-down:before{content:"\f063"}.fa-mail-forward:before,.fa-share:before{content:"\f064"}.fa-expand:before{content:"\f065"}.fa-compress:before{content:"\f066"}.fa-plus:before{content:"\f067"}.fa-minus:before{content:"\f068"}.fa-asterisk:before{content:"\f069"}.fa-exclamation-circle:before{content:"\f06a"}.fa-gift:before{content:"\f06b"}.fa-leaf:before{content:"\f06c"}.fa-fire:before{content:"\f06d"}.fa-eye:before{content:"\f06e"}.fa-eye-slash:before{content:"\f070"}.fa-exclamation-triangle:before,.fa-warning:before{content:"\f071"}.fa-plane:before{content:"\f072"}.fa-calendar:before{content:"\f073"}.fa-random:before{content:"\f074"}.fa-comment:before{content:"\f075"}.fa-magnet:before{content:"\f076"}.fa-chevron-up:before{content:"\f077"}.fa-chevron-down:before{content:"\f078"}.fa-retweet:before{content:"\f079"}.fa-shopping-cart:before{content:"\f07a"}.fa-folder:before{content:"\f07b"}.fa-folder-open:before{content:"\f07c"}.fa-arrows-v:before{content:"\f07d"}.fa-arrows-h:before{content:"\f07e"}.fa-bar-chart-o:before{content:"\f080"}.fa-twitter-square:before{content:"\f081"}.fa-facebook-square:before{content:"\f082"}.fa-camera-retro:before{content:"\f083"}.fa-key:before{content:"\f084"}.fa-cogs:before,.fa-gears:before{content:"\f085"}.fa-comments:before{content:"\f086"}.fa-thumbs-o-up:before{content:"\f087"}.fa-thumbs-o-down:before{content:"\f088"}.fa-star-half:before{content:"\f089"}.fa-heart-o:before{content:"\f08a"}.fa-sign-out:before{content:"\f08b"}.fa-linkedin-square:before{content:"\f08c"}.fa-thumb-tack:before{content:"\f08d"}.fa-external-link:before{content:"\f08e"}.fa-sign-in:before{content:"\f090"}.fa-trophy:before{content:"\f091"}.fa-github-square:before{content:"\f092"}.fa-upload:before{content:"\f093"}.fa-lemon-o:before{content:"\f094"}.fa-phone:before{content:"\f095"}.fa-square-o:before{content:"\f096"}.fa-bookmark-o:before{content:"\f097"}.fa-phone-square:before{content:"\f098"}.fa-twitter:before{content:"\f099"}.fa-facebook:before{content:"\f09a"}.fa-github:before{content:"\f09b"}.fa-unlock:before{content:"\f09c"}.fa-credit-card:before{content:"\f09d"}.fa-rss:before{content:"\f09e"}.fa-hdd-o:before{content:"\f0a0"}.fa-bullhorn:before{content:"\f0a1"}.fa-bell:before{content:"\f0f3"}.fa-certificate:before{content:"\f0a3"}.fa-hand-o-right:before{content:"\f0a4"}.fa-hand-o-left:before{content:"\f0a5"}.fa-hand-o-up:before{content:"\f0a6"}.fa-hand-o-down:before{content:"\f0a7"}.fa-arrow-circle-left:before{content:"\f0a8"}.fa-arrow-circle-right:before{content:"\f0a9"}.fa-arrow-circle-up:before{content:"\f0aa"}.fa-arrow-circle-down:before{content:"\f0ab"}.fa-globe:before{content:"\f0ac"}.fa-wrench:before{content:"\f0ad"}.fa-tasks:before{content:"\f0ae"}.fa-filter:before{content:"\f0b0"}.fa-briefcase:before{content:"\f0b1"}.fa-arrows-alt:before{content:"\f0b2"}.fa-group:before,.fa-users:before{content:"\f0c0"}.fa-chain:before,.fa-link:before{content:"\f0c1"}.fa-cloud:before{content:"\f0c2"}.fa-flask:before{content:"\f0c3"}.fa-cut:before,.fa-scissors:before{content:"\f0c4"}.fa-copy:before,.fa-files-o:before{content:"\f0c5"}.fa-paperclip:before{content:"\f0c6"}.fa-floppy-o:before,.fa-save:before{content:"\f0c7"}.fa-square:before{content:"\f0c8"}.fa-bars:before,.fa-navicon:before,.fa-reorder:before{content:"\f0c9"}.fa-list-ul:before{content:"\f0ca"}.fa-list-ol:before{content:"\f0cb"}.fa-strikethrough:before{content:"\f0cc"}.fa-underline:before{content:"\f0cd"}.fa-table:before{content:"\f0ce"}.fa-magic:before{content:"\f0d0"}.fa-truck:before{content:"\f0d1"}.fa-pinterest:before{content:"\f0d2"}.fa-pinterest-square:before{content:"\f0d3"}.fa-google-plus-square:before{content:"\f0d4"}.fa-google-plus:before{content:"\f0d5"}.fa-money:before{content:"\f0d6"}.fa-caret-down:before{content:"\f0d7"}.fa-caret-up:before{content:"\f0d8"}.fa-caret-left:before{content:"\f0d9"}.fa-caret-right:before{content:"\f0da"}.fa-columns:before{content:"\f0db"}.fa-sort:before,.fa-unsorted:before{content:"\f0dc"}.fa-sort-desc:before,.fa-sort-down:before{content:"\f0dd"}.fa-sort-asc:before,.fa-sort-up:before{content:"\f0de"}.fa-envelope:before{content:"\f0e0"}.fa-linkedin:before{content:"\f0e1"}.fa-rotate-left:before,.fa-undo:before{content:"\f0e2"}.fa-gavel:before,.fa-legal:before{content:"\f0e3"}.fa-dashboard:before,.fa-tachometer:before{content:"\f0e4"}.fa-comment-o:before{content:"\f0e5"}.fa-comments-o:before{content:"\f0e6"}.fa-bolt:before,.fa-flash:before{content:"\f0e7"}.fa-sitemap:before{content:"\f0e8"}.fa-umbrella:before{content:"\f0e9"}.fa-clipboard:before,.fa-paste:before{content:"\f0ea"}.fa-lightbulb-o:before{content:"\f0eb"}.fa-exchange:before{content:"\f0ec"}.fa-cloud-download:before{content:"\f0ed"}.fa-cloud-upload:before{content:"\f0ee"}.fa-user-md:before{content:"\f0f0"}.fa-stethoscope:before{content:"\f0f1"}.fa-suitcase:before{content:"\f0f2"}.fa-bell-o:before{content:"\f0a2"}.fa-coffee:before{content:"\f0f4"}.fa-cutlery:before{content:"\f0f5"}.fa-file-text-o:before{content:"\f0f6"}.fa-building-o:before{content:"\f0f7"}.fa-hospital-o:before{content:"\f0f8"}.fa-ambulance:before{content:"\f0f9"}.fa-medkit:before{content:"\f0fa"}.fa-fighter-jet:before{content:"\f0fb"}.fa-beer:before{content:"\f0fc"}.fa-h-square:before{content:"\f0fd"}.fa-plus-square:before{content:"\f0fe"}.fa-angle-double-left:before{content:"\f100"}.fa-angle-double-right:before{content:"\f101"}.fa-angle-double-up:before{content:"\f102"}.fa-angle-double-down:before{content:"\f103"}.fa-angle-left:before{content:"\f104"}.fa-angle-right:before{content:"\f105"}.fa-angle-up:before{content:"\f106"}.fa-angle-down:before{content:"\f107"}.fa-desktop:before{content:"\f108"}.fa-laptop:before{content:"\f109"}.fa-tablet:before{content:"\f10a"}.fa-mobile-phone:before,.fa-mobile:before{content:"\f10b"}.fa-circle-o:before{content:"\f10c"}.fa-quote-left:before{content:"\f10d"}.fa-quote-right:before{content:"\f10e"}.fa-spinner:before{content:"\f110"}.fa-circle:before{content:"\f111"}.fa-mail-reply:before,.fa-reply:before{content:"\f112"}.fa-github-alt:before{content:"\f113"}.fa-folder-o:before{content:"\f114"}.fa-folder-open-o:before{content:"\f115"}.fa-smile-o:before{content:"\f118"}.fa-frown-o:before{content:"\f119"}.fa-meh-o:before{content:"\f11a"}.fa-gamepad:before{content:"\f11b"}.fa-keyboard-o:before{content:"\f11c"}.fa-flag-o:before{content:"\f11d"}.fa-flag-checkered:before{content:"\f11e"}.fa-terminal:before{content:"\f120"}.fa-code:before{content:"\f121"}.fa-mail-reply-all:before,.fa-reply-all:before{content:"\f122"}.fa-star-half-empty:before,.fa-star-half-full:before,.fa-star-half-o:before{content:"\f123"}.fa-location-arrow:before{content:"\f124"}.fa-crop:before{content:"\f125"}.fa-code-fork:before{content:"\f126"}.fa-chain-broken:before,.fa-unlink:before{content:"\f127"}.fa-question:before{content:"\f128"}.fa-info:before{content:"\f129"}.fa-exclamation:before{content:"\f12a"}.fa-superscript:before{content:"\f12b"}.fa-subscript:before{content:"\f12c"}.fa-eraser:before{content:"\f12d"}.fa-puzzle-piece:before{content:"\f12e"}.fa-microphone:before{content:"\f130"}.fa-microphone-slash:before{content:"\f131"}.fa-shield:before{content:"\f132"}.fa-calendar-o:before{content:"\f133"}.fa-fire-extinguisher:before{content:"\f134"}.fa-rocket:before{content:"\f135"}.fa-maxcdn:before{content:"\f136"}.fa-chevron-circle-left:before{content:"\f137"}.fa-chevron-circle-right:before{content:"\f138"}.fa-chevron-circle-up:before{content:"\f139"}.fa-chevron-circle-down:before{content:"\f13a"}.fa-html5:before{content:"\f13b"}.fa-css3:before{content:"\f13c"}.fa-anchor:before{content:"\f13d"}.fa-unlock-alt:before{content:"\f13e"}.fa-bullseye:before{content:"\f140"}.fa-ellipsis-h:before{content:"\f141"}.fa-ellipsis-v:before{content:"\f142"}.fa-rss-square:before{content:"\f143"}.fa-play-circle:before{content:"\f144"}.fa-ticket:before{content:"\f145"}.fa-minus-square:before{content:"\f146"}.fa-minus-square-o:before{content:"\f147"}.fa-level-up:before{content:"\f148"}.fa-level-down:before{content:"\f149"}.fa-check-square:before{content:"\f14a"}.fa-pencil-square:before{content:"\f14b"}.fa-external-link-square:before{content:"\f14c"}.fa-share-square:before{content:"\f14d"}.fa-compass:before{content:"\f14e"}.fa-caret-square-o-down:before,.fa-toggle-down:before{content:"\f150"}.fa-caret-square-o-up:before,.fa-toggle-up:before{content:"\f151"}.fa-caret-square-o-right:before,.fa-toggle-right:before{content:"\f152"}.fa-eur:before,.fa-euro:before{content:"\f153"}.fa-gbp:before{content:"\f154"}.fa-dollar:before,.fa-usd:before{content:"\f155"}.fa-inr:before,.fa-rupee:before{content:"\f156"}.fa-cny:before,.fa-jpy:before,.fa-rmb:before,.fa-yen:before{content:"\f157"}.fa-rouble:before,.fa-rub:before,.fa-ruble:before{content:"\f158"}.fa-krw:before,.fa-won:before{content:"\f159"}.fa-bitcoin:before,.fa-btc:before{content:"\f15a"}.fa-file:before{content:"\f15b"}.fa-file-text:before{content:"\f15c"}.fa-sort-alpha-asc:before{content:"\f15d"}.fa-sort-alpha-desc:before{content:"\f15e"}.fa-sort-amount-asc:before{content:"\f160"}.fa-sort-amount-desc:before{content:"\f161"}.fa-sort-numeric-asc:before{content:"\f162"}.fa-sort-numeric-desc:before{content:"\f163"}.fa-thumbs-up:before{content:"\f164"}.fa-thumbs-down:before{content:"\f165"}.fa-youtube-square:before{content:"\f166"}.fa-youtube:before{content:"\f167"}.fa-xing:before{content:"\f168"}.fa-xing-square:before{content:"\f169"}.fa-youtube-play:before{content:"\f16a"}.fa-dropbox:before{content:"\f16b"}.fa-stack-overflow:before{content:"\f16c"}.fa-instagram:before{content:"\f16d"}.fa-flickr:before{content:"\f16e"}.fa-adn:before{content:"\f170"}.fa-bitbucket:before{content:"\f171"}.fa-bitbucket-square:before{content:"\f172"}.fa-tumblr:before{content:"\f173"}.fa-tumblr-square:before{content:"\f174"}.fa-long-arrow-down:before{content:"\f175"}.fa-long-arrow-up:before{content:"\f176"}.fa-long-arrow-left:before{content:"\f177"}.fa-long-arrow-right:before{content:"\f178"}.fa-apple:before{content:"\f179"}.fa-windows:before{content:"\f17a"}.fa-android:before{content:"\f17b"}.fa-linux:before{content:"\f17c"}.fa-dribbble:before{content:"\f17d"}.fa-skype:before{content:"\f17e"}.fa-foursquare:before{content:"\f180"}.fa-trello:before{content:"\f181"}.fa-female:before{content:"\f182"}.fa-male:before{content:"\f183"}.fa-gittip:before{content:"\f184"}.fa-sun-o:before{content:"\f185"}.fa-moon-o:before{content:"\f186"}.fa-archive:before{content:"\f187"}.fa-bug:before{content:"\f188"}.fa-vk:before{content:"\f189"}.fa-weibo:before{content:"\f18a"}.fa-renren:before{content:"\f18b"}.fa-pagelines:before{content:"\f18c"}.fa-stack-exchange:before{content:"\f18d"}.fa-arrow-circle-o-right:before{content:"\f18e"}.fa-arrow-circle-o-left:before{content:"\f190"}.fa-caret-square-o-left:before,.fa-toggle-left:before{content:"\f191"}.fa-dot-circle-o:before{content:"\f192"}.fa-wheelchair:before{content:"\f193"}.fa-vimeo-square:before{content:"\f194"}.fa-try:before,.fa-turkish-lira:before{content:"\f195"}.fa-plus-square-o:before{content:"\f196"}.fa-space-shuttle:before{content:"\f197"}.fa-slack:before{content:"\f198"}.fa-envelope-square:before{content:"\f199"}.fa-wordpress:before{content:"\f19a"}.fa-openid:before{content:"\f19b"}.fa-bank:before,.fa-institution:before,.fa-university:before{content:"\f19c"}.fa-graduation-cap:before,.fa-mortar-board:before{content:"\f19d"}.fa-yahoo:before{content:"\f19e"}.fa-google:before{content:"\f1a0"}.fa-reddit:before{content:"\f1a1"}.fa-reddit-square:before{content:"\f1a2"}.fa-stumbleupon-circle:before{content:"\f1a3"}.fa-stumbleupon:before{content:"\f1a4"}.fa-delicious:before{content:"\f1a5"}.fa-digg:before{content:"\f1a6"}.fa-pied-piper-square:before,.fa-pied-piper:before{content:"\f1a7"}.fa-pied-piper-alt:before{content:"\f1a8"}.fa-drupal:before{content:"\f1a9"}.fa-joomla:before{content:"\f1aa"}.fa-language:before{content:"\f1ab"}.fa-fax:before{content:"\f1ac"}.fa-building:before{content:"\f1ad"}.fa-child:before{content:"\f1ae"}.fa-paw:before{content:"\f1b0"}.fa-spoon:before{content:"\f1b1"}.fa-cube:before{content:"\f1b2"}.fa-cubes:before{content:"\f1b3"}.fa-behance:before{content:"\f1b4"}.fa-behance-square:before{content:"\f1b5"}.fa-steam:before{content:"\f1b6"}.fa-steam-square:before{content:"\f1b7"}.fa-recycle:before{content:"\f1b8"}.fa-automobile:before,.fa-car:before{content:"\f1b9"}.fa-cab:before,.fa-taxi:before{content:"\f1ba"}.fa-tree:before{content:"\f1bb"}.fa-spotify:before{content:"\f1bc"}.fa-deviantart:before{content:"\f1bd"}.fa-soundcloud:before{content:"\f1be"}.fa-database:before{content:"\f1c0"}.fa-file-pdf-o:before{content:"\f1c1"}.fa-file-word-o:before{content:"\f1c2"}.fa-file-excel-o:before{content:"\f1c3"}.fa-file-powerpoint-o:before{content:"\f1c4"}.fa-file-image-o:before,.fa-file-photo-o:before,.fa-file-picture-o:before{content:"\f1c5"}.fa-file-archive-o:before,.fa-file-zip-o:before{content:"\f1c6"}.fa-file-audio-o:before,.fa-file-sound-o:before{content:"\f1c7"}.fa-file-movie-o:before,.fa-file-video-o:before{content:"\f1c8"}.fa-file-code-o:before{content:"\f1c9"}.fa-vine:before{content:"\f1ca"}.fa-codepen:before{content:"\f1cb"}.fa-jsfiddle:before{content:"\f1cc"}.fa-life-bouy:before,.fa-life-ring:before,.fa-life-saver:before,.fa-support:before{content:"\f1cd"}.fa-circle-o-notch:before{content:"\f1ce"}.fa-ra:before,.fa-rebel:before{content:"\f1d0"}.fa-empire:before,.fa-ge:before{content:"\f1d1"}.fa-git-square:before{content:"\f1d2"}.fa-git:before{content:"\f1d3"}.fa-hacker-news:before{content:"\f1d4"}.fa-tencent-weibo:before{content:"\f1d5"}.fa-qq:before{content:"\f1d6"}.fa-wechat:before,.fa-weixin:before{content:"\f1d7"}.fa-paper-plane:before,.fa-send:before{content:"\f1d8"}.fa-paper-plane-o:before,.fa-send-o:before{content:"\f1d9"}.fa-history:before{content:"\f1da"}.fa-circle-thin:before{content:"\f1db"}.fa-header:before{content:"\f1dc"}.fa-paragraph:before{content:"\f1dd"}.fa-sliders:before{content:"\f1de"}.fa-share-alt:before{content:"\f1e0"}.fa-share-alt-square:before{content:"\f1e1"}.fa-bomb:before{content:"\f1e2"}.book-langs-index{width:100%;height:100%;padding:40px 0;margin:0;overflow:auto}@media (max-width:600px){.book-langs-index{padding:0}}.book-langs-index .inner{max-width:600px;width:100%;margin:0 auto;padding:30px;background:#fff;border-radius:3px}.book-langs-index .inner h3{margin:0}.book-langs-index .inner .languages{list-style:none;padding:20px 30px;margin-top:20px;border-top:1px solid #eee}.book-langs-index .inner .languages:after,.book-langs-index .inner .languages:before{content:" ";display:table;line-height:0}.book-langs-index .inner .languages li{width:50%;float:left;padding:10px 5px;font-size:16px}@media (max-width:600px){.book-langs-index .inner .languages li{width:100%;max-width:100%}}.book .book-header{overflow:visible;height:50px;padding:0 8px;z-index:2;font-size:.85em;color:#7e888b;background:0 0}.book .book-header .btn{display:block;height:50px;padding:0 15px;border-bottom:none;color:#ccc;text-transform:uppercase;line-height:50px;-webkit-box-shadow:none!important;box-shadow:none!important;position:relative;font-size:14px}.book .book-header .btn:hover{position:relative;text-decoration:none;color:#444;background:0 0}.book .book-header h1{margin:0;font-size:20px;font-weight:200;text-align:center;line-height:50px;opacity:0;padding-left:200px;padding-right:200px;-webkit-transition:opacity .2s ease;-moz-transition:opacity .2s ease;-o-transition:opacity .2s ease;transition:opacity .2s ease;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.book .book-header h1 a,.book .book-header h1 a:hover{color:inherit;text-decoration:none}@media (max-width:1000px){.book .book-header h1{display:none}}.book .book-header h1 i{display:none}.book .book-header:hover h1{opacity:1}.book.is-loading .book-header h1 i{display:inline-block}.book.is-loading .book-header h1 a{display:none}.dropdown{position:relative}.dropdown-menu{position:absolute;top:100%;left:0;z-index:100;display:none;float:left;min-width:160px;padding:0;margin:2px 0 0;list-style:none;font-size:14px;background-color:#fafafa;border:1px solid rgba(0,0,0,.07);border-radius:1px;-webkit-box-shadow:0 6px 12px rgba(0,0,0,.175);box-shadow:0 6px 12px rgba(0,0,0,.175);background-clip:padding-box}.dropdown-menu.open{display:block}.dropdown-menu.dropdown-left{left:auto;right:4%}.dropdown-menu.dropdown-left .dropdown-caret{right:14px;left:auto}.dropdown-menu .dropdown-caret{position:absolute;top:-8px;left:14px;width:18px;height:10px;float:left;overflow:hidden}.dropdown-menu .dropdown-caret .caret-inner,.dropdown-menu .dropdown-caret .caret-outer{display:inline-block;top:0;border-left:9px solid transparent;border-right:9px solid transparent;position:absolute}.dropdown-menu .dropdown-caret .caret-outer{border-bottom:9px solid rgba(0,0,0,.1);height:auto;left:0;width:auto;margin-left:-1px}.dropdown-menu .dropdown-caret .caret-inner{margin-top:-1px;top:1px;border-bottom:9px solid #fafafa}.dropdown-menu .buttons{border-bottom:1px solid rgba(0,0,0,.07)}.dropdown-menu .buttons:after,.dropdown-menu .buttons:before{content:" ";display:table;line-height:0}.dropdown-menu .buttons:last-child{border-bottom:none}.dropdown-menu .buttons .button{border:0;background-color:transparent;color:#a6a6a6;width:100%;text-align:center;float:left;line-height:1.42857143;padding:8px 4px}.alert,.dropdown-menu .buttons .button:hover{color:#444}.dropdown-menu .buttons .button:focus,.dropdown-menu .buttons .button:hover{outline:0}.dropdown-menu .buttons .button.size-2{width:50%}.dropdown-menu .buttons .button.size-3{width:33%}.alert{padding:15px;margin-bottom:20px;background:#eee;border-bottom:5px solid #ddd}.alert-success{background:#dff0d8;border-color:#d6e9c6;color:#3c763d}.alert-info{background:#d9edf7;border-color:#bce8f1;color:#31708f}.alert-danger{background:#f2dede;border-color:#ebccd1;color:#a94442}.alert-warning{background:#fcf8e3;border-color:#faebcc;color:#8a6d3b}.book .book-summary{position:absolute;top:0;left:-300px;bottom:0;z-index:1;width:300px;color:#364149;background:#fafafa;border-right:1px solid rgba(0,0,0,.07);-webkit-transition:left 250ms ease;-moz-transition:left 250ms ease;-o-transition:left 250ms ease;transition:left 250ms ease}.book .book-summary ul.summary{position:absolute;top:0;left:0;right:0;bottom:0;overflow-y:auto;list-style:none;margin:0;padding:0;-webkit-transition:top .5s ease;-moz-transition:top .5s ease;-o-transition:top .5s ease;transition:top .5s ease}.book .book-summary ul.summary li{list-style:none}.book .book-summary ul.summary li.divider{height:1px;margin:7px 0;overflow:hidden;background:rgba(0,0,0,.07)}.book .book-summary ul.summary li i.fa-check{display:none;position:absolute;right:9px;top:16px;font-size:9px;color:#3c3}.book .book-summary ul.summary li.done>a{color:#364149;font-weight:400}.book .book-summary ul.summary li.done>a i{display:inline}.book .book-summary ul.summary li a,.book .book-summary ul.summary li span{display:block;padding:10px 15px;border-bottom:none;color:#364149;background:0 0;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;position:relative}.book .book-summary ul.summary li span{cursor:not-allowed;opacity:.3;filter:alpha(opacity=30)}.book .book-summary ul.summary li a:hover,.book .book-summary ul.summary li.active>a{color:#008cff;background:0 0;text-decoration:none}.book .book-summary ul.summary li ul{padding-left:20px}@media (max-width:600px){.book .book-summary{width:calc(100% - 60px);bottom:0;left:-100%}}.book.with-summary .book-summary{left:0}.book.without-animation .book-summary{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;transition:none!important}.book{position:relative;width:100%;height:100%}.book .book-body,.book .book-body .body-inner{position:absolute;top:0;left:0;overflow-y:auto;bottom:0;right:0}.book .book-body{color:#000;background:#fff;-webkit-transition:left 250ms ease;-moz-transition:left 250ms ease;-o-transition:left 250ms ease;transition:left 250ms ease}.book .book-body .page-wrapper{position:relative;outline:0}.book .book-body .page-wrapper .page-inner{max-width:800px;margin:0 auto;padding:20px 0 40px}.book .book-body .page-wrapper .page-inner section{margin:0;padding:5px 15px;background:#fff;border-radius:2px;line-height:1.7;font-size:1.6rem}.book .book-body .page-wrapper .page-inner .btn-group .btn{border-radius:0;background:#eee;border:0}@media (max-width:1240px){.book .book-body{-webkit-transition:-webkit-transform 250ms ease;-moz-transition:-moz-transform 250ms ease;-o-transition:-o-transform 250ms ease;transition:transform 250ms ease;padding-bottom:20px}.book .book-body .body-inner{position:static;min-height:calc(100% - 50px)}}@media (min-width:600px){.book.with-summary .book-body{left:300px}}@media (max-width:600px){.book.with-summary{overflow:hidden}.book.with-summary .book-body{-webkit-transform:translate(calc(100% - 60px),0);-moz-transform:translate(calc(100% - 60px),0);-ms-transform:translate(calc(100% - 60px),0);-o-transform:translate(calc(100% - 60px),0);transform:translate(calc(100% - 60px),0)}}.book.without-animation .book-body{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;transition:none!important}.buttons:after,.buttons:before{content:" ";display:table;line-height:0}.button{border:0;background:#eee;color:#666;width:100%;text-align:center;float:left;line-height:1.42857143;padding:8px 4px}.button:hover{color:#444}.button:focus,.button:hover{outline:0}.button.size-2{width:50%}.button.size-3{width:33%}.book .book-body .page-wrapper .page-inner section{display:none}.book .book-body .page-wrapper .page-inner section.normal{display:block;word-wrap:break-word;overflow:hidden;color:#333;line-height:1.7;text-size-adjust:100%;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;-moz-text-size-adjust:100%}.book .book-body .page-wrapper .page-inner section.normal *{box-sizing:border-box;-webkit-box-sizing:border-box;}.book .book-body .page-wrapper .page-inner section.normal>:first-child{margin-top:0!important}.book .book-body .page-wrapper .page-inner section.normal>:last-child{margin-bottom:0!important}.book .book-body .page-wrapper .page-inner section.normal blockquote,.book .book-body .page-wrapper .page-inner section.normal code,.book .book-body .page-wrapper .page-inner section.normal figure,.book .book-body .page-wrapper .page-inner section.normal img,.book .book-body .page-wrapper .page-inner section.normal pre,.book .book-body .page-wrapper .page-inner section.normal table,.book .book-body .page-wrapper .page-inner section.normal tr{page-break-inside:avoid}.book .book-body .page-wrapper .page-inner section.normal h2,.book .book-body .page-wrapper .page-inner section.normal h3,.book .book-body .page-wrapper .page-inner section.normal h4,.book .book-body .page-wrapper .page-inner section.normal h5,.book .book-body .page-wrapper .page-inner section.normal p{orphans:3;widows:3}.book .book-body .page-wrapper .page-inner section.normal h1,.book .book-body .page-wrapper .page-inner section.normal h2,.book .book-body .page-wrapper .page-inner section.normal h3,.book .book-body .page-wrapper .page-inner section.normal h4,.book .book-body .page-wrapper .page-inner section.normal h5{page-break-after:avoid}.book .book-body .page-wrapper .page-inner section.normal b,.book .book-body .page-wrapper .page-inner section.normal strong{font-weight:700}.book .book-body .page-wrapper .page-inner section.normal em{font-style:italic}.book .book-body .page-wrapper .page-inner section.normal blockquote,.book .book-body .page-wrapper .page-inner section.normal dl,.book .book-body .page-wrapper .page-inner section.normal ol,.book .book-body .page-wrapper .page-inner section.normal p,.book .book-body .page-wrapper .page-inner section.normal table,.book .book-body .page-wrapper .page-inner section.normal ul{margin-top:0;margin-bottom:.85em}.book .book-body .page-wrapper .page-inner section.normal a{color:#4183c4;text-decoration:none;background:0 0}.book .book-body .page-wrapper .page-inner section.normal a:active,.book .book-body .page-wrapper .page-inner section.normal a:focus,.book .book-body .page-wrapper .page-inner section.normal a:hover{outline:0;text-decoration:underline}.book .book-body .page-wrapper .page-inner section.normal img{border:0;max-width:100%}.book .book-body .page-wrapper .page-inner section.normal hr{height:4px;padding:0;margin:1.7em 0;overflow:hidden;background-color:#e7e7e7;border:none}.book .book-body .page-wrapper .page-inner section.normal hr:after,.book .book-body .page-wrapper .page-inner section.normal hr:before{display:table;content:" "}.book .book-body .page-wrapper .page-inner section.normal h1,.book .book-body .page-wrapper .page-inner section.normal h2,.book .book-body .page-wrapper .page-inner section.normal h3,.book .book-body .page-wrapper .page-inner section.normal h4,.book .book-body .page-wrapper .page-inner section.normal h5,.book .book-body .page-wrapper .page-inner section.normal h6{margin-top:1.275em;margin-bottom:.85em;}.book .book-body .page-wrapper .page-inner section.normal h1{font-size:2em}.book .book-body .page-wrapper .page-inner section.normal h2{font-size:1.75em}.book .book-body .page-wrapper .page-inner section.normal h3{font-size:1.5em}.book .book-body .page-wrapper .page-inner section.normal h4{font-size:1.25em}.book .book-body .page-wrapper .page-inner section.normal h5{font-size:1em}.book .book-body .page-wrapper .page-inner section.normal h6{font-size:1em;color:#777}.book .book-body .page-wrapper .page-inner section.normal code,.book .book-body .page-wrapper .page-inner section.normal pre{font-family:Consolas,"Liberation Mono",Menlo,Courier,monospace;direction:ltr;border:none;color:inherit}.book .book-body .page-wrapper .page-inner section.normal pre{overflow:auto;word-wrap:normal;margin:0 0 1.275em;padding:.85em 1em;background:#f7f7f7}.book .book-body .page-wrapper .page-inner section.normal pre>code{display:inline;max-width:initial;padding:0;margin:0;overflow:initial;line-height:inherit;font-size:.85em;white-space:pre;background:0 0}.book .book-body .page-wrapper .page-inner section.normal pre>code:after,.book .book-body .page-wrapper .page-inner section.normal pre>code:before{content:normal}.book .book-body .page-wrapper .page-inner section.normal code{padding:.2em;margin:0;font-size:.85em;background-color:#f7f7f7}.book .book-body .page-wrapper .page-inner section.normal code:after,.book .book-body .page-wrapper .page-inner section.normal code:before{letter-spacing:-.2em;content:"\00a0"}.book .book-body .page-wrapper .page-inner section.normal ol,.book .book-body .page-wrapper .page-inner section.normal ul{padding:0 0 0 2em;margin:0 0 .85em}.book .book-body .page-wrapper .page-inner section.normal ol ol,.book .book-body .page-wrapper .page-inner section.normal ol ul,.book .book-body .page-wrapper .page-inner section.normal ul ol,.book .book-body .page-wrapper .page-inner section.normal ul ul{margin-top:0;margin-bottom:0}.book .book-body .page-wrapper .page-inner section.normal ol ol{list-style-type:lower-roman}.book .book-body .page-wrapper .page-inner section.normal blockquote{margin:0 0 .85em;padding:0 15px;opacity:0.75;border-left:4px solid #dcdcdc}.book .book-body .page-wrapper .page-inner section.normal blockquote:first-child{margin-top:0}.book .book-body .page-wrapper .page-inner section.normal blockquote:last-child{margin-bottom:0}.book .book-body .page-wrapper .page-inner section.normal dl{padding:0}.book .book-body .page-wrapper .page-inner section.normal dl dt{padding:0;margin-top:.85em;font-style:italic;font-weight:700}.book .book-body .page-wrapper .page-inner section.normal dl dd{padding:0 .85em;margin-bottom:.85em}.book .book-body .page-wrapper .page-inner section.normal dd{margin-left:0}.book .book-body .page-wrapper .page-inner section.normal .glossary-term{cursor:help;text-decoration:underline}.book .book-body .navigation{position:absolute;top:50px;bottom:0;margin:0;max-width:150px;min-width:90px;display:flex;justify-content:center;align-content:center;flex-direction:column;font-size:40px;color:#ccc;text-align:center;-webkit-transition:all 350ms ease;-moz-transition:all 350ms ease;-o-transition:all 350ms ease;transition:all 350ms ease}.book .book-body .navigation:hover{text-decoration:none;color:#444}.book .book-body .navigation.navigation-next{right:0}.book .book-body .navigation.navigation-prev{left:0}@media (max-width:1240px){.book .book-body .navigation{position:static;top:auto;max-width:50%;width:50%;display:inline-block;float:left}.book .book-body .navigation.navigation-unique{max-width:100%;width:100%}}.book .book-body .page-wrapper .page-inner section.glossary{margin-bottom:40px}.book .book-body .page-wrapper .page-inner section.glossary h2 a,.book .book-body .page-wrapper .page-inner section.glossary h2 a:hover{color:inherit;text-decoration:none}.book .book-body .page-wrapper .page-inner section.glossary .glossary-index{list-style:none;margin:0;padding:0}.book .book-body .page-wrapper .page-inner section.glossary .glossary-index li{display:inline;margin:0 8px;white-space:nowrap}*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-overflow-scrolling:touch;-webkit-tap-highlight-color:transparent;-webkit-text-size-adjust:none;-webkit-touch-callout:none}a{text-decoration:none}body,html{height:100%}html{font-size:62.5%}body{text-rendering:optimizeLegibility;font-smoothing:antialiased;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;letter-spacing:.2px;text-size-adjust:100%} .book .book-summary ul.summary li a span {display:inline;padding:initial;overflow:visible;cursor:auto;opacity:1;} diff --git a/docs/libs/gitbook-2.6.7/js/plugin-bookdown.js b/docs/libs/gitbook-2.6.7/js/plugin-bookdown.js index bd90080..4337cd1 100644 --- a/docs/libs/gitbook-2.6.7/js/plugin-bookdown.js +++ b/docs/libs/gitbook-2.6.7/js/plugin-bookdown.js @@ -16,6 +16,18 @@ gitbook.require(["gitbook", "lodash", "jQuery"], function(gitbook, _, $) { } }); + // add the History button (file history on Github) + var history = config.history; + if (history && history.link) gitbook.toolbar.createButton({ + icon: 'fa fa-history', + label: history.text || 'History', + position: 'left', + onClick: function(e) { + e.preventDefault(); + window.open(history.link); + } + }); + var down = config.download; var normalizeDownload = function() { if (!down || !(down instanceof Array) || down.length === 0) return; diff --git a/docs/libs/gitbook-2.6.7/js/plugin-search.js b/docs/libs/gitbook-2.6.7/js/plugin-search.js index f8bd5af..a8dad28 100644 --- a/docs/libs/gitbook-2.6.7/js/plugin-search.js +++ b/docs/libs/gitbook-2.6.7/js/plugin-search.js @@ -1,6 +1,6 @@ gitbook.require(["gitbook", "lodash", "jQuery"], function(gitbook, _, $) { var index = null; - var $searchInput, $searchForm; + var $searchInput, $searchLabel, $searchForm; var $highlighted, hi = 0, hiOpts = { className: 'search-highlight' }; var collapse = false; @@ -92,6 +92,7 @@ gitbook.require(["gitbook", "lodash", "jQuery"], function(gitbook, _, $) { // Create search form function createForm(value) { if ($searchForm) $searchForm.remove(); + if ($searchLabel) $searchLabel.remove(); if ($searchInput) $searchInput.remove(); $searchForm = $('
    ', { @@ -99,13 +100,22 @@ gitbook.require(["gitbook", "lodash", "jQuery"], function(gitbook, _, $) { 'role': 'search' }); + $searchLabel = $('
    + + +
    - - + + @@ -357,7 +381,7 @@

    1.1.3 The switching equation

    "google": false, "linkedin": false, "weibo": false, -"instapper": false, +"instapaper": false, "vk": false, "all": ["facebook", "google", "twitter", "linkedin", "weibo", "instapaper"] }, @@ -370,6 +394,10 @@

    1.1.3 The switching equation

    "link": "https://github.com/chabefer/STCI/01_FPI.Rmd", "text": "Edit" }, +"history": { +"link": null, +"text": null +}, "download": ["STCI.pdf", "STCI.epub"], "toc": { "collapse": "subsection" @@ -384,7 +412,7 @@

    1.1.3 The switching equation

    var script = document.createElement("script"); script.type = "text/javascript"; var src = ""; - if (src === "" || src === "true") src = "https://cdn.bootcss.com/mathjax/2.7.1/MathJax.js?config=TeX-MML-AM_CHTML"; + if (src === "" || src === "true") src = "https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-MML-AM_CHTML"; if (location.protocol !== "file:" && /^https?:/.test(src)) src = src.replace(/^https?:/, ''); script.src = src; diff --git a/docs/the-purpose-of-observational-methods.html b/docs/the-purpose-of-observational-methods.html new file mode 100644 index 0000000..de5226e --- /dev/null +++ b/docs/the-purpose-of-observational-methods.html @@ -0,0 +1,537 @@ + + + + + + + + Chapter 3 The Purpose of Observational Methods | Statistical Tools for Causal Inference + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +$$ +\newcommand{\uns}[1]{\mathbf{1}[#1]} +$$ + + + + + + + + + + + +
    + +
    + +
    + +
    +
    + + +
    +
    + +
    +
    +

    Chapter 3 The Purpose of Observational Methods

    +

    In the previous chapter on Randomized Controlled Trials, we showed that, by randomizing treatment, we could identify causal effects because the random variation sidestepped the impact of omitted variables or sample selection that could drive a non-causal correlation between treatement and outcome. In Natural Experiments, we mimicked that strategy by finding sources of near-random variation in treatment, and isolating the part of treatment that was driven by the near-random variation.

    +

    Using Randomized Controlled Trials or Natural Experiments, if they are properly applied, it is possible to ignore any confounding variables, whether or not we can measure them in our data or even imagine what they are.

    +

    However, it is not always possible to run an experiment or find a natural experiment. In this chapter, we will consider ways of identifying causal effects using Observational methods, relying only on the data we have actually collected and observed. Natural Experiments often make use of additional Observational methods, correcting for confounding variables that the design of the natural experiment cannot account for.

    +

    This chapter contains four sections: the first two cover multiple regression and matching, respectively, which are two common ways of adjusting for observed variables. The third covers the sufficient adjustment set, which allows you to determine which variables should and should not be adjusted for to identify a causal effect. The fourth covers fixed effects, which is a method that allows you to adjust for some unmeasured confounding variables.

    +
    +

    3.1 Multiple Regression

    +

    +
    +
    +

    3.2 Matching

    +

    +
    +
    +

    3.3 Sufficient Adjustment Set

    +
    +
    +

    3.4 Fixed Effects

    +
    +

    3.4.1 Between and Within Variation

    +

    Fixed effects is a method that can be applied when you have panel data: multiple observations of the same individual over time.

    +

    When you have multiple observations per individual, variation in the outcome variable \(Y\) comes from two places: between variation and within variation. Between variation is the difference between individuals in their average level of \(Y\). Within variation is the difference within a given individual comparing one time period to another.

    +

    For example, consider the below data.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Table 3.1: Y over Two Time Periods for Two People
    PersonTimeYD
    Anna140
    Anna281
    Bill131
    Bill210
    +

    Anna’s average \(Y\) is (4+8)/2 = 6, and Bill’s average is (3+1)/2 = 2. The difference between the 6 and the 2 is the difference between Anna and Bill. And Anna’s change from 4 to 8, and Bill’s change from 3 to 1 are the differences within Anna and Bill.

    +

    Fixed effects eliminates all between variation and uses only within variation. In effect, you are controlling for individual identity. For this reason it is also known as the “within estimator”.

    +

    The reason fixed effects does this is that it in effect controls for all differences between people that are constant across time, whether or not we control for them.

    +
    +
    +

    3.4.2 Demonstration of Fixed Effects

    +

    Fixed effects works by simply removing all the between variation in each variable before performing an analysis of choice.

    +

    Using the above example with Anna and Bill, we can subtract all between variation in \(Y\) and \(D\) by calculating the average of \(Y\) and \(D\) for Anna and Bill, separately, and subtracting it out. Notice that \(\bar{Y}_{Anna}=6, \bar{Y}_{Bill}=2, \bar{D}_{Anna}=.5, \bar{D}_{Bill}=.5\).

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Table 3.2: Within Variation in Y and D
    PersonTimeYDWithin.YWithin.D
    Anna140-2-0.5
    Anna28120.5
    Bill13110.5
    Bill210-1-0.5
    +

    With this modified data, the relationship between Within.Y and Within.D will tell us about the effect of D on Y, as long as all confounding variables were a part of the between variation.

    +

    This process is demonstrated in animation below.

    +

    +
    +
    +

    3.4.3 Fixed Effects with Regression

    +

    Fixed effects estimation is usually performed using regression. In the below model, each individual \(i\) has their own intercept \(\alpha_{i}\).

    +\[\begin{align} + Y_{it} = \alpha_i + \beta D_{it} + \varepsilon_{it} \tag{3.1} +\end{align}\] +

    where \(\varepsilon_{it}\) is an error term. This can also be seen as a regression of \(Y_{it}\) on \(D_{it}\) and a series of binary variables, one for each individual.

    +\[\begin{align} + Y_{it} = \alpha + \sum_{i=0^N}\alpha_iI(i) + \beta D_{it} + \varepsilon_{it} \tag{3.2} +\end{align}\] +

    where \(I(i)\) is a function equal to 1 for individual \(i\) and 0 otherwise.

    +

    Either Equation (3.1) or Equation (3.2) will provide identical estimates of \(\beta\) as though you had run the regression

    +\[\begin{align} + Within.Y_{it} = \alpha + \beta Within.D_{it} + \varepsilon_{it} \tag{3.3} +\end{align}\] +

    Any variable that is constant within individual will be controlled for using fixed effects, whether or not it is measured. For example, imagine that \(i\) is an index of people, \(D_{it}\) is being exposed to a pollution-reduction policy, and \(Y_{it}\) is a measure of health. The variable \(G_i\) measures a genetic endowment at birth, which may affect health and also whether you live in the area with the policy. Notice that \(G_i\) does not have a \(t\) subscript, indicating that it is constant over time for each person. Even without measuring \(G_i\), it will be controlled for, since \(G_i\) is just \(I(i)\) multiplied by some constant, and we’re already controlling for \(I(i)\).

    +

    Equation (3.2) also makes clear that we are not controlling for anything that varies within person over time. For example, \(Inc_{it}\) is income, which may affect health, and also whether you can afford to live in the area with the policy. Fixed effects alone does not control for \(Inc_{it}\), and so we may need to add it as a control.

    +

    Similarly, fixed effects assumes that identity has a linear and constant effect. For example, if genetic endowment \(G_i\) has a stronger effect in some years than others, fixed effects will not account for this. Or, if genetic endowment modifies how effective the policy is, fixed effects will not account for this unless \(G_i\) can be measured and the nonlinearity can be directly modeled.

    +

    However, if all confounding variables are between-individual, linearity holds, and several other assumptions hold (see Treatment Effect Heterogeneity below), then fixed effects will identify the Average Treatment Effect.

    +

    Notice that the modeling in this section is very similar to Random Effects, not addressed in this chapter, which are similar to fixed effects but combine both between and within variation.

    +
    +
    +

    3.4.4 Common Extensions

    +
    +

    3.4.4.1 Clustered Standard Errors

    +

    The standard approach to calculating standard errors for Equations (3.1), (3.2), or (3.3) makes the assumption that the error term \(\varepsilon_{it}\) is independent and identically distributed. However, it may be reasonable to assume that \(\varepsilon_{it}\) is correlated within individual.

    +

    Under this condition, standard errors will be underestimated. For this reason, it is common to estimate fixed effects regressions using clustered standard errors. See Cameron & Miller 2013 (or the published version Cameron & Mill 2015) for a practitioner’s guide to whether clustering is necessary in a given fixed effects context, and how it can be performed.

    +
    +
    +

    3.4.4.2 Two-Way Fixed Effects

    +

    In many fixed effects contexts, some of the within variation in \(Y_{it}\) may not just be specific to person \(i\), but may be shared across all individuals. For example, if the sample includes many individuals in the same economy, the overall health of the economy changes over time and would affect everyone. If the treatment variable \(D_{it}\) is correlated with time as well, then these shared time effects will bias our estimate of the causal effect.

    +

    In cases like this it is common to include two sets of fixed effects - one for individual, \(\alpha_i\), and one for time, \(\alpha_t\). The regression equation is then

    +\[\begin{align} + Y_{it} = \alpha_{i} + \alpha_{t} + \beta D_{it} + \varepsilon_{it} \tag{3.4} +\end{align}\] +
    +
    +

    3.4.4.3 Treatment Effect Heterogeneity

    +

    Under the assumptions discussed above, the estimate produced by a fixed effects regression will be a weighted average of the treatment effect for each individual. To see this, consider a data set that has only two time periods in it, and each individual is treated in exactly one of these periods, like our example above:

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Table 3.3: Within Variation in Y and D
    PersonTimeYDWithin.YWithin.D
    Anna140-2-0.5
    Anna28120.5
    Bill13110.5
    Bill210-1-0.5
    +

    Anna sees an increase of 4 when the treatment is applied, and Bill sees an increase of 2. The fixed effects estimate will be (2+1)/2 - (-2 + -1)/2 = 1.5 - -1.5 = 3, which is also (4+2)/3 = 3, the average treatment effect in the sample.

    +

    In this case, Anna and Bill received equal weight. That is because Anna and Bill had the exact same amount of variation in \(D\). Fixed effects will more heavily weight individuals with more variation in \(D\). For example, imagine that Bill always has \(D = 0\) and thus no variation in \(D\):

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Table 3.4: Within Variation in Y and D, where Bill Always Has D = 0
    PersonTimeYDWithin.YWithin.D
    Anna140-2-0.5
    Anna28120.5
    Bill11000.0
    Bill21000.0
    +

    The fixed effects estimate is now 2 - -2 = 4, which is Anna’s treatment effect. Bill has no variation in \(D\) and thus receives no weight. We have failed to estimate the Average Treatment Effect.

    +

    One way to adjust for this is to use weighted least squares, where each observation is weighted by the inverse standard deviation of treatment within individual \((\sigma^D_i)^{-1}\), where

    +\[\begin{align} + \sigma^D_i = (\sum_t(D_{it} - \bar{D}_i)^2)^{1/2} \tag{3.5} +\end{align}\] +

    While this will not account for observations with no variation in \(D_{it}\), this will otherwise recover the average treatment effect (Gibbons, Serrato, & Urbancic, 2018).

    +
    +
    +
    +

    3.4.5 Coding Up Fixed Effects

    +

    Each of the following coding examples uses D as a treatment variable of interest, Y as the outcome variable, id as a variable encoding the individual, and t as a variable with the time period. In the R examples, all variables are stored in the data frame df.

    +

    Fixed effects is easy to implement using regression by simply including a set of dummy variables, one for each individual. This method can be implemented as:

    +
    #in R:
    +fe <- lm(Y~D+factor(id), data = df)
    +summary(fe)
    +
    +#in Stata:
    +regress Y D i.id
    +

    Many statistics packages also allow you to identify the panel structure of the data, and have a specific command for implementing fixed effects.

    +
    #in R:
    +library(plm)
    +df.p <- pdata.frame(df,index=c("id","t"))
    +fe <- plm(Y~D,data=df.p,model="within")
    +summary(fe)
    +#Add clustered standard errors
    +library(lmtest)
    +fe.cluster <- coeftest(fe,vcov=vcovHC(model,type = "HC1", cluster="group"))
    +summary(fe.cluster)
    +
    +#in Stata:
    +xtset id t
    +xtreg Y D, fe
    +#Add clustered standard errors
    +xtreg Y D, fe vce(cluster id)
    +

    Two-way fixed effects can be handled, as normal, by adding dummy variables for time period. There are also more formal ways of handling two-way fixed effects that work more quickly or handle standard errors in a more accurate way.

    +
    #in R:
    +#Just using dummies
    +fe <- lm(Y~D+factor(id)+factor(t), data = df)
    +#Using PLM
    +library(plm)
    +df.p <- pdata.frame(df,index=c("id","t"))
    +fe.twoways <- plm(Y~D,data=df.p,model="twoways")
    +summary(fe.twoways)
    +
    +#in Stata:
    +#Using dummies and xtreg
    +xtset id t
    +xtreg Y D i.t, fe
    +#Using reghdfe
    +ssc install reghdfe
    +#You may also have to install gtools
    +#and in some cases do "reghdfe, compile" before use
    +reghdfe Y D, absorb(id t)
    + +
    +
    +
    +
    + +
    +
    +
    + + +
    +
    + + + + + + + + + + + + + +