├── .gitignore
├── GettingStarted.Rmd
├── GettingStarted.md
├── Tutorial1-ExploringLMERobjects.Rmd
├── Tutorial1-ExploringLMERobjects.md
├── Tutorial2-ProperSpecification.Rmd
└── docs
├── GettingStarted.html
├── Tutorial1-ExploringLMERobjects.html
└── Tutorial1-ExploringLMERobjects_files
├── bootstrap-3.3.5
├── css
│ ├── bootstrap-theme.css
│ ├── bootstrap-theme.css.map
│ ├── bootstrap-theme.min.css
│ ├── bootstrap.css
│ ├── bootstrap.css.map
│ ├── bootstrap.min.css
│ ├── cerulean.min.css
│ ├── cosmo.min.css
│ ├── darkly.min.css
│ ├── flatly.min.css
│ ├── fonts
│ │ ├── Lato.ttf
│ │ ├── LatoBold.ttf
│ │ ├── LatoItalic.ttf
│ │ ├── NewsCycle.ttf
│ │ ├── NewsCycleBold.ttf
│ │ ├── OpenSans.ttf
│ │ ├── OpenSansBold.ttf
│ │ ├── OpenSansBoldItalic.ttf
│ │ ├── OpenSansItalic.ttf
│ │ ├── OpenSansLight.ttf
│ │ ├── OpenSansLightItalic.ttf
│ │ ├── Raleway.ttf
│ │ ├── RalewayBold.ttf
│ │ ├── Roboto.ttf
│ │ ├── RobotoBold.ttf
│ │ ├── RobotoLight.ttf
│ │ ├── RobotoMedium.ttf
│ │ ├── SourceSansPro.ttf
│ │ ├── SourceSansProBold.ttf
│ │ ├── SourceSansProItalic.ttf
│ │ ├── SourceSansProLight.ttf
│ │ └── Ubuntu.ttf
│ ├── journal.min.css
│ ├── lumen.min.css
│ ├── paper.min.css
│ ├── readable.min.css
│ ├── sandstone.min.css
│ ├── simplex.min.css
│ ├── spacelab.min.css
│ ├── united.min.css
│ └── yeti.min.css
├── fonts
│ ├── glyphicons-halflings-regular.eot
│ ├── glyphicons-halflings-regular.svg
│ ├── glyphicons-halflings-regular.ttf
│ ├── glyphicons-halflings-regular.woff
│ └── glyphicons-halflings-regular.woff2
├── js
│ ├── bootstrap.js
│ ├── bootstrap.min.js
│ └── npm.js
└── shim
│ ├── html5shiv.min.js
│ └── respond.min.js
├── figure-html
├── bycaseplot-1.svg
├── byschool-1.svg
├── ebplot-1.svg
├── ranef3-1.svg
├── xyplot1-1.svg
├── xyplot2-1.svg
└── xyplot3-1.svg
├── highlightjs-9.12.0
├── default.css
├── highlight.js
└── textmate.css
├── jquery-1.11.3
└── jquery.min.js
└── navigation-1.1
├── codefolding.js
├── sourceembed.js
└── tabsets.js
/.gitignore:
--------------------------------------------------------------------------------
1 | .Rproj.user
2 | .Rhistory
3 | .RData
4 | *.Rproj
--------------------------------------------------------------------------------
/GettingStarted.Rmd:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Getting Started with Multilevel Modeling in R"
3 | author: "Jared E. Knowles"
4 | date: "November, 25, 2013"
5 | output:
6 | html_document:
7 | keep_md: yes
8 | ---
9 |
10 | ## Jared E. Knowles
11 |
12 | # Introduction
13 |
14 | Analysts dealing with grouped data and complex hierarchical structures in their data ranging from
15 | measurements nested within participants, to counties nested within states or students nested within
16 | classrooms often find themselves in need of modeling tools to reflect this structure of their data.
17 | In R there are two predominant ways to fit multilevel models that account for such structure in the
18 | data. These tutorials will show the user how to use both the `lme4` package in R to fit linear and
19 | nonlinear mixed effect models, and to use `rstan` to fit fully Bayesian multilevel models. The focus
20 | here will be on how to fit the models in R and not the theory behind the models. For background on
21 | multilevel modeling, see the references. [1]
22 |
23 | This tutorial will cover getting set up and running a few basic models using `lme4` in R. Future
24 | tutorials will cover:
25 |
26 | * constructing varying intercept, varying slope, and varying slope and intercept models in R
27 | * generating predictions and interpreting parameters from mixed-effect models
28 | * generalized and non-linear multilevel models
29 | * fully Bayesian multilevel models fit with `rstan` or other MCMC methods
30 |
31 | # Setting up your enviRonment
32 |
33 | Getting started with multilevel modeling in R is simple. `lme4` is the canonical package for
34 | implementing multilevel models in R, though there are a number of packages that depend on and
35 | enhance its feature set, including Bayesian extensions. `lme4` has been recently rewritten to
36 | improve speed and to incorporate a C++ codebase, and as such the features of the package are
37 | somewhat in flux. Be sure to update the package frequently.
38 |
39 | To install `lme4`, we just run:
40 |
41 | ```{r eval=FALSE, results='hide', echo=TRUE}
42 | # Main version
43 | install.packages("lme4")
44 |
45 | # Or to install the dev version
46 | library(devtools)
47 | install_github("lme4",user="lme4")
48 | ```
49 |
50 | ```{r setup, echo=FALSE, error=FALSE, message=FALSE, eval=TRUE, results='hide'}
51 | library(knitr)
52 | knitr::opts_chunk$set(dev='png', fig.width=8, fig.height=6, echo=TRUE,
53 | message=FALSE, error=FALSE, warning=FALSE)
54 | options(width = 100)
55 | ```
56 |
57 | # Read in the data
58 |
59 | Multilevel models are appropriate for a particular kind of data structure where units are nested
60 | within groups (generally 5+ groups) and where we want to model the group structure of the data. For
61 | our introductory example we will start with a simple example from the `lme4` documentation and
62 | explain what the model is doing. We will use data from Jon Starkweather at the [University of North
63 | Texas](http://bayes.acs.unt.edu:8083/BayesContent/class/Jon/). Visit the excellent tutorial
64 | [available here for
65 | more.](http://bayes.acs.unt.edu:8083/BayesContent/class/Jon/Benchmarks/LinearMixedModels_JDS_Dec2010.pdf)
66 |
67 | ```{r loadandviewdata}
68 | library(lme4) # load library
69 | library(arm) # convenience functions for regression in R
70 | lmm.data <- read.table("http://bayes.acs.unt.edu:8083/BayesContent/class/Jon/R_SC/Module9/lmm.data.txt",
71 | header=TRUE, sep=",", na.strings="NA", dec=".", strip.white=TRUE)
72 | #summary(lmm.data)
73 | head(lmm.data)
74 | ```
75 |
76 | Here we have data on the extroversion of subjects nested within classes and within schools.
77 |
78 | # Fit the Non-Multilevel Models
79 |
80 | Let's start by fitting a simple OLS regression of measures of openness, agreeableness, and
81 | socialability on extroversion. Here we use the `display` function in the excellent `arm` package for
82 | abbreviated output. Other options include `stargazer` for LaTeX typeset tables, `xtable`, or the
83 | `ascii` package for more flexible plain text output options.
84 |
85 | ```{r nonlmermodels}
86 | OLSexamp <- lm(extro ~ open + agree + social, data = lmm.data)
87 | display(OLSexamp)
88 | ```
89 |
90 | So far this model does not fit very well at all. The R model interface is quite a simple one with
91 | the dependent variable being specified first, followed by the `~` symbol. The righ hand side,
92 | predictor variables, are each named. Addition signs indicate that these are modeled as additive
93 | effects. Finally, we specify that datframe on which to calculate the model. Here we use the `lm`
94 | function to perform OLS regression, but there are many other options in R.
95 |
96 | If we want to extract measures such as the AIC, we may prefer to fit a generalized linear model with
97 | `glm` which produces a model fit through maximum likelihood estimation. Note that the model formula
98 | specification is the same.
99 |
100 | ```{r nonlmerglm}
101 | MLexamp <- glm(extro ~ open + agree + social, data=lmm.data)
102 | display(MLexamp)
103 | AIC(MLexamp)
104 | ```
105 |
106 | This results in a poor model fit. Let's look at a simple varying intercept model now.
107 |
108 | # Fit a varying intercept model
109 |
110 | Depending on disciplinary norms, our next step might be to fit a varying intercept model using a
111 | grouping variable such as school or classes. Using the `glm` function and the familiar formula
112 | interface, such a fit is easy:
113 |
114 | ```{r nonlmerfixedeffect}
115 | MLexamp.2 <- glm(extro ~ open + agree + social + class, data=lmm.data )
116 | display(MLexamp.2)
117 | AIC(MLexamp.2)
118 | anova(MLexamp, MLexamp.2, test="F")
119 | ```
120 |
121 | This is called a fixed-effects specification often. This is simply the case of fitting a separate
122 | dummy variable as a predictor for each class. We can see this does not provide much additional model
123 | fit. Let's see if school performs any better.
124 |
125 | ```{r nonlmerfixedeffect2}
126 | MLexamp.3 <- glm(extro ~ open + agree + social + school, data=lmm.data )
127 | display(MLexamp.3)
128 | AIC(MLexamp.3)
129 | anova(MLexamp, MLexamp.3, test="F")
130 | ```
131 |
132 | The school effect greatly improves our model fit. However, how do we interpret these effects?
133 |
134 | ```{r effectbreakdown}
135 | table(lmm.data$school, lmm.data$class)
136 |
137 | ```
138 |
139 | Here we can see we have a perfectly balanced design with fifty observations in each combination of
140 | class and school (if only data were always so nice!).
141 |
142 | Let's try to model each of these unique cells. To do this, we fit a model and use the `:` operator
143 | to specify the interaction between `school` and `class`.
144 |
145 | ```{r interaction}
146 | MLexamp.4 <- glm(extro ~ open + agree + social + school:class, data=lmm.data )
147 | display(MLexamp.4)
148 | AIC(MLexamp.4)
149 | ```
150 |
151 | This is very useful, but what if we want to understand both the effect of the school and the effect
152 | of the class, as well as the effect of the schools and classes? Unfortunately, this is not easily
153 | done with the standard `glm`.
154 |
155 | ```{r interaction2}
156 | MLexamp.5 <- glm(extro ~ open + agree + social + school*class - 1, data=lmm.data )
157 | display(MLexamp.5)
158 | AIC(MLexamp.5)
159 | ```
160 |
161 | # Exploring Random Slopes
162 |
163 | Another alternative is to fit a separate model for each of the school and class combinations. If we
164 | believe the relationsihp between our variables may be highly dependent on the school and class
165 | combination, we can simply fit a series of models and explore the parameter variation among them:
166 |
167 | ```{r}
168 | require(plyr)
169 |
170 | modellist <- dlply(lmm.data, .(school, class), function(x)
171 | glm(extro~ open + agree + social, data=x))
172 | display(modellist[[1]])
173 | display(modellist[[2]])
174 |
175 | ```
176 |
177 | We will discuss this strategy in more depth in future tutorials including how to performan inference
178 | on the list of models produced in this command.
179 |
180 | # Fit a varying intercept model with lmer
181 |
182 | Enter `lme4`. While all of the above techniques are valid approaches to this problem, they are not
183 | necessarily the best approach when we are interested explicitly in variation among and by groups.
184 | This is where a mixed-effect modeling framework is useful. Now we use the `lmer` function with the
185 | familiar formula interface, but now group level variables are specified using a special syntax:
186 | `(1|school)` tells `lmer` to fit a linear model with a varying-intercept group effect using the
187 | variable `school`.
188 |
189 | ```{r lmer1}
190 | MLexamp.6 <- lmer(extro ~ open + agree + social + (1|school), data=lmm.data)
191 | display(MLexamp.6)
192 | ```
193 |
194 | We can fit multiple group effects with multiple group effect terms.
195 |
196 |
197 | ```{r lmer2}
198 | MLexamp.7 <- lmer(extro ~ open + agree + social + (1|school) + (1|class), data=lmm.data)
199 | display(MLexamp.7)
200 | ```
201 |
202 | And finally, we can fit nested group effect terms through the following syntax:
203 |
204 | ```{r lmer3}
205 | MLexamp.8 <- lmer(extro ~ open + agree + social + (1|school/class), data=lmm.data)
206 | display(MLexamp.8)
207 |
208 |
209 | ```
210 |
211 | Here the `(1|school/class)` says that we want to fit a mixed effect term for varying intercepts `1|`
212 | by schools, and for classes that are nested within schools.
213 |
214 | # Fit a varying slope model with lmer
215 |
216 | But, what if we want to explore the effect of different student level indicators as they vary across
217 | classrooms. Instead of fitting unique models by school (or school/class) we can fit a varying slope
218 | model. Here we modify our random effect term to include variables before the grouping terms:
219 | `(1 +open|school/class)` tells R to fit a varying slope and varying intercept model for schools and
220 | classes nested within schools, and to allow the slope of the `open` variable to vary by school.
221 |
222 | ```{r lmer4}
223 | MLexamp.9 <- lmer(extro ~ open + agree + social + (1+open|school/class), data=lmm.data)
224 | display(MLexamp.9)
225 | ```
226 |
227 | # Conclusion
228 |
229 | Fitting mixed effect models and exploring group level variation is very easy within the R language
230 | and ecosystem. In future tutorials we will explore comparing across models, doing inference with
231 | mixed-effect models, and creating graphical representations of mixed effect models to understand
232 | their effects.
233 |
234 | # Appendix
235 |
236 | ```{r sessioninfo}
237 | print(sessionInfo(),locale=FALSE)
238 |
239 | ```
240 |
241 | [1] Examples include [Gelman and Hill](http://stat.columbia.edu/~gelman/arm),
242 | [Gelman et al. 2013](http://stat.columbia.edu/~gelman/book/), etc.
243 |
--------------------------------------------------------------------------------
/GettingStarted.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Getting Started with Multilevel Modeling in R"
3 | author: "Jared E. Knowles"
4 | date: "November, 25, 2013"
5 | output:
6 | html_document:
7 | keep_md: yes
8 | ---
9 |
10 | ## Jared E. Knowles
11 |
12 | # Introduction
13 |
14 | Analysts dealing with grouped data and complex hierarchical structures in their data ranging from
15 | measurements nested within participants, to counties nested within states or students nested within
16 | classrooms often find themselves in need of modeling tools to reflect this structure of their data.
17 | In R there are two predominant ways to fit multilevel models that account for such structure in the
18 | data. These tutorials will show the user how to use both the `lme4` package in R to fit linear and
19 | nonlinear mixed effect models, and to use `rstan` to fit fully Bayesian multilevel models. The focus
20 | here will be on how to fit the models in R and not the theory behind the models. For background on
21 | multilevel modeling, see the references. [1]
22 |
23 | This tutorial will cover getting set up and running a few basic models using `lme4` in R. Future
24 | tutorials will cover:
25 |
26 | * constructing varying intercept, varying slope, and varying slope and intercept models in R
27 | * generating predictions and interpreting parameters from mixed-effect models
28 | * generalized and non-linear multilevel models
29 | * fully Bayesian multilevel models fit with `rstan` or other MCMC methods
30 |
31 | # Setting up your enviRonment
32 |
33 | Getting started with multilevel modeling in R is simple. `lme4` is the canonical package for
34 | implementing multilevel models in R, though there are a number of packages that depend on and
35 | enhance its feature set, including Bayesian extensions. `lme4` has been recently rewritten to
36 | improve speed and to incorporate a C++ codebase, and as such the features of the package are
37 | somewhat in flux. Be sure to update the package frequently.
38 |
39 | To install `lme4`, we just run:
40 |
41 |
42 | ```r
43 | # Main version
44 | install.packages("lme4")
45 |
46 | # Or to install the dev version
47 | library(devtools)
48 | install_github("lme4",user="lme4")
49 | ```
50 |
51 |
52 |
53 | # Read in the data
54 |
55 | Multilevel models are appropriate for a particular kind of data structure where units are nested
56 | within groups (generally 5+ groups) and where we want to model the group structure of the data. For
57 | our introductory example we will start with a simple example from the `lme4` documentation and
58 | explain what the model is doing. We will use data from Jon Starkweather at the [University of North
59 | Texas](http://bayes.acs.unt.edu:8083/BayesContent/class/Jon/). Visit the excellent tutorial
60 | [available here for
61 | more.](http://bayes.acs.unt.edu:8083/BayesContent/class/Jon/Benchmarks/LinearMixedModels_JDS_Dec2010.pdf)
62 |
63 |
64 | ```r
65 | library(lme4) # load library
66 | library(arm) # convenience functions for regression in R
67 | lmm.data <- read.table("http://bayes.acs.unt.edu:8083/BayesContent/class/Jon/R_SC/Module9/lmm.data.txt",
68 | header=TRUE, sep=",", na.strings="NA", dec=".", strip.white=TRUE)
69 | #summary(lmm.data)
70 | head(lmm.data)
71 | ```
72 |
73 | ```
74 | ## id extro open agree social class school
75 | ## 1 1 63.69356 43.43306 38.02668 75.05811 d IV
76 | ## 2 2 69.48244 46.86979 31.48957 98.12560 a VI
77 | ## 3 3 79.74006 32.27013 40.20866 116.33897 d VI
78 | ## 4 4 62.96674 44.40790 30.50866 90.46888 c IV
79 | ## 5 5 64.24582 36.86337 37.43949 98.51873 d IV
80 | ## 6 6 50.97107 46.25627 38.83196 75.21992 d I
81 | ```
82 |
83 | Here we have data on the extroversion of subjects nested within classes and within schools.
84 |
85 | # Fit the Non-Multilevel Models
86 |
87 | Let's start by fitting a simple OLS regression of measures of openness, agreeableness, and
88 | socialability on extroversion. Here we use the `display` function in the excellent `arm` package for
89 | abbreviated output. Other options include `stargazer` for LaTeX typeset tables, `xtable`, or the
90 | `ascii` package for more flexible plain text output options.
91 |
92 |
93 | ```r
94 | OLSexamp <- lm(extro ~ open + agree + social, data = lmm.data)
95 | display(OLSexamp)
96 | ```
97 |
98 | ```
99 | ## lm(formula = extro ~ open + agree + social, data = lmm.data)
100 | ## coef.est coef.se
101 | ## (Intercept) 57.84 3.15
102 | ## open 0.02 0.05
103 | ## agree 0.03 0.05
104 | ## social 0.01 0.02
105 | ## ---
106 | ## n = 1200, k = 4
107 | ## residual sd = 9.34, R-Squared = 0.00
108 | ```
109 |
110 | So far this model does not fit very well at all. The R model interface is quite a simple one with
111 | the dependent variable being specified first, followed by the `~` symbol. The righ hand side,
112 | predictor variables, are each named. Addition signs indicate that these are modeled as additive
113 | effects. Finally, we specify that datframe on which to calculate the model. Here we use the `lm`
114 | function to perform OLS regression, but there are many other options in R.
115 |
116 | If we want to extract measures such as the AIC, we may prefer to fit a generalized linear model with
117 | `glm` which produces a model fit through maximum likelihood estimation. Note that the model formula
118 | specification is the same.
119 |
120 |
121 | ```r
122 | MLexamp <- glm(extro ~ open + agree + social, data=lmm.data)
123 | display(MLexamp)
124 | ```
125 |
126 | ```
127 | ## glm(formula = extro ~ open + agree + social, data = lmm.data)
128 | ## coef.est coef.se
129 | ## (Intercept) 57.84 3.15
130 | ## open 0.02 0.05
131 | ## agree 0.03 0.05
132 | ## social 0.01 0.02
133 | ## ---
134 | ## n = 1200, k = 4
135 | ## residual deviance = 104378.2, null deviance = 104432.7 (difference = 54.5)
136 | ## overdispersion parameter = 87.3
137 | ## residual sd is sqrt(overdispersion) = 9.34
138 | ```
139 |
140 | ```r
141 | AIC(MLexamp)
142 | ```
143 |
144 | ```
145 | ## [1] 8774.291
146 | ```
147 |
148 | This results in a poor model fit. Let's look at a simple varying intercept model now.
149 |
150 | # Fit a varying intercept model
151 |
152 | Depending on disciplinary norms, our next step might be to fit a varying intercept model using a
153 | grouping variable such as school or classes. Using the `glm` function and the familiar formula
154 | interface, such a fit is easy:
155 |
156 |
157 | ```r
158 | MLexamp.2 <- glm(extro ~ open + agree + social + class, data=lmm.data )
159 | display(MLexamp.2)
160 | ```
161 |
162 | ```
163 | ## glm(formula = extro ~ open + agree + social + class, data = lmm.data)
164 | ## coef.est coef.se
165 | ## (Intercept) 56.05 3.09
166 | ## open 0.03 0.05
167 | ## agree -0.01 0.05
168 | ## social 0.01 0.02
169 | ## classb 2.06 0.75
170 | ## classc 3.70 0.75
171 | ## classd 5.67 0.75
172 | ## ---
173 | ## n = 1200, k = 7
174 | ## residual deviance = 99187.7, null deviance = 104432.7 (difference = 5245.0)
175 | ## overdispersion parameter = 83.1
176 | ## residual sd is sqrt(overdispersion) = 9.12
177 | ```
178 |
179 | ```r
180 | AIC(MLexamp.2)
181 | ```
182 |
183 | ```
184 | ## [1] 8719.083
185 | ```
186 |
187 | ```r
188 | anova(MLexamp, MLexamp.2, test="F")
189 | ```
190 |
191 | ```
192 | ## Analysis of Deviance Table
193 | ##
194 | ## Model 1: extro ~ open + agree + social
195 | ## Model 2: extro ~ open + agree + social + class
196 | ## Resid. Df Resid. Dev Df Deviance F Pr(>F)
197 | ## 1 1196 104378
198 | ## 2 1193 99188 3 5190.5 20.81 3.82e-13 ***
199 | ## ---
200 | ## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
201 | ```
202 |
203 | This is called a fixed-effects specification often. This is simply the case of fitting a separate
204 | dummy variable as a predictor for each class. We can see this does not provide much additional model
205 | fit. Let's see if school performs any better.
206 |
207 |
208 | ```r
209 | MLexamp.3 <- glm(extro ~ open + agree + social + school, data=lmm.data )
210 | display(MLexamp.3)
211 | ```
212 |
213 | ```
214 | ## glm(formula = extro ~ open + agree + social + school, data = lmm.data)
215 | ## coef.est coef.se
216 | ## (Intercept) 45.02 0.92
217 | ## open 0.01 0.01
218 | ## agree 0.03 0.02
219 | ## social 0.00 0.00
220 | ## schoolII 7.91 0.27
221 | ## schoolIII 12.12 0.27
222 | ## schoolIV 16.06 0.27
223 | ## schoolV 20.43 0.27
224 | ## schoolVI 28.05 0.27
225 | ## ---
226 | ## n = 1200, k = 9
227 | ## residual deviance = 8496.2, null deviance = 104432.7 (difference = 95936.5)
228 | ## overdispersion parameter = 7.1
229 | ## residual sd is sqrt(overdispersion) = 2.67
230 | ```
231 |
232 | ```r
233 | AIC(MLexamp.3)
234 | ```
235 |
236 | ```
237 | ## [1] 5774.203
238 | ```
239 |
240 | ```r
241 | anova(MLexamp, MLexamp.3, test="F")
242 | ```
243 |
244 | ```
245 | ## Analysis of Deviance Table
246 | ##
247 | ## Model 1: extro ~ open + agree + social
248 | ## Model 2: extro ~ open + agree + social + school
249 | ## Resid. Df Resid. Dev Df Deviance F Pr(>F)
250 | ## 1 1196 104378
251 | ## 2 1191 8496 5 95882 2688.2 < 2.2e-16 ***
252 | ## ---
253 | ## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
254 | ```
255 |
256 | The school effect greatly improves our model fit. However, how do we interpret these effects?
257 |
258 |
259 | ```r
260 | table(lmm.data$school, lmm.data$class)
261 | ```
262 |
263 | ```
264 | ##
265 | ## a b c d
266 | ## I 50 50 50 50
267 | ## II 50 50 50 50
268 | ## III 50 50 50 50
269 | ## IV 50 50 50 50
270 | ## V 50 50 50 50
271 | ## VI 50 50 50 50
272 | ```
273 |
274 | Here we can see we have a perfectly balanced design with fifty observations in each combination of
275 | class and school (if only data were always so nice!).
276 |
277 | Let's try to model each of these unique cells. To do this, we fit a model and use the `:` operator
278 | to specify the interaction between `school` and `class`.
279 |
280 |
281 | ```r
282 | MLexamp.4 <- glm(extro ~ open + agree + social + school:class, data=lmm.data )
283 | display(MLexamp.4)
284 | ```
285 |
286 | ```
287 | ## glm(formula = extro ~ open + agree + social + school:class, data = lmm.data)
288 | ## coef.est coef.se
289 | ## (Intercept) 80.36 0.37
290 | ## open 0.01 0.00
291 | ## agree -0.01 0.01
292 | ## social 0.00 0.00
293 | ## schoolI:classa -40.39 0.20
294 | ## schoolII:classa -28.15 0.20
295 | ## schoolIII:classa -23.58 0.20
296 | ## schoolIV:classa -19.76 0.20
297 | ## schoolV:classa -15.50 0.20
298 | ## schoolVI:classa -10.46 0.20
299 | ## schoolI:classb -34.60 0.20
300 | ## schoolII:classb -26.76 0.20
301 | ## schoolIII:classb -22.59 0.20
302 | ## schoolIV:classb -18.71 0.20
303 | ## schoolV:classb -14.31 0.20
304 | ## schoolVI:classb -8.54 0.20
305 | ## schoolI:classc -31.86 0.20
306 | ## schoolII:classc -25.64 0.20
307 | ## schoolIII:classc -21.58 0.20
308 | ## schoolIV:classc -17.58 0.20
309 | ## schoolV:classc -13.38 0.20
310 | ## schoolVI:classc -5.58 0.20
311 | ## schoolI:classd -30.00 0.20
312 | ## schoolII:classd -24.57 0.20
313 | ## schoolIII:classd -20.64 0.20
314 | ## schoolIV:classd -16.60 0.20
315 | ## schoolV:classd -12.04 0.20
316 | ## ---
317 | ## n = 1200, k = 27
318 | ## residual deviance = 1135.9, null deviance = 104432.7 (difference = 103296.8)
319 | ## overdispersion parameter = 1.0
320 | ## residual sd is sqrt(overdispersion) = 0.98
321 | ```
322 |
323 | ```r
324 | AIC(MLexamp.4)
325 | ```
326 |
327 | ```
328 | ## [1] 3395.573
329 | ```
330 |
331 | This is very useful, but what if we want to understand both the effect of the school and the effect
332 | of the class, as well as the effect of the schools and classes? Unfortunately, this is not easily
333 | done with the standard `glm`.
334 |
335 |
336 | ```r
337 | MLexamp.5 <- glm(extro ~ open + agree + social + school*class - 1, data=lmm.data )
338 | display(MLexamp.5)
339 | ```
340 |
341 | ```
342 | ## glm(formula = extro ~ open + agree + social + school * class -
343 | ## 1, data = lmm.data)
344 | ## coef.est coef.se
345 | ## open 0.01 0.00
346 | ## agree -0.01 0.01
347 | ## social 0.00 0.00
348 | ## schoolI 39.96 0.36
349 | ## schoolII 52.21 0.36
350 | ## schoolIII 56.78 0.36
351 | ## schoolIV 60.60 0.36
352 | ## schoolV 64.86 0.36
353 | ## schoolVI 69.90 0.36
354 | ## classb 5.79 0.20
355 | ## classc 8.53 0.20
356 | ## classd 10.39 0.20
357 | ## schoolII:classb -4.40 0.28
358 | ## schoolIII:classb -4.80 0.28
359 | ## schoolIV:classb -4.74 0.28
360 | ## schoolV:classb -4.60 0.28
361 | ## schoolVI:classb -3.87 0.28
362 | ## schoolII:classc -6.02 0.28
363 | ## schoolIII:classc -6.54 0.28
364 | ## schoolIV:classc -6.36 0.28
365 | ## schoolV:classc -6.41 0.28
366 | ## schoolVI:classc -3.65 0.28
367 | ## schoolII:classd -6.81 0.28
368 | ## schoolIII:classd -7.45 0.28
369 | ## schoolIV:classd -7.24 0.28
370 | ## schoolV:classd -6.93 0.28
371 | ## schoolVI:classd 0.06 0.28
372 | ## ---
373 | ## n = 1200, k = 27
374 | ## residual deviance = 1135.9, null deviance = 4463029.9 (difference = 4461894.0)
375 | ## overdispersion parameter = 1.0
376 | ## residual sd is sqrt(overdispersion) = 0.98
377 | ```
378 |
379 | ```r
380 | AIC(MLexamp.5)
381 | ```
382 |
383 | ```
384 | ## [1] 3395.573
385 | ```
386 |
387 | # Exploring Random Slopes
388 |
389 | Another alternative is to fit a separate model for each of the school and class combinations. If we
390 | believe the relationsihp between our variables may be highly dependent on the school and class
391 | combination, we can simply fit a series of models and explore the parameter variation among them:
392 |
393 |
394 | ```r
395 | require(plyr)
396 |
397 | modellist <- dlply(lmm.data, .(school, class), function(x)
398 | glm(extro~ open + agree + social, data=x))
399 | display(modellist[[1]])
400 | ```
401 |
402 | ```
403 | ## glm(formula = extro ~ open + agree + social, data = x)
404 | ## coef.est coef.se
405 | ## (Intercept) 35.87 5.90
406 | ## open 0.05 0.09
407 | ## agree 0.02 0.10
408 | ## social 0.01 0.03
409 | ## ---
410 | ## n = 50, k = 4
411 | ## residual deviance = 500.2, null deviance = 506.2 (difference = 5.9)
412 | ## overdispersion parameter = 10.9
413 | ## residual sd is sqrt(overdispersion) = 3.30
414 | ```
415 |
416 | ```r
417 | display(modellist[[2]])
418 | ```
419 |
420 | ```
421 | ## glm(formula = extro ~ open + agree + social, data = x)
422 | ## coef.est coef.se
423 | ## (Intercept) 47.96 2.16
424 | ## open -0.01 0.03
425 | ## agree -0.03 0.03
426 | ## social -0.01 0.01
427 | ## ---
428 | ## n = 50, k = 4
429 | ## residual deviance = 47.9, null deviance = 49.1 (difference = 1.2)
430 | ## overdispersion parameter = 1.0
431 | ## residual sd is sqrt(overdispersion) = 1.02
432 | ```
433 |
434 | We will discuss this strategy in more depth in future tutorials including how to performan inference
435 | on the list of models produced in this command.
436 |
437 | # Fit a varying intercept model with lmer
438 |
439 | Enter `lme4`. While all of the above techniques are valid approaches to this problem, they are not
440 | necessarily the best approach when we are interested explicitly in variation among and by groups.
441 | This is where a mixed-effect modeling framework is useful. Now we use the `lmer` function with the
442 | familiar formula interface, but now group level variables are specified using a special syntax:
443 | `(1|school)` tells `lmer` to fit a linear model with a varying-intercept group effect using the
444 | variable `school`.
445 |
446 |
447 | ```r
448 | MLexamp.6 <- lmer(extro ~ open + agree + social + (1|school), data=lmm.data)
449 | display(MLexamp.6)
450 | ```
451 |
452 | ```
453 | ## lmer(formula = extro ~ open + agree + social + (1 | school),
454 | ## data = lmm.data)
455 | ## coef.est coef.se
456 | ## (Intercept) 59.12 4.10
457 | ## open 0.01 0.01
458 | ## agree 0.03 0.02
459 | ## social 0.00 0.00
460 | ##
461 | ## Error terms:
462 | ## Groups Name Std.Dev.
463 | ## school (Intercept) 9.79
464 | ## Residual 2.67
465 | ## ---
466 | ## number of obs: 1200, groups: school, 6
467 | ## AIC = 5836.1, DIC = 5788.9
468 | ## deviance = 5806.5
469 | ```
470 |
471 | We can fit multiple group effects with multiple group effect terms.
472 |
473 |
474 |
475 | ```r
476 | MLexamp.7 <- lmer(extro ~ open + agree + social + (1|school) + (1|class), data=lmm.data)
477 | display(MLexamp.7)
478 | ```
479 |
480 | ```
481 | ## lmer(formula = extro ~ open + agree + social + (1 | school) +
482 | ## (1 | class), data = lmm.data)
483 | ## coef.est coef.se
484 | ## (Intercept) 60.20 4.21
485 | ## open 0.01 0.01
486 | ## agree -0.01 0.01
487 | ## social 0.00 0.00
488 | ##
489 | ## Error terms:
490 | ## Groups Name Std.Dev.
491 | ## school (Intercept) 9.79
492 | ## class (Intercept) 2.41
493 | ## Residual 1.67
494 | ## ---
495 | ## number of obs: 1200, groups: school, 6; class, 4
496 | ## AIC = 4737.9, DIC = 4683.3
497 | ## deviance = 4703.6
498 | ```
499 |
500 | And finally, we can fit nested group effect terms through the following syntax:
501 |
502 |
503 | ```r
504 | MLexamp.8 <- lmer(extro ~ open + agree + social + (1|school/class), data=lmm.data)
505 | display(MLexamp.8)
506 | ```
507 |
508 | ```
509 | ## lmer(formula = extro ~ open + agree + social + (1 | school/class),
510 | ## data = lmm.data)
511 | ## coef.est coef.se
512 | ## (Intercept) 60.24 4.01
513 | ## open 0.01 0.00
514 | ## agree -0.01 0.01
515 | ## social 0.00 0.00
516 | ##
517 | ## Error terms:
518 | ## Groups Name Std.Dev.
519 | ## class:school (Intercept) 2.86
520 | ## school (Intercept) 9.69
521 | ## Residual 0.98
522 | ## ---
523 | ## number of obs: 1200, groups: class:school, 24; school, 6
524 | ## AIC = 3568.6, DIC = 3507.6
525 | ## deviance = 3531.1
526 | ```
527 |
528 | Here the `(1|school/class)` says that we want to fit a mixed effect term for varying intercepts `1|`
529 | by schools, and for classes that are nested within schools.
530 |
531 | # Fit a varying slope model with lmer
532 |
533 | But, what if we want to explore the effect of different student level indicators as they vary across
534 | classrooms. Instead of fitting unique models by school (or school/class) we can fit a varying slope
535 | model. Here we modify our random effect term to include variables before the grouping terms:
536 | `(1 +open|school/class)` tells R to fit a varying slope and varying intercept model for schools and
537 | classes nested within schools, and to allow the slope of the `open` variable to vary by school.
538 |
539 |
540 | ```r
541 | MLexamp.9 <- lmer(extro ~ open + agree + social + (1+open|school/class), data=lmm.data)
542 | display(MLexamp.9)
543 | ```
544 |
545 | ```
546 | ## lmer(formula = extro ~ open + agree + social + (1 + open | school/class),
547 | ## data = lmm.data)
548 | ## coef.est coef.se
549 | ## (Intercept) 60.26 3.46
550 | ## open 0.01 0.01
551 | ## agree -0.01 0.01
552 | ## social 0.00 0.00
553 | ##
554 | ## Error terms:
555 | ## Groups Name Std.Dev. Corr
556 | ## class:school (Intercept) 2.61
557 | ## open 0.01 1.00
558 | ## school (Intercept) 8.33
559 | ## open 0.00 1.00
560 | ## Residual 0.98
561 | ## ---
562 | ## number of obs: 1200, groups: class:school, 24; school, 6
563 | ## AIC = 3574.9, DIC = 3505.6
564 | ## deviance = 3529.3
565 | ```
566 |
567 | # Conclusion
568 |
569 | Fitting mixed effect models and exploring group level variation is very easy within the R language
570 | and ecosystem. In future tutorials we will explore comparing across models, doing inference with
571 | mixed-effect models, and creating graphical representations of mixed effect models to understand
572 | their effects.
573 |
574 | # Appendix
575 |
576 |
577 | ```r
578 | print(sessionInfo(),locale=FALSE)
579 | ```
580 |
581 | ```
582 | ## R version 3.5.3 (2019-03-11)
583 | ## Platform: x86_64-w64-mingw32/x64 (64-bit)
584 | ## Running under: Windows 10 x64 (build 17134)
585 | ##
586 | ## Matrix products: default
587 | ##
588 | ## attached base packages:
589 | ## [1] stats graphics grDevices utils datasets methods base
590 | ##
591 | ## other attached packages:
592 | ## [1] plyr_1.8.4 arm_1.10-1 MASS_7.3-51.4 lme4_1.1-21 Matrix_1.2-17 knitr_1.22
593 | ##
594 | ## loaded via a namespace (and not attached):
595 | ## [1] Rcpp_1.0.1 lattice_0.20-38 digest_0.6.18 grid_3.5.3 nlme_3.1-139 magrittr_1.5
596 | ## [7] coda_0.19-2 evaluate_0.13 stringi_1.4.3 minqa_1.2.4 nloptr_1.2.1 boot_1.3-22
597 | ## [13] rmarkdown_1.12 splines_3.5.3 tools_3.5.3 stringr_1.4.0 abind_1.4-5 xfun_0.6
598 | ## [19] yaml_2.2.0 compiler_3.5.3 htmltools_0.3.6
599 | ```
600 |
601 | [1] Examples include [Gelman and Hill](http://stat.columbia.edu/~gelman/arm),
602 | [Gelman et al. 2013](http://stat.columbia.edu/~gelman/book/), etc.
603 |
--------------------------------------------------------------------------------
/Tutorial1-ExploringLMERobjects.Rmd:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Fun with merMod Objects"
3 | author: "Jared E. Knowles"
4 | date: "Saturday, May 17, 2014"
5 | output:
6 | html_document:
7 | keep_md: yes
8 | self_contained: no
9 | ---
10 |
11 |
12 |
13 | ```{r setup, echo=FALSE, error=FALSE, message=FALSE, eval=TRUE, results='hide'}
14 | library(knitr)
15 | opts_chunk$set(dev='svg', fig.width=8, fig.height=6, echo=TRUE,
16 | message=FALSE, error=FALSE, warning=FALSE)
17 | options(width = 100)
18 | ```
19 |
20 |
21 | # Introduction
22 |
23 | First of all, be warned, the terminology surrounding multilevel models is vastly inconsistent. For
24 | example, multilevel models themselves may be referred to as hierarchical linear models, random
25 | effects models, multilevel models, random intercept models, random slope models, or pooling models.
26 | Depending on the discipline, software used, and the academic literature many of these terms may be
27 | referring to the same general modeling strategy. In this tutorial I will attempt to provide a user
28 | guide to multilevel modeling by demonstrating how to fit multilevel models in R and by attempting to
29 | connect the model fitting procedure to commonly used terminology used regarding these models.
30 |
31 | We will cover the following topics:
32 |
33 | - The structure and methods of `merMod` objects
34 | - Extracting random effects of `merMod` objects
35 | - Plotting and interpreting `merMod` objects
36 |
37 | If you haven't already, make sure you head over to the [Getting Started With Multilevel Models
38 | tutorial](http://jaredknowles.com/journal/2013/11/25/getting-started-with-mixed-effect-models-in-r)
39 | in order to ensure you have set up your environment correctly and installed all the necessary
40 | packages. The tl;dr is that you will need:
41 |
42 | - A current version of R (2.15 or greater)
43 | - The `lme4` package (`install.packages("lme4")`)
44 |
45 | # Read in the data
46 |
47 | Multilevel models are appropriate for a particular kind of data structure where units are nested
48 | within groups (generally 5+ groups) and where we want to model the group structure of the data. For
49 | our introductory example we will start with a simple example from the `lme4` documentation and
50 | explain what the model is doing. We will use data from Jon Starkweather at the [University of North
51 | Texas](http://bayes.acs.unt.edu:8083/BayesContent/class/Jon/). Visit the excellent tutorial
52 | [available here for
53 | more.](http://bayes.acs.unt.edu:8083/BayesContent/class/Jon/Benchmarks/LinearMixedModels_JDS_Dec2010.pdf)
54 |
55 | ```{r loadandviewdata}
56 | library(lme4) # load library
57 | library(arm) # convenience functions for regression in R
58 | lmm.data <- read.table("http://bayes.acs.unt.edu:8083/BayesContent/class/Jon/R_SC/Module9/lmm.data.txt",
59 | header=TRUE, sep=",", na.strings="NA", dec=".", strip.white=TRUE)
60 | #summary(lmm.data)
61 | head(lmm.data)
62 | ```
63 |
64 | Here we have data on the extroversion of subjects nested within classes and within schools.
65 |
66 | Let's understand the structure of the data a bit before we begin:
67 |
68 | ```{r explore}
69 | str(lmm.data)
70 | ```
71 |
72 | Here we see we have two possible grouping variables -- `class` and `school`. Let's
73 | explore them a bit further:
74 |
75 | ```{r exploregroups}
76 | table(lmm.data$class)
77 | table(lmm.data$school)
78 | table(lmm.data$class, lmm.data$school)
79 | ```
80 |
81 | This is a perfectly balanced dataset. In all likelihood you aren't working with a perfectly balanced
82 | dataset, but we'll explore the implications for that in the future. For now, let's plot the data a
83 | bit. Using the excellent `xyplot` function in the `lattice` package, we can explore the relationship
84 | between schools and classes across our variables.
85 |
86 | ```{r xyplot1}
87 | require(lattice)
88 | xyplot(extro ~ open + social + agree | class, data = lmm.data,
89 | auto.key = list(x = .85, y = .035, corner = c(0, 0)),
90 | layout = c(4,1), main = "Extroversion by Class")
91 | ```
92 |
93 | Here we see that within classes there are clear stratifications and we also see that the `social`
94 | variable is strongly distinct from the `open` and `agree` variables. We also see that class `a` and
95 | class `d` have significantly more spread in their lowest and highest bands respectively. Let's next
96 | plot the data by `school`.
97 |
98 |
99 | ```{r xyplot2}
100 | xyplot(extro ~ open + social + agree | school, data = lmm.data,
101 | auto.key = list(x = .85, y = .035, corner = c(0, 0)),
102 | layout = c(3, 2), main = "Extroversion by School")
103 | ```
104 |
105 | By school we see that students are tightly grouped, but that school `I` and school `VI` show
106 | substantially more dispersion than the other schools. The same pattern among our predictors holds
107 | between schools as it did between classes. Let's put it all together:
108 |
109 |
110 | ```{r xyplot3}
111 | xyplot(extro ~ open + social + agree | school + class, data = lmm.data,
112 | auto.key = list(x = .85, y = .035, corner = c(0, 0)),
113 | main = "Extroversion by School and Class")
114 | ```
115 |
116 | Here we can see that school and class seem to closely differentiate the relationship between our
117 | predictors and extroversion.
118 |
119 |
120 | ## Exploring the Internals of a merMod Object
121 |
122 | In the last tutorial we fit a series of random intercept models to our nested data. We will examine
123 | the `lmerMod` object produced when we fit this model in much more depth in order to understand how
124 | to work with mixed effect models in R. We start by fitting a the basic example below grouped by
125 | class:
126 |
127 | ```{r lmer1}
128 | MLexamp1 <- lmer(extro ~ open + agree + social + (1|school), data=lmm.data)
129 | class(MLexamp1)
130 | ```
131 |
132 | First, we see that `MLexamp1` is now an R object of the class `lmerMod`. This `lmerMod` object is an
133 | **S4** class, and to explore its structure, we use `slotNames`:
134 |
135 | ```{r lmermod}
136 | slotNames(MLexamp1)
137 | #showMethods(classes="lmerMod")
138 | ```
139 |
140 | Within the `lmerMod` object we see a number of objects that we may wish to explore. To look at any
141 | of these, we can simply type `MLexamp1@` and then the slot name itself. For example:
142 |
143 | ```{r slotnames1}
144 | MLexamp1@call # returns the model call
145 | MLexamp1@beta # returns the betas
146 | class(MLexamp1@frame) # returns the class for the frame slot
147 | head(MLexamp1@frame) # returns the model frame
148 | ```
149 |
150 | The `merMod` object has a number of methods available -- too many to enumerate here. But, we will go
151 | over some of the more common in the list below:
152 |
153 |
154 | ```{r modMethods}
155 | methods(class = "merMod")
156 |
157 | ```
158 |
159 | A common need is to extract the fixed effects from a `merMod` object. `fixef` extracts a named
160 | numeric vector of the fixed effects, which is handy.
161 |
162 | ```{r fixef}
163 | fixef(MLexamp1)
164 |
165 | ```
166 |
167 | If you want to get a sense of the p-values or statistical significance of these parameters, first
168 | consult the `lme4` help by running `?mcmcsamp` for a rundown of various ways of doing this. One
169 | convenient way built into the package is:
170 |
171 | ```{r confintr}
172 | confint(MLexamp1, level = 0.99)
173 |
174 | ```
175 |
176 | From here we can see first that our fixed effect parameters overlap 0 indicating no evidence of an
177 | effect. We can also see that `.sig01`, which is our estimate of the variability in the random
178 | effect, is very large and very widely defined. This indicates we may have a lack of precision
179 | between our groups - either because the group effect is small between groups, we have too few groups
180 | to get a more precise estimate, we have too few units within each group, or a combination of all of
181 | the above.
182 |
183 | Another common need is to extract the residual standard error, which is necessary for calculating
184 | effect sizes. To get a named vector of the residual standard error:
185 |
186 | ```{r sigmaef}
187 | sigma(MLexamp1)
188 | ```
189 |
190 | For example, it is common practice in education research to standardize fixed effects into "effect
191 | sizes" by dividing the fixed effect paramters by the residual standard error, which can be
192 | accomplished in `lme4` easily:
193 |
194 | ```{r effsize}
195 | fixef(MLexamp1) / sigma(MLexamp1)
196 |
197 | ```
198 |
199 | From this, we can see that our predictors of openness, agreeableness and social are virtually
200 | useless in predicting extroversion -- as our plots showed. Let's turn our attention to the random
201 | effects next.
202 |
203 | ## Explore Group Variation and Random Effects
204 |
205 | In all likelihood you fit a mixed-effect model because you are directly interested in the
206 | group-level variation in your model. It is not immediately clear how to explore this group level
207 | variation from the results of `summary.merMod`. What we get from this output is the variance and the
208 | standard deviation of the group effect, but we do not get effects for individual groups. This is
209 | where the `ranef` function comes in handy.
210 |
211 | ```{r ranef1}
212 | ranef(MLexamp1)
213 |
214 | ```
215 |
216 | Running the `ranef` function gives us the intercepts for each school, but not much additional
217 | information -- for example the precision of these estimates. To do that, we need some additional
218 | commands:
219 |
220 | ```{r ranef2}
221 | re1 <- ranef(MLexamp1, condVar=TRUE) # save the ranef.mer object
222 | class(re1)
223 | attr(re1[[1]], which = "postVar")
224 |
225 | ```
226 |
227 | The `ranef.mer` object is a list which contains a data.frame for each group level. The dataframe
228 | contains the random effects for each group (here we only have an intercept for each school). When we
229 | ask `lme4` for the conditional variance of the random effects it is stored in an `attribute` of
230 | those dataframes as a list of variance-covariance matrices.
231 |
232 | This structure is indeed *complicated*, but it is powerful as it allows for nested, grouped, and
233 | cross-level random effects. Also, the creators of `lme4` have provided users with some simple
234 | shortcuts to get what they are really interested in out of a `ranef.mer` object.
235 |
236 | ```{r ranef3}
237 | re1 <- ranef(MLexamp1, condVar=TRUE, whichel = "school")
238 | print(re1)
239 | dotplot(re1)
240 | ```
241 |
242 | This graphic shows a `dotplot` of the random effect terms, also known as a caterpillar plot. Here
243 | you can clearly see the effects of each school on `extroversion` as well as their standard errors to
244 | help identify how distinct the random effects are from one another. Interpreting random effects is
245 | notably tricky, but for assistance I would recommend looking at a few of these resources:
246 |
247 | - Gelman and Hill 2006 - [Data Analysis Using Regression and Multilevel/Hierarchical Techniques](http://www.stat.columbia.edu/~gelman/arm/)
248 | - John Fox - An R Compantion to Applied Regression [web appendix](http://socserv.mcmaster.ca/jfox/Books/Companion-1E/appendix-mixed-models.pdf)
249 |
250 | ## Using Simulation and Plots to Explore Random Effects
251 |
252 | A common econometric approach is to create what are known as **empirical Bayes** estimates of the
253 | group-level terms. Unfortunately there is not much agreement about what constitutes a proper
254 | standard error for the random effect terms or even how to consistently define **empirical Bayes**
255 | estimates.[^1] However, in R there are a few additional ways to get estimates of the random effects
256 | that provide the user with information about the relative sizes of the effects for each unit and the
257 | precision in that estimate. To do this, we use the `sim` function in the `arm` package.[^2]
258 |
259 | ```{r arm1}
260 | # A function to extract simulated estimates of random effect paramaters from
261 | # lme4 objects using the sim function in arm
262 | # whichel = the character for the name of the grouping effect to extract estimates for
263 | # nsims = the number of simulations to pass to sim
264 | # x = model object
265 | REsim <- function(x, whichel=NULL, nsims){
266 | require(plyr)
267 | mysim <- sim(x, n.sims = nsims)
268 | if(missing(whichel)){
269 | dat <- plyr::adply(mysim@ranef[[1]], c(2, 3), plyr::each(c(mean, median, sd)))
270 | warning("Only returning 1st random effect because whichel not specified")
271 | } else{
272 | dat <- plyr::adply(mysim@ranef[[whichel]], c(2, 3), plyr::each(c(mean, median, sd)))
273 | }
274 | return(dat)
275 | }
276 |
277 | REsim(MLexamp1, whichel = "school", nsims = 1000)
278 |
279 | ```
280 |
281 | The `REsim` function returns for each school the level name `X1`, the estimate name, `X2`, the mean
282 | of the estimated values, the median, and the standard deviation of the estimates.
283 |
284 | Another convenience function can help us plot these results to see how they compare to the results
285 | of `dotplot`:
286 |
287 | ```{r ebplot}
288 | # Dat = results of REsim
289 | # scale = factor to multiply sd by
290 | # var = character of "mean" or "median"
291 | # sd = character of "sd"
292 | plotREsim <- function(dat, scale, var, sd){
293 | require(eeptools)
294 | dat[, sd] <- dat[, sd] * scale
295 | dat[, "ymax"] <- dat[, var] + dat[, sd]
296 | dat[, "ymin"] <- dat[, var] - dat[, sd]
297 | dat[order(dat[, var]), "id"] <- c(1:nrow(dat))
298 | ggplot(dat, aes_string(x = "id", y = var, ymax = "ymax",
299 | ymin = "ymin")) +
300 | geom_pointrange() + theme_dpi() +
301 | labs(x = "Group", y = "Effect Range", title = "Effect Ranges") +
302 | theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank(),
303 | axis.text.x = element_blank(), axis.ticks.x = element_blank()) +
304 | geom_hline(yintercept = 0, color = I("red"), size = I(1.1))
305 | }
306 |
307 | plotREsim(REsim(MLexamp1, whichel = "school", nsims = 1000), scale = 1.2,
308 | var = "mean", sd = "sd")
309 | ```
310 |
311 |
312 | This presents a more conservative view of the variation between random effect components. Depending
313 | on how your data was collected and your research question, alternative ways of estimating these
314 | effect sizes are possible. However, proceed with caution.[^3]
315 |
316 | Another approach recommended by the authors of `lme4` involves the `RLRsim` package. Using this
317 | package we can test whether or not inclusion of the random effects improves model fit and we can
318 | evaluate the p-value of additional random effect terms using a likelihood ratio test based on
319 | simulation.[^4]
320 |
321 | ```{r rlrsim}
322 | library(RLRsim)
323 | m0 <- lm(extro ~ agree + open + social, data =lmm.data) # fit the null model
324 | exactLRT(m = MLexamp1, m0 = m0)
325 |
326 | ```
327 |
328 | Here `exactLRT` issues a warning because we originally fit the model with REML instead of full
329 | maximum likelihood. Fortunately, the `refitML` function in `lme4` allows us to easily refit our
330 | model using full maximum likelihood to conduct an exact test easily.
331 |
332 | ```{r rlrsim2}
333 | mA <- refitML(MLexamp1)
334 | exactLRT(m= mA, m0 = m0)
335 | ```
336 |
337 | Here we can see that the inclusion of our grouping variable is significant, even though the effect
338 | of each individual group may be substantively small and/or imprecisely measured. This is important
339 | in understanding the correct specification of the model. Our next tutorial will cover specification
340 | tests like this in more detail.
341 |
342 | ## What do Random Effects Matter?
343 |
344 | How do interpret the *substantive* impact of our random effects? This is often critical in
345 | observation work trying to use a multilevel structure to understand the impact that the grouping can
346 | have on the individual observation. To do this we select 12 random cases and then we simulate their
347 | predicted value of `extro` if they were placed in each of the 6 schools. Note, that this is a very
348 | simple simulation just using the mean of the fixed effect and the conditional mode of the random
349 | effect and not replicating or sampling to get a sense of the variability. This will be left as an
350 | exercise to the reader and/or a future tutorial!
351 |
352 | ```{r ranefplotsetup}
353 | # Simulate
354 | # Let's create 12 cases of students
355 | #
356 | #sample some rows
357 | simX <- sample(lmm.data$id, 12)
358 | simX <- lmm.data[lmm.data$id %in% simX, c(3:5)] # get their data
359 | # add an intercept
360 | simX[, "Intercept"] <- 1
361 | simX <- simX[, c(4, 1:3)] # reorder
362 | simRE <- REsim(MLexamp1, whichel = "school", nsims = 1000) # simulate randome effects
363 | simX$case <- row.names(simX) # create a case ID
364 | # expand a grid of case IDs by schools
365 | simDat <- expand.grid(case = row.names(simX), school = levels(lmm.data$school))
366 | simDat <- merge(simX, simDat) # merge in the data
367 | # Create the fixed effect predictor
368 | simDat[, "fepred"] <- (simDat[, 2] * fixef(MLexamp1)[1]) + (simDat[, 3] * fixef(MLexamp1)[2]) +
369 | (simDat[, 4] * fixef(MLexamp1)[3]) + (simDat[, 5] * fixef(MLexamp1)[4])
370 | # Add the school effects
371 | simDat <- merge(simDat, simRE[, c(1, 3)], by.x = "school", by.y="X1")
372 | simDat$yhat <- simDat$fepred + simDat$mean # add the school specific intercept
373 | ```
374 |
375 | Now that we have set up a simulated dataframe, let's plot it, first by case:
376 |
377 | ```{r bycaseplot}
378 | qplot(school, yhat, data = simDat) + facet_wrap(~case) + theme_dpi()
379 |
380 | ```
381 |
382 | This plot shows us that within each plot, representing a case, there is tremendous variation by
383 | school. So, moving each student into a different school has large effects on the extroversion score.
384 | But, does each case vary at each school?
385 |
386 | ```{r byschool}
387 | qplot(case, yhat, data = simDat) + facet_wrap(~school) + theme_dpi() +
388 | theme(axis.text.x = element_blank())
389 |
390 | ```
391 |
392 | Here we can clearly see that within each school the cases are relatively the same indicating that
393 | the group effect is larger than the individual effects.
394 |
395 | These plots are useful in demonstrating the relative importance of group and individual effects in a
396 | substantive fashion. Even more can be done to make the the graphs more informative, such as placing
397 | references to the total variability of the outcome and also looking at the distance moving groups
398 | moves each observation from its true value.
399 |
400 | # Conclusion
401 |
402 | `lme4` provides a very powerful object-oriented toolset for dealing with mixed effect models in R.
403 | Understanding model fit and confidence intervals of `lme4` objects requires some diligent research
404 | and the use of a variety of functions and extensions of `lme4` itself. In our next tutorial we will
405 | explore how to identify a proper specification of a random-effect model and Bayesian extensions of
406 | the `lme4` framework for difficult to specify models. We will also explore the generalized linear
407 | model framework and the `glmer` function for generalized linear modeling with multi-levels.
408 |
409 | # Appendix
410 |
411 | ```{r sessioninfo}
412 | print(sessionInfo(),locale=FALSE)
413 |
414 | ```
415 |
416 | [^1]: [See message from `lme4` co-author Doug Bates on this subject]. (https://stat.ethz.ch/pipermail/r-sig-mixed-models/2009q4/002984.html)
417 | [^2]: Andrew Gelman and Yu-Sung Su (2014). arm: Data Analysis Using Regression and Multilevel/Hierarchical Models. R package version
418 | 1.7-03. http://CRAN.R-project.org/package=arm
419 | [^3]: [WikiDot FAQ from the R Mixed Models Mailing List](http://glmm.wikidot.com/faq)
420 | [^4]: There are also an extensive series of references available in the `References`
421 | section of the help by running `?exactLRT` and `?exactRLRT`.
422 |
--------------------------------------------------------------------------------
/Tutorial1-ExploringLMERobjects.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Fun with merMod Objects"
3 | author: "Jared E. Knowles"
4 | date: "Saturday, May 17, 2014"
5 | output:
6 | html_document:
7 | keep_md: yes
8 | self_contained: no
9 | ---
10 |
11 |
12 |
13 |
14 |
15 |
16 | # Introduction
17 |
18 | First of all, be warned, the terminology surrounding multilevel models is vastly inconsistent. For
19 | example, multilevel models themselves may be referred to as hierarchical linear models, random
20 | effects models, multilevel models, random intercept models, random slope models, or pooling models.
21 | Depending on the discipline, software used, and the academic literature many of these terms may be
22 | referring to the same general modeling strategy. In this tutorial I will attempt to provide a user
23 | guide to multilevel modeling by demonstrating how to fit multilevel models in R and by attempting to
24 | connect the model fitting procedure to commonly used terminology used regarding these models.
25 |
26 | We will cover the following topics:
27 |
28 | - The structure and methods of `merMod` objects
29 | - Extracting random effects of `merMod` objects
30 | - Plotting and interpreting `merMod` objects
31 |
32 | If you haven't already, make sure you head over to the [Getting Started With Multilevel Models
33 | tutorial](http://jaredknowles.com/journal/2013/11/25/getting-started-with-mixed-effect-models-in-r)
34 | in order to ensure you have set up your environment correctly and installed all the necessary
35 | packages. The tl;dr is that you will need:
36 |
37 | - A current version of R (2.15 or greater)
38 | - The `lme4` package (`install.packages("lme4")`)
39 |
40 | # Read in the data
41 |
42 | Multilevel models are appropriate for a particular kind of data structure where units are nested
43 | within groups (generally 5+ groups) and where we want to model the group structure of the data. For
44 | our introductory example we will start with a simple example from the `lme4` documentation and
45 | explain what the model is doing. We will use data from Jon Starkweather at the [University of North
46 | Texas](http://bayes.acs.unt.edu:8083/BayesContent/class/Jon/). Visit the excellent tutorial
47 | [available here for
48 | more.](http://bayes.acs.unt.edu:8083/BayesContent/class/Jon/Benchmarks/LinearMixedModels_JDS_Dec2010.pdf)
49 |
50 |
51 | ```r
52 | library(lme4) # load library
53 | library(arm) # convenience functions for regression in R
54 | lmm.data <- read.table("http://bayes.acs.unt.edu:8083/BayesContent/class/Jon/R_SC/Module9/lmm.data.txt",
55 | header=TRUE, sep=",", na.strings="NA", dec=".", strip.white=TRUE)
56 | #summary(lmm.data)
57 | head(lmm.data)
58 | ```
59 |
60 | ```
61 | ## id extro open agree social class school
62 | ## 1 1 63.69356 43.43306 38.02668 75.05811 d IV
63 | ## 2 2 69.48244 46.86979 31.48957 98.12560 a VI
64 | ## 3 3 79.74006 32.27013 40.20866 116.33897 d VI
65 | ## 4 4 62.96674 44.40790 30.50866 90.46888 c IV
66 | ## 5 5 64.24582 36.86337 37.43949 98.51873 d IV
67 | ## 6 6 50.97107 46.25627 38.83196 75.21992 d I
68 | ```
69 |
70 | Here we have data on the extroversion of subjects nested within classes and within schools.
71 |
72 | Let's understand the structure of the data a bit before we begin:
73 |
74 |
75 | ```r
76 | str(lmm.data)
77 | ```
78 |
79 | ```
80 | ## 'data.frame': 1200 obs. of 7 variables:
81 | ## $ id : int 1 2 3 4 5 6 7 8 9 10 ...
82 | ## $ extro : num 63.7 69.5 79.7 63 64.2 ...
83 | ## $ open : num 43.4 46.9 32.3 44.4 36.9 ...
84 | ## $ agree : num 38 31.5 40.2 30.5 37.4 ...
85 | ## $ social: num 75.1 98.1 116.3 90.5 98.5 ...
86 | ## $ class : Factor w/ 4 levels "a","b","c","d": 4 1 4 3 4 4 4 4 1 2 ...
87 | ## $ school: Factor w/ 6 levels "I","II","III",..: 4 6 6 4 4 1 3 4 3 1 ...
88 | ```
89 |
90 | Here we see we have two possible grouping variables -- `class` and `school`. Let's
91 | explore them a bit further:
92 |
93 |
94 | ```r
95 | table(lmm.data$class)
96 | ```
97 |
98 | ```
99 | ##
100 | ## a b c d
101 | ## 300 300 300 300
102 | ```
103 |
104 | ```r
105 | table(lmm.data$school)
106 | ```
107 |
108 | ```
109 | ##
110 | ## I II III IV V VI
111 | ## 200 200 200 200 200 200
112 | ```
113 |
114 | ```r
115 | table(lmm.data$class, lmm.data$school)
116 | ```
117 |
118 | ```
119 | ##
120 | ## I II III IV V VI
121 | ## a 50 50 50 50 50 50
122 | ## b 50 50 50 50 50 50
123 | ## c 50 50 50 50 50 50
124 | ## d 50 50 50 50 50 50
125 | ```
126 |
127 | This is a perfectly balanced dataset. In all likelihood you aren't working with a perfectly balanced
128 | dataset, but we'll explore the implications for that in the future. For now, let's plot the data a
129 | bit. Using the excellent `xyplot` function in the `lattice` package, we can explore the relationship
130 | between schools and classes across our variables.
131 |
132 |
133 | ```r
134 | require(lattice)
135 | xyplot(extro ~ open + social + agree | class, data = lmm.data,
136 | auto.key = list(x = .85, y = .035, corner = c(0, 0)),
137 | layout = c(4,1), main = "Extroversion by Class")
138 | ```
139 |
140 | 
141 |
142 | Here we see that within classes there are clear stratifications and we also see that the `social`
143 | variable is strongly distinct from the `open` and `agree` variables. We also see that class `a` and
144 | class `d` have significantly more spread in their lowest and highest bands respectively. Let's next
145 | plot the data by `school`.
146 |
147 |
148 |
149 | ```r
150 | xyplot(extro ~ open + social + agree | school, data = lmm.data,
151 | auto.key = list(x = .85, y = .035, corner = c(0, 0)),
152 | layout = c(3, 2), main = "Extroversion by School")
153 | ```
154 |
155 | 
156 |
157 | By school we see that students are tightly grouped, but that school `I` and school `VI` show
158 | substantially more dispersion than the other schools. The same pattern among our predictors holds
159 | between schools as it did between classes. Let's put it all together:
160 |
161 |
162 |
163 | ```r
164 | xyplot(extro ~ open + social + agree | school + class, data = lmm.data,
165 | auto.key = list(x = .85, y = .035, corner = c(0, 0)),
166 | main = "Extroversion by School and Class")
167 | ```
168 |
169 | 
170 |
171 | Here we can see that school and class seem to closely differentiate the relationship between our
172 | predictors and extroversion.
173 |
174 |
175 | ## Exploring the Internals of a merMod Object
176 |
177 | In the last tutorial we fit a series of random intercept models to our nested data. We will examine
178 | the `lmerMod` object produced when we fit this model in much more depth in order to understand how
179 | to work with mixed effect models in R. We start by fitting a the basic example below grouped by
180 | class:
181 |
182 |
183 | ```r
184 | MLexamp1 <- lmer(extro ~ open + agree + social + (1|school), data=lmm.data)
185 | class(MLexamp1)
186 | ```
187 |
188 | ```
189 | ## [1] "lmerMod"
190 | ## attr(,"package")
191 | ## [1] "lme4"
192 | ```
193 |
194 | First, we see that `MLexamp1` is now an R object of the class `lmerMod`. This `lmerMod` object is an
195 | **S4** class, and to explore its structure, we use `slotNames`:
196 |
197 |
198 | ```r
199 | slotNames(MLexamp1)
200 | ```
201 |
202 | ```
203 | ## [1] "resp" "Gp" "call" "frame" "flist" "cnms" "lower" "theta" "beta"
204 | ## [10] "u" "devcomp" "pp" "optinfo"
205 | ```
206 |
207 | ```r
208 | #showMethods(classes="lmerMod")
209 | ```
210 |
211 | Within the `lmerMod` object we see a number of objects that we may wish to explore. To look at any
212 | of these, we can simply type `MLexamp1@` and then the slot name itself. For example:
213 |
214 |
215 | ```r
216 | MLexamp1@call # returns the model call
217 | ```
218 |
219 | ```
220 | ## lmer(formula = extro ~ open + agree + social + (1 | school),
221 | ## data = lmm.data)
222 | ```
223 |
224 | ```r
225 | MLexamp1@beta # returns the betas
226 | ```
227 |
228 | ```
229 | ## [1] 59.116514199 0.009750941 0.027788360 -0.002151446
230 | ```
231 |
232 | ```r
233 | class(MLexamp1@frame) # returns the class for the frame slot
234 | ```
235 |
236 | ```
237 | ## [1] "data.frame"
238 | ```
239 |
240 | ```r
241 | head(MLexamp1@frame) # returns the model frame
242 | ```
243 |
244 | ```
245 | ## extro open agree social school
246 | ## 1 63.69356 43.43306 38.02668 75.05811 IV
247 | ## 2 69.48244 46.86979 31.48957 98.12560 VI
248 | ## 3 79.74006 32.27013 40.20866 116.33897 VI
249 | ## 4 62.96674 44.40790 30.50866 90.46888 IV
250 | ## 5 64.24582 36.86337 37.43949 98.51873 IV
251 | ## 6 50.97107 46.25627 38.83196 75.21992 I
252 | ```
253 |
254 | The `merMod` object has a number of methods available -- too many to enumerate here. But, we will go
255 | over some of the more common in the list below:
256 |
257 |
258 |
259 | ```r
260 | methods(class = "merMod")
261 | ```
262 |
263 | ```
264 | ## [1] anova as.function coef confint cooks.distance deviance
265 | ## [7] df.residual display drop1 extractAIC extractDIC family
266 | ## [13] fitted fixef formula getL getME hatvalues
267 | ## [19] influence isGLMM isLMM isNLMM isREML logLik
268 | ## [25] mcsamp model.frame model.matrix ngrps nobs plot
269 | ## [31] predict print profile qqmath ranef refit
270 | ## [37] refitML rePCA residuals rstudent se.coef show
271 | ## [43] sigma.hat sigma sim simulate standardize summary
272 | ## [49] terms update VarCorr vcov weights
273 | ## see '?methods' for accessing help and source code
274 | ```
275 |
276 | A common need is to extract the fixed effects from a `merMod` object. `fixef` extracts a named
277 | numeric vector of the fixed effects, which is handy.
278 |
279 |
280 | ```r
281 | fixef(MLexamp1)
282 | ```
283 |
284 | ```
285 | ## (Intercept) open agree social
286 | ## 59.116514199 0.009750941 0.027788360 -0.002151446
287 | ```
288 |
289 | If you want to get a sense of the p-values or statistical significance of these parameters, first
290 | consult the `lme4` help by running `?mcmcsamp` for a rundown of various ways of doing this. One
291 | convenient way built into the package is:
292 |
293 |
294 | ```r
295 | confint(MLexamp1, level = 0.99)
296 | ```
297 |
298 | ```
299 | ## 0.5 % 99.5 %
300 | ## .sig01 4.91840325 23.88757695
301 | ## .sigma 2.53286648 2.81455985
302 | ## (Intercept) 46.27750884 71.95609747
303 | ## open -0.02464506 0.04414924
304 | ## agree -0.01163700 0.06721354
305 | ## social -0.01492690 0.01062510
306 | ```
307 |
308 | From here we can see first that our fixed effect parameters overlap 0 indicating no evidence of an
309 | effect. We can also see that `.sig01`, which is our estimate of the variability in the random
310 | effect, is very large and very widely defined. This indicates we may have a lack of precision
311 | between our groups - either because the group effect is small between groups, we have too few groups
312 | to get a more precise estimate, we have too few units within each group, or a combination of all of
313 | the above.
314 |
315 | Another common need is to extract the residual standard error, which is necessary for calculating
316 | effect sizes. To get a named vector of the residual standard error:
317 |
318 |
319 | ```r
320 | sigma(MLexamp1)
321 | ```
322 |
323 | ```
324 | ## [1] 2.670886
325 | ```
326 |
327 | For example, it is common practice in education research to standardize fixed effects into "effect
328 | sizes" by dividing the fixed effect paramters by the residual standard error, which can be
329 | accomplished in `lme4` easily:
330 |
331 |
332 | ```r
333 | fixef(MLexamp1) / sigma(MLexamp1)
334 | ```
335 |
336 | ```
337 | ## (Intercept) open agree social
338 | ## 22.1336707437 0.0036508262 0.0104041726 -0.0008055176
339 | ```
340 |
341 | From this, we can see that our predictors of openness, agreeableness and social are virtually
342 | useless in predicting extroversion -- as our plots showed. Let's turn our attention to the random
343 | effects next.
344 |
345 | ## Explore Group Variation and Random Effects
346 |
347 | In all likelihood you fit a mixed-effect model because you are directly interested in the
348 | group-level variation in your model. It is not immediately clear how to explore this group level
349 | variation from the results of `summary.merMod`. What we get from this output is the variance and the
350 | standard deviation of the group effect, but we do not get effects for individual groups. This is
351 | where the `ranef` function comes in handy.
352 |
353 |
354 | ```r
355 | ranef(MLexamp1)
356 | ```
357 |
358 | ```
359 | ## $school
360 | ## (Intercept)
361 | ## I -14.090991
362 | ## II -6.183368
363 | ## III -1.970700
364 | ## IV 1.965938
365 | ## V 6.330710
366 | ## VI 13.948412
367 | ##
368 | ## with conditional variances for "school"
369 | ```
370 |
371 | Running the `ranef` function gives us the intercepts for each school, but not much additional
372 | information -- for example the precision of these estimates. To do that, we need some additional
373 | commands:
374 |
375 |
376 | ```r
377 | re1 <- ranef(MLexamp1, condVar=TRUE) # save the ranef.mer object
378 | class(re1)
379 | ```
380 |
381 | ```
382 | ## [1] "ranef.mer"
383 | ```
384 |
385 | ```r
386 | attr(re1[[1]], which = "postVar")
387 | ```
388 |
389 | ```
390 | ## , , 1
391 | ##
392 | ## [,1]
393 | ## [1,] 0.0356549
394 | ##
395 | ## , , 2
396 | ##
397 | ## [,1]
398 | ## [1,] 0.0356549
399 | ##
400 | ## , , 3
401 | ##
402 | ## [,1]
403 | ## [1,] 0.0356549
404 | ##
405 | ## , , 4
406 | ##
407 | ## [,1]
408 | ## [1,] 0.0356549
409 | ##
410 | ## , , 5
411 | ##
412 | ## [,1]
413 | ## [1,] 0.0356549
414 | ##
415 | ## , , 6
416 | ##
417 | ## [,1]
418 | ## [1,] 0.0356549
419 | ```
420 |
421 | The `ranef.mer` object is a list which contains a data.frame for each group level. The dataframe
422 | contains the random effects for each group (here we only have an intercept for each school). When we
423 | ask `lme4` for the conditional variance of the random effects it is stored in an `attribute` of
424 | those dataframes as a list of variance-covariance matrices.
425 |
426 | This structure is indeed *complicated*, but it is powerful as it allows for nested, grouped, and
427 | cross-level random effects. Also, the creators of `lme4` have provided users with some simple
428 | shortcuts to get what they are really interested in out of a `ranef.mer` object.
429 |
430 |
431 | ```r
432 | re1 <- ranef(MLexamp1, condVar=TRUE, whichel = "school")
433 | print(re1)
434 | ```
435 |
436 | ```
437 | ## $school
438 | ## (Intercept)
439 | ## I -14.090991
440 | ## II -6.183368
441 | ## III -1.970700
442 | ## IV 1.965938
443 | ## V 6.330710
444 | ## VI 13.948412
445 | ##
446 | ## with conditional variances for "school"
447 | ```
448 |
449 | ```r
450 | dotplot(re1)
451 | ```
452 |
453 | ```
454 | ## $school
455 | ```
456 |
457 | 
458 |
459 | This graphic shows a `dotplot` of the random effect terms, also known as a caterpillar plot. Here
460 | you can clearly see the effects of each school on `extroversion` as well as their standard errors to
461 | help identify how distinct the random effects are from one another. Interpreting random effects is
462 | notably tricky, but for assistance I would recommend looking at a few of these resources:
463 |
464 | - Gelman and Hill 2006 - [Data Analysis Using Regression and Multilevel/Hierarchical Techniques](http://www.stat.columbia.edu/~gelman/arm/)
465 | - John Fox - An R Compantion to Applied Regression [web appendix](http://socserv.mcmaster.ca/jfox/Books/Companion-1E/appendix-mixed-models.pdf)
466 |
467 | ## Using Simulation and Plots to Explore Random Effects
468 |
469 | A common econometric approach is to create what are known as **empirical Bayes** estimates of the
470 | group-level terms. Unfortunately there is not much agreement about what constitutes a proper
471 | standard error for the random effect terms or even how to consistently define **empirical Bayes**
472 | estimates.[^1] However, in R there are a few additional ways to get estimates of the random effects
473 | that provide the user with information about the relative sizes of the effects for each unit and the
474 | precision in that estimate. To do this, we use the `sim` function in the `arm` package.[^2]
475 |
476 |
477 | ```r
478 | # A function to extract simulated estimates of random effect paramaters from
479 | # lme4 objects using the sim function in arm
480 | # whichel = the character for the name of the grouping effect to extract estimates for
481 | # nsims = the number of simulations to pass to sim
482 | # x = model object
483 | REsim <- function(x, whichel=NULL, nsims){
484 | require(plyr)
485 | mysim <- sim(x, n.sims = nsims)
486 | if(missing(whichel)){
487 | dat <- plyr::adply(mysim@ranef[[1]], c(2, 3), plyr::each(c(mean, median, sd)))
488 | warning("Only returning 1st random effect because whichel not specified")
489 | } else{
490 | dat <- plyr::adply(mysim@ranef[[whichel]], c(2, 3), plyr::each(c(mean, median, sd)))
491 | }
492 | return(dat)
493 | }
494 |
495 | REsim(MLexamp1, whichel = "school", nsims = 1000)
496 | ```
497 |
498 | ```
499 | ## X1 X2 mean median sd
500 | ## 1 I (Intercept) -14.088205 -14.287477 3.923270
501 | ## 2 II (Intercept) -6.183570 -6.369473 3.937168
502 | ## 3 III (Intercept) -1.956252 -2.078317 3.925270
503 | ## 4 IV (Intercept) 1.968866 1.843241 3.930132
504 | ## 5 V (Intercept) 6.344076 6.142423 3.925949
505 | ## 6 VI (Intercept) 13.954781 13.770879 3.919504
506 | ```
507 |
508 | The `REsim` function returns for each school the level name `X1`, the estimate name, `X2`, the mean
509 | of the estimated values, the median, and the standard deviation of the estimates.
510 |
511 | Another convenience function can help us plot these results to see how they compare to the results
512 | of `dotplot`:
513 |
514 |
515 | ```r
516 | # Dat = results of REsim
517 | # scale = factor to multiply sd by
518 | # var = character of "mean" or "median"
519 | # sd = character of "sd"
520 | plotREsim <- function(dat, scale, var, sd){
521 | require(eeptools)
522 | dat[, sd] <- dat[, sd] * scale
523 | dat[, "ymax"] <- dat[, var] + dat[, sd]
524 | dat[, "ymin"] <- dat[, var] - dat[, sd]
525 | dat[order(dat[, var]), "id"] <- c(1:nrow(dat))
526 | ggplot(dat, aes_string(x = "id", y = var, ymax = "ymax",
527 | ymin = "ymin")) +
528 | geom_pointrange() + theme_dpi() +
529 | labs(x = "Group", y = "Effect Range", title = "Effect Ranges") +
530 | theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank(),
531 | axis.text.x = element_blank(), axis.ticks.x = element_blank()) +
532 | geom_hline(yintercept = 0, color = I("red"), size = I(1.1))
533 | }
534 |
535 | plotREsim(REsim(MLexamp1, whichel = "school", nsims = 1000), scale = 1.2,
536 | var = "mean", sd = "sd")
537 | ```
538 |
539 | 
540 |
541 |
542 | This presents a more conservative view of the variation between random effect components. Depending
543 | on how your data was collected and your research question, alternative ways of estimating these
544 | effect sizes are possible. However, proceed with caution.[^3]
545 |
546 | Another approach recommended by the authors of `lme4` involves the `RLRsim` package. Using this
547 | package we can test whether or not inclusion of the random effects improves model fit and we can
548 | evaluate the p-value of additional random effect terms using a likelihood ratio test based on
549 | simulation.[^4]
550 |
551 |
552 | ```r
553 | library(RLRsim)
554 | m0 <- lm(extro ~ agree + open + social, data =lmm.data) # fit the null model
555 | exactLRT(m = MLexamp1, m0 = m0)
556 | ```
557 |
558 | ```
559 | ##
560 | ## simulated finite sample distribution of LRT. (p-value based on 10000 simulated values)
561 | ##
562 | ## data:
563 | ## LRT = 2957.7, p-value < 2.2e-16
564 | ```
565 |
566 | Here `exactLRT` issues a warning because we originally fit the model with REML instead of full
567 | maximum likelihood. Fortunately, the `refitML` function in `lme4` allows us to easily refit our
568 | model using full maximum likelihood to conduct an exact test easily.
569 |
570 |
571 | ```r
572 | mA <- refitML(MLexamp1)
573 | exactLRT(m= mA, m0 = m0)
574 | ```
575 |
576 | ```
577 | ##
578 | ## simulated finite sample distribution of LRT. (p-value based on 10000 simulated values)
579 | ##
580 | ## data:
581 | ## LRT = 2957.8, p-value < 2.2e-16
582 | ```
583 |
584 | Here we can see that the inclusion of our grouping variable is significant, even though the effect
585 | of each individual group may be substantively small and/or imprecisely measured. This is important
586 | in understanding the correct specification of the model. Our next tutorial will cover specification
587 | tests like this in more detail.
588 |
589 | ## What do Random Effects Matter?
590 |
591 | How do interpret the *substantive* impact of our random effects? This is often critical in
592 | observation work trying to use a multilevel structure to understand the impact that the grouping can
593 | have on the individual observation. To do this we select 12 random cases and then we simulate their
594 | predicted value of `extro` if they were placed in each of the 6 schools. Note, that this is a very
595 | simple simulation just using the mean of the fixed effect and the conditional mode of the random
596 | effect and not replicating or sampling to get a sense of the variability. This will be left as an
597 | exercise to the reader and/or a future tutorial!
598 |
599 |
600 | ```r
601 | # Simulate
602 | # Let's create 12 cases of students
603 | #
604 | #sample some rows
605 | simX <- sample(lmm.data$id, 12)
606 | simX <- lmm.data[lmm.data$id %in% simX, c(3:5)] # get their data
607 | # add an intercept
608 | simX[, "Intercept"] <- 1
609 | simX <- simX[, c(4, 1:3)] # reorder
610 | simRE <- REsim(MLexamp1, whichel = "school", nsims = 1000) # simulate randome effects
611 | simX$case <- row.names(simX) # create a case ID
612 | # expand a grid of case IDs by schools
613 | simDat <- expand.grid(case = row.names(simX), school = levels(lmm.data$school))
614 | simDat <- merge(simX, simDat) # merge in the data
615 | # Create the fixed effect predictor
616 | simDat[, "fepred"] <- (simDat[, 2] * fixef(MLexamp1)[1]) + (simDat[, 3] * fixef(MLexamp1)[2]) +
617 | (simDat[, 4] * fixef(MLexamp1)[3]) + (simDat[, 5] * fixef(MLexamp1)[4])
618 | # Add the school effects
619 | simDat <- merge(simDat, simRE[, c(1, 3)], by.x = "school", by.y="X1")
620 | simDat$yhat <- simDat$fepred + simDat$mean # add the school specific intercept
621 | ```
622 |
623 | Now that we have set up a simulated dataframe, let's plot it, first by case:
624 |
625 |
626 | ```r
627 | qplot(school, yhat, data = simDat) + facet_wrap(~case) + theme_dpi()
628 | ```
629 |
630 | 
631 |
632 | This plot shows us that within each plot, representing a case, there is tremendous variation by
633 | school. So, moving each student into a different school has large effects on the extroversion score.
634 | But, does each case vary at each school?
635 |
636 |
637 | ```r
638 | qplot(case, yhat, data = simDat) + facet_wrap(~school) + theme_dpi() +
639 | theme(axis.text.x = element_blank())
640 | ```
641 |
642 | 
643 |
644 | Here we can clearly see that within each school the cases are relatively the same indicating that
645 | the group effect is larger than the individual effects.
646 |
647 | These plots are useful in demonstrating the relative importance of group and individual effects in a
648 | substantive fashion. Even more can be done to make the the graphs more informative, such as placing
649 | references to the total variability of the outcome and also looking at the distance moving groups
650 | moves each observation from its true value.
651 |
652 | # Conclusion
653 |
654 | `lme4` provides a very powerful object-oriented toolset for dealing with mixed effect models in R.
655 | Understanding model fit and confidence intervals of `lme4` objects requires some diligent research
656 | and the use of a variety of functions and extensions of `lme4` itself. In our next tutorial we will
657 | explore how to identify a proper specification of a random-effect model and Bayesian extensions of
658 | the `lme4` framework for difficult to specify models. We will also explore the generalized linear
659 | model framework and the `glmer` function for generalized linear modeling with multi-levels.
660 |
661 | # Appendix
662 |
663 |
664 | ```r
665 | print(sessionInfo(),locale=FALSE)
666 | ```
667 |
668 | ```
669 | ## R version 3.5.3 (2019-03-11)
670 | ## Platform: x86_64-w64-mingw32/x64 (64-bit)
671 | ## Running under: Windows 10 x64 (build 17134)
672 | ##
673 | ## Matrix products: default
674 | ##
675 | ## attached base packages:
676 | ## [1] stats graphics grDevices utils datasets methods base
677 | ##
678 | ## other attached packages:
679 | ## [1] RLRsim_3.1-3 eeptools_1.2.2 ggplot2_3.1.1 plyr_1.8.4 lattice_0.20-38 arm_1.10-1
680 | ## [7] MASS_7.3-51.4 lme4_1.1-21 Matrix_1.2-17 knitr_1.22
681 | ##
682 | ## loaded via a namespace (and not attached):
683 | ## [1] zoo_1.8-5 tidyselect_0.2.5 xfun_0.6 purrr_0.3.2 splines_3.5.3
684 | ## [6] colorspace_1.4-1 htmltools_0.3.6 yaml_2.2.0 mgcv_1.8-28 rlang_0.3.4
685 | ## [11] nloptr_1.2.1 pillar_1.3.1 foreign_0.8-71 glue_1.3.1 withr_2.1.2
686 | ## [16] sp_1.3-1 stringr_1.4.0 munsell_0.5.0 gtable_0.3.0 coda_0.19-2
687 | ## [21] evaluate_0.13 labeling_0.3 maptools_0.9-5 lmtest_0.9-37 vcd_1.4-4
688 | ## [26] Rcpp_1.0.1 scales_1.0.0 abind_1.4-5 digest_0.6.18 stringi_1.4.3
689 | ## [31] dplyr_0.8.0.1 grid_3.5.3 tools_3.5.3 magrittr_1.5 lazyeval_0.2.2
690 | ## [36] tibble_2.1.1 crayon_1.3.4 pkgconfig_2.0.2 data.table_1.12.2 assertthat_0.2.1
691 | ## [41] minqa_1.2.4 rmarkdown_1.12 R6_2.4.0 boot_1.3-22 nlme_3.1-139
692 | ## [46] compiler_3.5.3
693 | ```
694 |
695 | [^1]: [See message from `lme4` co-author Doug Bates on this subject]. (https://stat.ethz.ch/pipermail/r-sig-mixed-models/2009q4/002984.html)
696 | [^2]: Andrew Gelman and Yu-Sung Su (2014). arm: Data Analysis Using Regression and Multilevel/Hierarchical Models. R package version
697 | 1.7-03. http://CRAN.R-project.org/package=arm
698 | [^3]: [WikiDot FAQ from the R Mixed Models Mailing List](http://glmm.wikidot.com/faq)
699 | [^4]: There are also an extensive series of references available in the `References`
700 | section of the help by running `?exactLRT` and `?exactRLRT`.
701 |
--------------------------------------------------------------------------------
/Tutorial2-ProperSpecification.Rmd:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Tutorial2-ProperSpecificationofREmodels"
3 | author: "Jared Knowles"
4 | date: "Saturday, May 17, 2014"
5 | output: html_document
6 | ---
7 |
8 |
14 |
15 | ```{r setup, echo=FALSE, error=FALSE, message=FALSE, eval=TRUE, results='hide'}
16 | library(knitr)
17 | opts_chunk$set(dev='svg', fig.width=6, fig.height=6, echo=TRUE,
18 | message=FALSE, error=FALSE, warning=FALSE)
19 |
20 | ```
21 |
22 |
23 | ```{r loadandviewdata}
24 | library(lme4) # load library
25 | library(arm) # convenience functions for regression in R
26 | lmm.data <- read.table("http://bayes.acs.unt.edu:8083/BayesContent/class/Jon/R_SC/Module9/lmm.data.txt",
27 | header=TRUE, sep=",", na.strings="NA", dec=".", strip.white=TRUE)
28 | #summary(lmm.data)
29 | head(lmm.data)
30 | ```
31 |
32 | ## Fully Interacted Models
33 |
34 | ```{r fullinteract}
35 |
36 | classEff <- lmList(extro ~ open + agree + social | class, data = lmm.data)
37 | schoolEff <- lmList(extro ~ open + agree + social | school, data = lmm.data)
38 |
39 |
40 |
41 | ```
42 |
43 | ## Non-nested Classes
44 |
45 | ```{r lmer2}
46 | MLexamp.7 <- lmer(extro ~ open + agree + social + (1|school) + (1|class), data=lmm.data)
47 | display(MLexamp.7)
48 | ```
49 |
50 | ## Nested group effects
51 |
52 | And finally, we can fit nested group effect terms through the following syntax:
53 |
54 | ```{r lmer3}
55 | MLexamp.8 <- lmer(extro ~ open + agree + social + (1|school/class), data=lmm.data)
56 | display(MLexamp.8)
57 |
58 |
59 | ```
60 |
61 | Here the `(1|school/class)` says that we want to fit a mixed effect term for varying
62 | intercepts `1|` by schools, and for classes that are nested within schools.
63 |
64 |
65 | ```{r}
66 | MLexamp2 <- update(MLexamp1, .~ . + (1|class)) # add a intercept for class
67 | MLexamp2 <- lmer(extro ~ open + agree + social + (1|class) + (1|school),
68 | data = lmm.data)
69 | exactRLRT(m = MLexamp1, mA=MLexamp2,
70 | m0 = )
71 | ```
72 |
73 | ## Non-correlated random effects
74 |
75 | ```{r lmer4}
76 | MLexampUnCor <- lmer(extro ~ open + agree + social + (1|school/class) + (0 + open|school/class),
77 | data = lmm.data)
78 | MLexampCor <- lmer(extro ~ open + agree + social + (1+open|school/class),
79 | data = lmm.data)
80 |
81 | VarCorr(MLexampUnCor)
82 | VarCorr(MLexampCor)
83 | ```
84 |
--------------------------------------------------------------------------------
/docs/Tutorial1-ExploringLMERobjects_files/bootstrap-3.3.5/css/bootstrap-theme.css:
--------------------------------------------------------------------------------
1 | /*!
2 | * Bootstrap v3.3.5 (http://getbootstrap.com)
3 | * Copyright 2011-2015 Twitter, Inc.
4 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
5 | */
6 | .btn-default,
7 | .btn-primary,
8 | .btn-success,
9 | .btn-info,
10 | .btn-warning,
11 | .btn-danger {
12 | text-shadow: 0 -1px 0 rgba(0, 0, 0, .2);
13 | -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15), 0 1px 1px rgba(0, 0, 0, .075);
14 | box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15), 0 1px 1px rgba(0, 0, 0, .075);
15 | }
16 | .btn-default:active,
17 | .btn-primary:active,
18 | .btn-success:active,
19 | .btn-info:active,
20 | .btn-warning:active,
21 | .btn-danger:active,
22 | .btn-default.active,
23 | .btn-primary.active,
24 | .btn-success.active,
25 | .btn-info.active,
26 | .btn-warning.active,
27 | .btn-danger.active {
28 | -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125);
29 | box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125);
30 | }
31 | .btn-default.disabled,
32 | .btn-primary.disabled,
33 | .btn-success.disabled,
34 | .btn-info.disabled,
35 | .btn-warning.disabled,
36 | .btn-danger.disabled,
37 | .btn-default[disabled],
38 | .btn-primary[disabled],
39 | .btn-success[disabled],
40 | .btn-info[disabled],
41 | .btn-warning[disabled],
42 | .btn-danger[disabled],
43 | fieldset[disabled] .btn-default,
44 | fieldset[disabled] .btn-primary,
45 | fieldset[disabled] .btn-success,
46 | fieldset[disabled] .btn-info,
47 | fieldset[disabled] .btn-warning,
48 | fieldset[disabled] .btn-danger {
49 | -webkit-box-shadow: none;
50 | box-shadow: none;
51 | }
52 | .btn-default .badge,
53 | .btn-primary .badge,
54 | .btn-success .badge,
55 | .btn-info .badge,
56 | .btn-warning .badge,
57 | .btn-danger .badge {
58 | text-shadow: none;
59 | }
60 | .btn:active,
61 | .btn.active {
62 | background-image: none;
63 | }
64 | .btn-default {
65 | text-shadow: 0 1px 0 #fff;
66 | background-image: -webkit-linear-gradient(top, #fff 0%, #e0e0e0 100%);
67 | background-image: -o-linear-gradient(top, #fff 0%, #e0e0e0 100%);
68 | background-image: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#e0e0e0));
69 | background-image: linear-gradient(to bottom, #fff 0%, #e0e0e0 100%);
70 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe0e0e0', GradientType=0);
71 | filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
72 | background-repeat: repeat-x;
73 | border-color: #dbdbdb;
74 | border-color: #ccc;
75 | }
76 | .btn-default:hover,
77 | .btn-default:focus {
78 | background-color: #e0e0e0;
79 | background-position: 0 -15px;
80 | }
81 | .btn-default:active,
82 | .btn-default.active {
83 | background-color: #e0e0e0;
84 | border-color: #dbdbdb;
85 | }
86 | .btn-default.disabled,
87 | .btn-default[disabled],
88 | fieldset[disabled] .btn-default,
89 | .btn-default.disabled:hover,
90 | .btn-default[disabled]:hover,
91 | fieldset[disabled] .btn-default:hover,
92 | .btn-default.disabled:focus,
93 | .btn-default[disabled]:focus,
94 | fieldset[disabled] .btn-default:focus,
95 | .btn-default.disabled.focus,
96 | .btn-default[disabled].focus,
97 | fieldset[disabled] .btn-default.focus,
98 | .btn-default.disabled:active,
99 | .btn-default[disabled]:active,
100 | fieldset[disabled] .btn-default:active,
101 | .btn-default.disabled.active,
102 | .btn-default[disabled].active,
103 | fieldset[disabled] .btn-default.active {
104 | background-color: #e0e0e0;
105 | background-image: none;
106 | }
107 | .btn-primary {
108 | background-image: -webkit-linear-gradient(top, #337ab7 0%, #265a88 100%);
109 | background-image: -o-linear-gradient(top, #337ab7 0%, #265a88 100%);
110 | background-image: -webkit-gradient(linear, left top, left bottom, from(#337ab7), to(#265a88));
111 | background-image: linear-gradient(to bottom, #337ab7 0%, #265a88 100%);
112 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff265a88', GradientType=0);
113 | filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
114 | background-repeat: repeat-x;
115 | border-color: #245580;
116 | }
117 | .btn-primary:hover,
118 | .btn-primary:focus {
119 | background-color: #265a88;
120 | background-position: 0 -15px;
121 | }
122 | .btn-primary:active,
123 | .btn-primary.active {
124 | background-color: #265a88;
125 | border-color: #245580;
126 | }
127 | .btn-primary.disabled,
128 | .btn-primary[disabled],
129 | fieldset[disabled] .btn-primary,
130 | .btn-primary.disabled:hover,
131 | .btn-primary[disabled]:hover,
132 | fieldset[disabled] .btn-primary:hover,
133 | .btn-primary.disabled:focus,
134 | .btn-primary[disabled]:focus,
135 | fieldset[disabled] .btn-primary:focus,
136 | .btn-primary.disabled.focus,
137 | .btn-primary[disabled].focus,
138 | fieldset[disabled] .btn-primary.focus,
139 | .btn-primary.disabled:active,
140 | .btn-primary[disabled]:active,
141 | fieldset[disabled] .btn-primary:active,
142 | .btn-primary.disabled.active,
143 | .btn-primary[disabled].active,
144 | fieldset[disabled] .btn-primary.active {
145 | background-color: #265a88;
146 | background-image: none;
147 | }
148 | .btn-success {
149 | background-image: -webkit-linear-gradient(top, #5cb85c 0%, #419641 100%);
150 | background-image: -o-linear-gradient(top, #5cb85c 0%, #419641 100%);
151 | background-image: -webkit-gradient(linear, left top, left bottom, from(#5cb85c), to(#419641));
152 | background-image: linear-gradient(to bottom, #5cb85c 0%, #419641 100%);
153 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c', endColorstr='#ff419641', GradientType=0);
154 | filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
155 | background-repeat: repeat-x;
156 | border-color: #3e8f3e;
157 | }
158 | .btn-success:hover,
159 | .btn-success:focus {
160 | background-color: #419641;
161 | background-position: 0 -15px;
162 | }
163 | .btn-success:active,
164 | .btn-success.active {
165 | background-color: #419641;
166 | border-color: #3e8f3e;
167 | }
168 | .btn-success.disabled,
169 | .btn-success[disabled],
170 | fieldset[disabled] .btn-success,
171 | .btn-success.disabled:hover,
172 | .btn-success[disabled]:hover,
173 | fieldset[disabled] .btn-success:hover,
174 | .btn-success.disabled:focus,
175 | .btn-success[disabled]:focus,
176 | fieldset[disabled] .btn-success:focus,
177 | .btn-success.disabled.focus,
178 | .btn-success[disabled].focus,
179 | fieldset[disabled] .btn-success.focus,
180 | .btn-success.disabled:active,
181 | .btn-success[disabled]:active,
182 | fieldset[disabled] .btn-success:active,
183 | .btn-success.disabled.active,
184 | .btn-success[disabled].active,
185 | fieldset[disabled] .btn-success.active {
186 | background-color: #419641;
187 | background-image: none;
188 | }
189 | .btn-info {
190 | background-image: -webkit-linear-gradient(top, #5bc0de 0%, #2aabd2 100%);
191 | background-image: -o-linear-gradient(top, #5bc0de 0%, #2aabd2 100%);
192 | background-image: -webkit-gradient(linear, left top, left bottom, from(#5bc0de), to(#2aabd2));
193 | background-image: linear-gradient(to bottom, #5bc0de 0%, #2aabd2 100%);
194 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff2aabd2', GradientType=0);
195 | filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
196 | background-repeat: repeat-x;
197 | border-color: #28a4c9;
198 | }
199 | .btn-info:hover,
200 | .btn-info:focus {
201 | background-color: #2aabd2;
202 | background-position: 0 -15px;
203 | }
204 | .btn-info:active,
205 | .btn-info.active {
206 | background-color: #2aabd2;
207 | border-color: #28a4c9;
208 | }
209 | .btn-info.disabled,
210 | .btn-info[disabled],
211 | fieldset[disabled] .btn-info,
212 | .btn-info.disabled:hover,
213 | .btn-info[disabled]:hover,
214 | fieldset[disabled] .btn-info:hover,
215 | .btn-info.disabled:focus,
216 | .btn-info[disabled]:focus,
217 | fieldset[disabled] .btn-info:focus,
218 | .btn-info.disabled.focus,
219 | .btn-info[disabled].focus,
220 | fieldset[disabled] .btn-info.focus,
221 | .btn-info.disabled:active,
222 | .btn-info[disabled]:active,
223 | fieldset[disabled] .btn-info:active,
224 | .btn-info.disabled.active,
225 | .btn-info[disabled].active,
226 | fieldset[disabled] .btn-info.active {
227 | background-color: #2aabd2;
228 | background-image: none;
229 | }
230 | .btn-warning {
231 | background-image: -webkit-linear-gradient(top, #f0ad4e 0%, #eb9316 100%);
232 | background-image: -o-linear-gradient(top, #f0ad4e 0%, #eb9316 100%);
233 | background-image: -webkit-gradient(linear, left top, left bottom, from(#f0ad4e), to(#eb9316));
234 | background-image: linear-gradient(to bottom, #f0ad4e 0%, #eb9316 100%);
235 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e', endColorstr='#ffeb9316', GradientType=0);
236 | filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
237 | background-repeat: repeat-x;
238 | border-color: #e38d13;
239 | }
240 | .btn-warning:hover,
241 | .btn-warning:focus {
242 | background-color: #eb9316;
243 | background-position: 0 -15px;
244 | }
245 | .btn-warning:active,
246 | .btn-warning.active {
247 | background-color: #eb9316;
248 | border-color: #e38d13;
249 | }
250 | .btn-warning.disabled,
251 | .btn-warning[disabled],
252 | fieldset[disabled] .btn-warning,
253 | .btn-warning.disabled:hover,
254 | .btn-warning[disabled]:hover,
255 | fieldset[disabled] .btn-warning:hover,
256 | .btn-warning.disabled:focus,
257 | .btn-warning[disabled]:focus,
258 | fieldset[disabled] .btn-warning:focus,
259 | .btn-warning.disabled.focus,
260 | .btn-warning[disabled].focus,
261 | fieldset[disabled] .btn-warning.focus,
262 | .btn-warning.disabled:active,
263 | .btn-warning[disabled]:active,
264 | fieldset[disabled] .btn-warning:active,
265 | .btn-warning.disabled.active,
266 | .btn-warning[disabled].active,
267 | fieldset[disabled] .btn-warning.active {
268 | background-color: #eb9316;
269 | background-image: none;
270 | }
271 | .btn-danger {
272 | background-image: -webkit-linear-gradient(top, #d9534f 0%, #c12e2a 100%);
273 | background-image: -o-linear-gradient(top, #d9534f 0%, #c12e2a 100%);
274 | background-image: -webkit-gradient(linear, left top, left bottom, from(#d9534f), to(#c12e2a));
275 | background-image: linear-gradient(to bottom, #d9534f 0%, #c12e2a 100%);
276 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9534f', endColorstr='#ffc12e2a', GradientType=0);
277 | filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
278 | background-repeat: repeat-x;
279 | border-color: #b92c28;
280 | }
281 | .btn-danger:hover,
282 | .btn-danger:focus {
283 | background-color: #c12e2a;
284 | background-position: 0 -15px;
285 | }
286 | .btn-danger:active,
287 | .btn-danger.active {
288 | background-color: #c12e2a;
289 | border-color: #b92c28;
290 | }
291 | .btn-danger.disabled,
292 | .btn-danger[disabled],
293 | fieldset[disabled] .btn-danger,
294 | .btn-danger.disabled:hover,
295 | .btn-danger[disabled]:hover,
296 | fieldset[disabled] .btn-danger:hover,
297 | .btn-danger.disabled:focus,
298 | .btn-danger[disabled]:focus,
299 | fieldset[disabled] .btn-danger:focus,
300 | .btn-danger.disabled.focus,
301 | .btn-danger[disabled].focus,
302 | fieldset[disabled] .btn-danger.focus,
303 | .btn-danger.disabled:active,
304 | .btn-danger[disabled]:active,
305 | fieldset[disabled] .btn-danger:active,
306 | .btn-danger.disabled.active,
307 | .btn-danger[disabled].active,
308 | fieldset[disabled] .btn-danger.active {
309 | background-color: #c12e2a;
310 | background-image: none;
311 | }
312 | .thumbnail,
313 | .img-thumbnail {
314 | -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, .075);
315 | box-shadow: 0 1px 2px rgba(0, 0, 0, .075);
316 | }
317 | .dropdown-menu > li > a:hover,
318 | .dropdown-menu > li > a:focus {
319 | background-color: #e8e8e8;
320 | background-image: -webkit-linear-gradient(top, #f5f5f5 0%, #e8e8e8 100%);
321 | background-image: -o-linear-gradient(top, #f5f5f5 0%, #e8e8e8 100%);
322 | background-image: -webkit-gradient(linear, left top, left bottom, from(#f5f5f5), to(#e8e8e8));
323 | background-image: linear-gradient(to bottom, #f5f5f5 0%, #e8e8e8 100%);
324 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#ffe8e8e8', GradientType=0);
325 | background-repeat: repeat-x;
326 | }
327 | .dropdown-menu > .active > a,
328 | .dropdown-menu > .active > a:hover,
329 | .dropdown-menu > .active > a:focus {
330 | background-color: #2e6da4;
331 | background-image: -webkit-linear-gradient(top, #337ab7 0%, #2e6da4 100%);
332 | background-image: -o-linear-gradient(top, #337ab7 0%, #2e6da4 100%);
333 | background-image: -webkit-gradient(linear, left top, left bottom, from(#337ab7), to(#2e6da4));
334 | background-image: linear-gradient(to bottom, #337ab7 0%, #2e6da4 100%);
335 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2e6da4', GradientType=0);
336 | background-repeat: repeat-x;
337 | }
338 | .navbar-default {
339 | background-image: -webkit-linear-gradient(top, #fff 0%, #f8f8f8 100%);
340 | background-image: -o-linear-gradient(top, #fff 0%, #f8f8f8 100%);
341 | background-image: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#f8f8f8));
342 | background-image: linear-gradient(to bottom, #fff 0%, #f8f8f8 100%);
343 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#fff8f8f8', GradientType=0);
344 | filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
345 | background-repeat: repeat-x;
346 | border-radius: 4px;
347 | -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15), 0 1px 5px rgba(0, 0, 0, .075);
348 | box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15), 0 1px 5px rgba(0, 0, 0, .075);
349 | }
350 | .navbar-default .navbar-nav > .open > a,
351 | .navbar-default .navbar-nav > .active > a {
352 | background-image: -webkit-linear-gradient(top, #dbdbdb 0%, #e2e2e2 100%);
353 | background-image: -o-linear-gradient(top, #dbdbdb 0%, #e2e2e2 100%);
354 | background-image: -webkit-gradient(linear, left top, left bottom, from(#dbdbdb), to(#e2e2e2));
355 | background-image: linear-gradient(to bottom, #dbdbdb 0%, #e2e2e2 100%);
356 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdbdbdb', endColorstr='#ffe2e2e2', GradientType=0);
357 | background-repeat: repeat-x;
358 | -webkit-box-shadow: inset 0 3px 9px rgba(0, 0, 0, .075);
359 | box-shadow: inset 0 3px 9px rgba(0, 0, 0, .075);
360 | }
361 | .navbar-brand,
362 | .navbar-nav > li > a {
363 | text-shadow: 0 1px 0 rgba(255, 255, 255, .25);
364 | }
365 | .navbar-inverse {
366 | background-image: -webkit-linear-gradient(top, #3c3c3c 0%, #222 100%);
367 | background-image: -o-linear-gradient(top, #3c3c3c 0%, #222 100%);
368 | background-image: -webkit-gradient(linear, left top, left bottom, from(#3c3c3c), to(#222));
369 | background-image: linear-gradient(to bottom, #3c3c3c 0%, #222 100%);
370 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff3c3c3c', endColorstr='#ff222222', GradientType=0);
371 | filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
372 | background-repeat: repeat-x;
373 | border-radius: 4px;
374 | }
375 | .navbar-inverse .navbar-nav > .open > a,
376 | .navbar-inverse .navbar-nav > .active > a {
377 | background-image: -webkit-linear-gradient(top, #080808 0%, #0f0f0f 100%);
378 | background-image: -o-linear-gradient(top, #080808 0%, #0f0f0f 100%);
379 | background-image: -webkit-gradient(linear, left top, left bottom, from(#080808), to(#0f0f0f));
380 | background-image: linear-gradient(to bottom, #080808 0%, #0f0f0f 100%);
381 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff080808', endColorstr='#ff0f0f0f', GradientType=0);
382 | background-repeat: repeat-x;
383 | -webkit-box-shadow: inset 0 3px 9px rgba(0, 0, 0, .25);
384 | box-shadow: inset 0 3px 9px rgba(0, 0, 0, .25);
385 | }
386 | .navbar-inverse .navbar-brand,
387 | .navbar-inverse .navbar-nav > li > a {
388 | text-shadow: 0 -1px 0 rgba(0, 0, 0, .25);
389 | }
390 | .navbar-static-top,
391 | .navbar-fixed-top,
392 | .navbar-fixed-bottom {
393 | border-radius: 0;
394 | }
395 | @media (max-width: 767px) {
396 | .navbar .navbar-nav .open .dropdown-menu > .active > a,
397 | .navbar .navbar-nav .open .dropdown-menu > .active > a:hover,
398 | .navbar .navbar-nav .open .dropdown-menu > .active > a:focus {
399 | color: #fff;
400 | background-image: -webkit-linear-gradient(top, #337ab7 0%, #2e6da4 100%);
401 | background-image: -o-linear-gradient(top, #337ab7 0%, #2e6da4 100%);
402 | background-image: -webkit-gradient(linear, left top, left bottom, from(#337ab7), to(#2e6da4));
403 | background-image: linear-gradient(to bottom, #337ab7 0%, #2e6da4 100%);
404 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2e6da4', GradientType=0);
405 | background-repeat: repeat-x;
406 | }
407 | }
408 | .alert {
409 | text-shadow: 0 1px 0 rgba(255, 255, 255, .2);
410 | -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 1px 2px rgba(0, 0, 0, .05);
411 | box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 1px 2px rgba(0, 0, 0, .05);
412 | }
413 | .alert-success {
414 | background-image: -webkit-linear-gradient(top, #dff0d8 0%, #c8e5bc 100%);
415 | background-image: -o-linear-gradient(top, #dff0d8 0%, #c8e5bc 100%);
416 | background-image: -webkit-gradient(linear, left top, left bottom, from(#dff0d8), to(#c8e5bc));
417 | background-image: linear-gradient(to bottom, #dff0d8 0%, #c8e5bc 100%);
418 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdff0d8', endColorstr='#ffc8e5bc', GradientType=0);
419 | background-repeat: repeat-x;
420 | border-color: #b2dba1;
421 | }
422 | .alert-info {
423 | background-image: -webkit-linear-gradient(top, #d9edf7 0%, #b9def0 100%);
424 | background-image: -o-linear-gradient(top, #d9edf7 0%, #b9def0 100%);
425 | background-image: -webkit-gradient(linear, left top, left bottom, from(#d9edf7), to(#b9def0));
426 | background-image: linear-gradient(to bottom, #d9edf7 0%, #b9def0 100%);
427 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7', endColorstr='#ffb9def0', GradientType=0);
428 | background-repeat: repeat-x;
429 | border-color: #9acfea;
430 | }
431 | .alert-warning {
432 | background-image: -webkit-linear-gradient(top, #fcf8e3 0%, #f8efc0 100%);
433 | background-image: -o-linear-gradient(top, #fcf8e3 0%, #f8efc0 100%);
434 | background-image: -webkit-gradient(linear, left top, left bottom, from(#fcf8e3), to(#f8efc0));
435 | background-image: linear-gradient(to bottom, #fcf8e3 0%, #f8efc0 100%);
436 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffcf8e3', endColorstr='#fff8efc0', GradientType=0);
437 | background-repeat: repeat-x;
438 | border-color: #f5e79e;
439 | }
440 | .alert-danger {
441 | background-image: -webkit-linear-gradient(top, #f2dede 0%, #e7c3c3 100%);
442 | background-image: -o-linear-gradient(top, #f2dede 0%, #e7c3c3 100%);
443 | background-image: -webkit-gradient(linear, left top, left bottom, from(#f2dede), to(#e7c3c3));
444 | background-image: linear-gradient(to bottom, #f2dede 0%, #e7c3c3 100%);
445 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede', endColorstr='#ffe7c3c3', GradientType=0);
446 | background-repeat: repeat-x;
447 | border-color: #dca7a7;
448 | }
449 | .progress {
450 | background-image: -webkit-linear-gradient(top, #ebebeb 0%, #f5f5f5 100%);
451 | background-image: -o-linear-gradient(top, #ebebeb 0%, #f5f5f5 100%);
452 | background-image: -webkit-gradient(linear, left top, left bottom, from(#ebebeb), to(#f5f5f5));
453 | background-image: linear-gradient(to bottom, #ebebeb 0%, #f5f5f5 100%);
454 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffebebeb', endColorstr='#fff5f5f5', GradientType=0);
455 | background-repeat: repeat-x;
456 | }
457 | .progress-bar {
458 | background-image: -webkit-linear-gradient(top, #337ab7 0%, #286090 100%);
459 | background-image: -o-linear-gradient(top, #337ab7 0%, #286090 100%);
460 | background-image: -webkit-gradient(linear, left top, left bottom, from(#337ab7), to(#286090));
461 | background-image: linear-gradient(to bottom, #337ab7 0%, #286090 100%);
462 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff286090', GradientType=0);
463 | background-repeat: repeat-x;
464 | }
465 | .progress-bar-success {
466 | background-image: -webkit-linear-gradient(top, #5cb85c 0%, #449d44 100%);
467 | background-image: -o-linear-gradient(top, #5cb85c 0%, #449d44 100%);
468 | background-image: -webkit-gradient(linear, left top, left bottom, from(#5cb85c), to(#449d44));
469 | background-image: linear-gradient(to bottom, #5cb85c 0%, #449d44 100%);
470 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c', endColorstr='#ff449d44', GradientType=0);
471 | background-repeat: repeat-x;
472 | }
473 | .progress-bar-info {
474 | background-image: -webkit-linear-gradient(top, #5bc0de 0%, #31b0d5 100%);
475 | background-image: -o-linear-gradient(top, #5bc0de 0%, #31b0d5 100%);
476 | background-image: -webkit-gradient(linear, left top, left bottom, from(#5bc0de), to(#31b0d5));
477 | background-image: linear-gradient(to bottom, #5bc0de 0%, #31b0d5 100%);
478 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff31b0d5', GradientType=0);
479 | background-repeat: repeat-x;
480 | }
481 | .progress-bar-warning {
482 | background-image: -webkit-linear-gradient(top, #f0ad4e 0%, #ec971f 100%);
483 | background-image: -o-linear-gradient(top, #f0ad4e 0%, #ec971f 100%);
484 | background-image: -webkit-gradient(linear, left top, left bottom, from(#f0ad4e), to(#ec971f));
485 | background-image: linear-gradient(to bottom, #f0ad4e 0%, #ec971f 100%);
486 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e', endColorstr='#ffec971f', GradientType=0);
487 | background-repeat: repeat-x;
488 | }
489 | .progress-bar-danger {
490 | background-image: -webkit-linear-gradient(top, #d9534f 0%, #c9302c 100%);
491 | background-image: -o-linear-gradient(top, #d9534f 0%, #c9302c 100%);
492 | background-image: -webkit-gradient(linear, left top, left bottom, from(#d9534f), to(#c9302c));
493 | background-image: linear-gradient(to bottom, #d9534f 0%, #c9302c 100%);
494 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9534f', endColorstr='#ffc9302c', GradientType=0);
495 | background-repeat: repeat-x;
496 | }
497 | .progress-bar-striped {
498 | background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
499 | background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
500 | background-image: linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
501 | }
502 | .list-group {
503 | border-radius: 4px;
504 | -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, .075);
505 | box-shadow: 0 1px 2px rgba(0, 0, 0, .075);
506 | }
507 | .list-group-item.active,
508 | .list-group-item.active:hover,
509 | .list-group-item.active:focus {
510 | text-shadow: 0 -1px 0 #286090;
511 | background-image: -webkit-linear-gradient(top, #337ab7 0%, #2b669a 100%);
512 | background-image: -o-linear-gradient(top, #337ab7 0%, #2b669a 100%);
513 | background-image: -webkit-gradient(linear, left top, left bottom, from(#337ab7), to(#2b669a));
514 | background-image: linear-gradient(to bottom, #337ab7 0%, #2b669a 100%);
515 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2b669a', GradientType=0);
516 | background-repeat: repeat-x;
517 | border-color: #2b669a;
518 | }
519 | .list-group-item.active .badge,
520 | .list-group-item.active:hover .badge,
521 | .list-group-item.active:focus .badge {
522 | text-shadow: none;
523 | }
524 | .panel {
525 | -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
526 | box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
527 | }
528 | .panel-default > .panel-heading {
529 | background-image: -webkit-linear-gradient(top, #f5f5f5 0%, #e8e8e8 100%);
530 | background-image: -o-linear-gradient(top, #f5f5f5 0%, #e8e8e8 100%);
531 | background-image: -webkit-gradient(linear, left top, left bottom, from(#f5f5f5), to(#e8e8e8));
532 | background-image: linear-gradient(to bottom, #f5f5f5 0%, #e8e8e8 100%);
533 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#ffe8e8e8', GradientType=0);
534 | background-repeat: repeat-x;
535 | }
536 | .panel-primary > .panel-heading {
537 | background-image: -webkit-linear-gradient(top, #337ab7 0%, #2e6da4 100%);
538 | background-image: -o-linear-gradient(top, #337ab7 0%, #2e6da4 100%);
539 | background-image: -webkit-gradient(linear, left top, left bottom, from(#337ab7), to(#2e6da4));
540 | background-image: linear-gradient(to bottom, #337ab7 0%, #2e6da4 100%);
541 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2e6da4', GradientType=0);
542 | background-repeat: repeat-x;
543 | }
544 | .panel-success > .panel-heading {
545 | background-image: -webkit-linear-gradient(top, #dff0d8 0%, #d0e9c6 100%);
546 | background-image: -o-linear-gradient(top, #dff0d8 0%, #d0e9c6 100%);
547 | background-image: -webkit-gradient(linear, left top, left bottom, from(#dff0d8), to(#d0e9c6));
548 | background-image: linear-gradient(to bottom, #dff0d8 0%, #d0e9c6 100%);
549 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdff0d8', endColorstr='#ffd0e9c6', GradientType=0);
550 | background-repeat: repeat-x;
551 | }
552 | .panel-info > .panel-heading {
553 | background-image: -webkit-linear-gradient(top, #d9edf7 0%, #c4e3f3 100%);
554 | background-image: -o-linear-gradient(top, #d9edf7 0%, #c4e3f3 100%);
555 | background-image: -webkit-gradient(linear, left top, left bottom, from(#d9edf7), to(#c4e3f3));
556 | background-image: linear-gradient(to bottom, #d9edf7 0%, #c4e3f3 100%);
557 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7', endColorstr='#ffc4e3f3', GradientType=0);
558 | background-repeat: repeat-x;
559 | }
560 | .panel-warning > .panel-heading {
561 | background-image: -webkit-linear-gradient(top, #fcf8e3 0%, #faf2cc 100%);
562 | background-image: -o-linear-gradient(top, #fcf8e3 0%, #faf2cc 100%);
563 | background-image: -webkit-gradient(linear, left top, left bottom, from(#fcf8e3), to(#faf2cc));
564 | background-image: linear-gradient(to bottom, #fcf8e3 0%, #faf2cc 100%);
565 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffcf8e3', endColorstr='#fffaf2cc', GradientType=0);
566 | background-repeat: repeat-x;
567 | }
568 | .panel-danger > .panel-heading {
569 | background-image: -webkit-linear-gradient(top, #f2dede 0%, #ebcccc 100%);
570 | background-image: -o-linear-gradient(top, #f2dede 0%, #ebcccc 100%);
571 | background-image: -webkit-gradient(linear, left top, left bottom, from(#f2dede), to(#ebcccc));
572 | background-image: linear-gradient(to bottom, #f2dede 0%, #ebcccc 100%);
573 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede', endColorstr='#ffebcccc', GradientType=0);
574 | background-repeat: repeat-x;
575 | }
576 | .well {
577 | background-image: -webkit-linear-gradient(top, #e8e8e8 0%, #f5f5f5 100%);
578 | background-image: -o-linear-gradient(top, #e8e8e8 0%, #f5f5f5 100%);
579 | background-image: -webkit-gradient(linear, left top, left bottom, from(#e8e8e8), to(#f5f5f5));
580 | background-image: linear-gradient(to bottom, #e8e8e8 0%, #f5f5f5 100%);
581 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe8e8e8', endColorstr='#fff5f5f5', GradientType=0);
582 | background-repeat: repeat-x;
583 | border-color: #dcdcdc;
584 | -webkit-box-shadow: inset 0 1px 3px rgba(0, 0, 0, .05), 0 1px 0 rgba(255, 255, 255, .1);
585 | box-shadow: inset 0 1px 3px rgba(0, 0, 0, .05), 0 1px 0 rgba(255, 255, 255, .1);
586 | }
587 | /*# sourceMappingURL=bootstrap-theme.css.map */
588 |
--------------------------------------------------------------------------------
/docs/Tutorial1-ExploringLMERobjects_files/bootstrap-3.3.5/css/bootstrap-theme.min.css:
--------------------------------------------------------------------------------
1 | /*!
2 | * Bootstrap v3.3.5 (http://getbootstrap.com)
3 | * Copyright 2011-2015 Twitter, Inc.
4 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
5 | */.btn-danger,.btn-default,.btn-info,.btn-primary,.btn-success,.btn-warning{text-shadow:0 -1px 0 rgba(0,0,0,.2);-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.15),0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 0 rgba(255,255,255,.15),0 1px 1px rgba(0,0,0,.075)}.btn-danger.active,.btn-danger:active,.btn-default.active,.btn-default:active,.btn-info.active,.btn-info:active,.btn-primary.active,.btn-primary:active,.btn-success.active,.btn-success:active,.btn-warning.active,.btn-warning:active{-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn-danger.disabled,.btn-danger[disabled],.btn-default.disabled,.btn-default[disabled],.btn-info.disabled,.btn-info[disabled],.btn-primary.disabled,.btn-primary[disabled],.btn-success.disabled,.btn-success[disabled],.btn-warning.disabled,.btn-warning[disabled],fieldset[disabled] .btn-danger,fieldset[disabled] .btn-default,fieldset[disabled] .btn-info,fieldset[disabled] .btn-primary,fieldset[disabled] .btn-success,fieldset[disabled] .btn-warning{-webkit-box-shadow:none;box-shadow:none}.btn-danger .badge,.btn-default .badge,.btn-info .badge,.btn-primary .badge,.btn-success .badge,.btn-warning .badge{text-shadow:none}.btn.active,.btn:active{background-image:none}.btn-default{text-shadow:0 1px 0 #fff;background-image:-webkit-linear-gradient(top,#fff 0,#e0e0e0 100%);background-image:-o-linear-gradient(top,#fff 0,#e0e0e0 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#fff),to(#e0e0e0));background-image:linear-gradient(to bottom,#fff 0,#e0e0e0 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe0e0e0', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x;border-color:#dbdbdb;border-color:#ccc}.btn-default:focus,.btn-default:hover{background-color:#e0e0e0;background-position:0 -15px}.btn-default.active,.btn-default:active{background-color:#e0e0e0;border-color:#dbdbdb}.btn-default.disabled,.btn-default.disabled.active,.btn-default.disabled.focus,.btn-default.disabled:active,.btn-default.disabled:focus,.btn-default.disabled:hover,.btn-default[disabled],.btn-default[disabled].active,.btn-default[disabled].focus,.btn-default[disabled]:active,.btn-default[disabled]:focus,.btn-default[disabled]:hover,fieldset[disabled] .btn-default,fieldset[disabled] .btn-default.active,fieldset[disabled] .btn-default.focus,fieldset[disabled] .btn-default:active,fieldset[disabled] .btn-default:focus,fieldset[disabled] .btn-default:hover{background-color:#e0e0e0;background-image:none}.btn-primary{background-image:-webkit-linear-gradient(top,#337ab7 0,#265a88 100%);background-image:-o-linear-gradient(top,#337ab7 0,#265a88 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#337ab7),to(#265a88));background-image:linear-gradient(to bottom,#337ab7 0,#265a88 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff265a88', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x;border-color:#245580}.btn-primary:focus,.btn-primary:hover{background-color:#265a88;background-position:0 -15px}.btn-primary.active,.btn-primary:active{background-color:#265a88;border-color:#245580}.btn-primary.disabled,.btn-primary.disabled.active,.btn-primary.disabled.focus,.btn-primary.disabled:active,.btn-primary.disabled:focus,.btn-primary.disabled:hover,.btn-primary[disabled],.btn-primary[disabled].active,.btn-primary[disabled].focus,.btn-primary[disabled]:active,.btn-primary[disabled]:focus,.btn-primary[disabled]:hover,fieldset[disabled] .btn-primary,fieldset[disabled] .btn-primary.active,fieldset[disabled] .btn-primary.focus,fieldset[disabled] .btn-primary:active,fieldset[disabled] .btn-primary:focus,fieldset[disabled] .btn-primary:hover{background-color:#265a88;background-image:none}.btn-success{background-image:-webkit-linear-gradient(top,#5cb85c 0,#419641 100%);background-image:-o-linear-gradient(top,#5cb85c 0,#419641 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#5cb85c),to(#419641));background-image:linear-gradient(to bottom,#5cb85c 0,#419641 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c', endColorstr='#ff419641', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x;border-color:#3e8f3e}.btn-success:focus,.btn-success:hover{background-color:#419641;background-position:0 -15px}.btn-success.active,.btn-success:active{background-color:#419641;border-color:#3e8f3e}.btn-success.disabled,.btn-success.disabled.active,.btn-success.disabled.focus,.btn-success.disabled:active,.btn-success.disabled:focus,.btn-success.disabled:hover,.btn-success[disabled],.btn-success[disabled].active,.btn-success[disabled].focus,.btn-success[disabled]:active,.btn-success[disabled]:focus,.btn-success[disabled]:hover,fieldset[disabled] .btn-success,fieldset[disabled] .btn-success.active,fieldset[disabled] .btn-success.focus,fieldset[disabled] .btn-success:active,fieldset[disabled] .btn-success:focus,fieldset[disabled] .btn-success:hover{background-color:#419641;background-image:none}.btn-info{background-image:-webkit-linear-gradient(top,#5bc0de 0,#2aabd2 100%);background-image:-o-linear-gradient(top,#5bc0de 0,#2aabd2 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#5bc0de),to(#2aabd2));background-image:linear-gradient(to bottom,#5bc0de 0,#2aabd2 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff2aabd2', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x;border-color:#28a4c9}.btn-info:focus,.btn-info:hover{background-color:#2aabd2;background-position:0 -15px}.btn-info.active,.btn-info:active{background-color:#2aabd2;border-color:#28a4c9}.btn-info.disabled,.btn-info.disabled.active,.btn-info.disabled.focus,.btn-info.disabled:active,.btn-info.disabled:focus,.btn-info.disabled:hover,.btn-info[disabled],.btn-info[disabled].active,.btn-info[disabled].focus,.btn-info[disabled]:active,.btn-info[disabled]:focus,.btn-info[disabled]:hover,fieldset[disabled] .btn-info,fieldset[disabled] .btn-info.active,fieldset[disabled] .btn-info.focus,fieldset[disabled] .btn-info:active,fieldset[disabled] .btn-info:focus,fieldset[disabled] .btn-info:hover{background-color:#2aabd2;background-image:none}.btn-warning{background-image:-webkit-linear-gradient(top,#f0ad4e 0,#eb9316 100%);background-image:-o-linear-gradient(top,#f0ad4e 0,#eb9316 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#f0ad4e),to(#eb9316));background-image:linear-gradient(to bottom,#f0ad4e 0,#eb9316 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e', endColorstr='#ffeb9316', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x;border-color:#e38d13}.btn-warning:focus,.btn-warning:hover{background-color:#eb9316;background-position:0 -15px}.btn-warning.active,.btn-warning:active{background-color:#eb9316;border-color:#e38d13}.btn-warning.disabled,.btn-warning.disabled.active,.btn-warning.disabled.focus,.btn-warning.disabled:active,.btn-warning.disabled:focus,.btn-warning.disabled:hover,.btn-warning[disabled],.btn-warning[disabled].active,.btn-warning[disabled].focus,.btn-warning[disabled]:active,.btn-warning[disabled]:focus,.btn-warning[disabled]:hover,fieldset[disabled] .btn-warning,fieldset[disabled] .btn-warning.active,fieldset[disabled] .btn-warning.focus,fieldset[disabled] .btn-warning:active,fieldset[disabled] .btn-warning:focus,fieldset[disabled] .btn-warning:hover{background-color:#eb9316;background-image:none}.btn-danger{background-image:-webkit-linear-gradient(top,#d9534f 0,#c12e2a 100%);background-image:-o-linear-gradient(top,#d9534f 0,#c12e2a 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#d9534f),to(#c12e2a));background-image:linear-gradient(to bottom,#d9534f 0,#c12e2a 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9534f', endColorstr='#ffc12e2a', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x;border-color:#b92c28}.btn-danger:focus,.btn-danger:hover{background-color:#c12e2a;background-position:0 -15px}.btn-danger.active,.btn-danger:active{background-color:#c12e2a;border-color:#b92c28}.btn-danger.disabled,.btn-danger.disabled.active,.btn-danger.disabled.focus,.btn-danger.disabled:active,.btn-danger.disabled:focus,.btn-danger.disabled:hover,.btn-danger[disabled],.btn-danger[disabled].active,.btn-danger[disabled].focus,.btn-danger[disabled]:active,.btn-danger[disabled]:focus,.btn-danger[disabled]:hover,fieldset[disabled] .btn-danger,fieldset[disabled] .btn-danger.active,fieldset[disabled] .btn-danger.focus,fieldset[disabled] .btn-danger:active,fieldset[disabled] .btn-danger:focus,fieldset[disabled] .btn-danger:hover{background-color:#c12e2a;background-image:none}.img-thumbnail,.thumbnail{-webkit-box-shadow:0 1px 2px rgba(0,0,0,.075);box-shadow:0 1px 2px rgba(0,0,0,.075)}.dropdown-menu>li>a:focus,.dropdown-menu>li>a:hover{background-color:#e8e8e8;background-image:-webkit-linear-gradient(top,#f5f5f5 0,#e8e8e8 100%);background-image:-o-linear-gradient(top,#f5f5f5 0,#e8e8e8 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#f5f5f5),to(#e8e8e8));background-image:linear-gradient(to bottom,#f5f5f5 0,#e8e8e8 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#ffe8e8e8', GradientType=0);background-repeat:repeat-x}.dropdown-menu>.active>a,.dropdown-menu>.active>a:focus,.dropdown-menu>.active>a:hover{background-color:#2e6da4;background-image:-webkit-linear-gradient(top,#337ab7 0,#2e6da4 100%);background-image:-o-linear-gradient(top,#337ab7 0,#2e6da4 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#337ab7),to(#2e6da4));background-image:linear-gradient(to bottom,#337ab7 0,#2e6da4 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2e6da4', GradientType=0);background-repeat:repeat-x}.navbar-default{background-image:-webkit-linear-gradient(top,#fff 0,#f8f8f8 100%);background-image:-o-linear-gradient(top,#fff 0,#f8f8f8 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#fff),to(#f8f8f8));background-image:linear-gradient(to bottom,#fff 0,#f8f8f8 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#fff8f8f8', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x;border-radius:4px;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.15),0 1px 5px rgba(0,0,0,.075);box-shadow:inset 0 1px 0 rgba(255,255,255,.15),0 1px 5px rgba(0,0,0,.075)}.navbar-default .navbar-nav>.active>a,.navbar-default .navbar-nav>.open>a{background-image:-webkit-linear-gradient(top,#dbdbdb 0,#e2e2e2 100%);background-image:-o-linear-gradient(top,#dbdbdb 0,#e2e2e2 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#dbdbdb),to(#e2e2e2));background-image:linear-gradient(to bottom,#dbdbdb 0,#e2e2e2 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdbdbdb', endColorstr='#ffe2e2e2', GradientType=0);background-repeat:repeat-x;-webkit-box-shadow:inset 0 3px 9px rgba(0,0,0,.075);box-shadow:inset 0 3px 9px rgba(0,0,0,.075)}.navbar-brand,.navbar-nav>li>a{text-shadow:0 1px 0 rgba(255,255,255,.25)}.navbar-inverse{background-image:-webkit-linear-gradient(top,#3c3c3c 0,#222 100%);background-image:-o-linear-gradient(top,#3c3c3c 0,#222 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#3c3c3c),to(#222));background-image:linear-gradient(to bottom,#3c3c3c 0,#222 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff3c3c3c', endColorstr='#ff222222', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x;border-radius:4px}.navbar-inverse .navbar-nav>.active>a,.navbar-inverse .navbar-nav>.open>a{background-image:-webkit-linear-gradient(top,#080808 0,#0f0f0f 100%);background-image:-o-linear-gradient(top,#080808 0,#0f0f0f 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#080808),to(#0f0f0f));background-image:linear-gradient(to bottom,#080808 0,#0f0f0f 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff080808', endColorstr='#ff0f0f0f', GradientType=0);background-repeat:repeat-x;-webkit-box-shadow:inset 0 3px 9px rgba(0,0,0,.25);box-shadow:inset 0 3px 9px rgba(0,0,0,.25)}.navbar-inverse .navbar-brand,.navbar-inverse .navbar-nav>li>a{text-shadow:0 -1px 0 rgba(0,0,0,.25)}.navbar-fixed-bottom,.navbar-fixed-top,.navbar-static-top{border-radius:0}@media (max-width:767px){.navbar .navbar-nav .open .dropdown-menu>.active>a,.navbar .navbar-nav .open .dropdown-menu>.active>a:focus,.navbar .navbar-nav .open .dropdown-menu>.active>a:hover{color:#fff;background-image:-webkit-linear-gradient(top,#337ab7 0,#2e6da4 100%);background-image:-o-linear-gradient(top,#337ab7 0,#2e6da4 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#337ab7),to(#2e6da4));background-image:linear-gradient(to bottom,#337ab7 0,#2e6da4 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2e6da4', GradientType=0);background-repeat:repeat-x}}.alert{text-shadow:0 1px 0 rgba(255,255,255,.2);-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 1px 2px rgba(0,0,0,.05);box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 1px 2px rgba(0,0,0,.05)}.alert-success{background-image:-webkit-linear-gradient(top,#dff0d8 0,#c8e5bc 100%);background-image:-o-linear-gradient(top,#dff0d8 0,#c8e5bc 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#dff0d8),to(#c8e5bc));background-image:linear-gradient(to bottom,#dff0d8 0,#c8e5bc 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdff0d8', endColorstr='#ffc8e5bc', GradientType=0);background-repeat:repeat-x;border-color:#b2dba1}.alert-info{background-image:-webkit-linear-gradient(top,#d9edf7 0,#b9def0 100%);background-image:-o-linear-gradient(top,#d9edf7 0,#b9def0 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#d9edf7),to(#b9def0));background-image:linear-gradient(to bottom,#d9edf7 0,#b9def0 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7', endColorstr='#ffb9def0', GradientType=0);background-repeat:repeat-x;border-color:#9acfea}.alert-warning{background-image:-webkit-linear-gradient(top,#fcf8e3 0,#f8efc0 100%);background-image:-o-linear-gradient(top,#fcf8e3 0,#f8efc0 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#fcf8e3),to(#f8efc0));background-image:linear-gradient(to bottom,#fcf8e3 0,#f8efc0 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffcf8e3', endColorstr='#fff8efc0', GradientType=0);background-repeat:repeat-x;border-color:#f5e79e}.alert-danger{background-image:-webkit-linear-gradient(top,#f2dede 0,#e7c3c3 100%);background-image:-o-linear-gradient(top,#f2dede 0,#e7c3c3 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#f2dede),to(#e7c3c3));background-image:linear-gradient(to bottom,#f2dede 0,#e7c3c3 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede', endColorstr='#ffe7c3c3', GradientType=0);background-repeat:repeat-x;border-color:#dca7a7}.progress{background-image:-webkit-linear-gradient(top,#ebebeb 0,#f5f5f5 100%);background-image:-o-linear-gradient(top,#ebebeb 0,#f5f5f5 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#ebebeb),to(#f5f5f5));background-image:linear-gradient(to bottom,#ebebeb 0,#f5f5f5 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffebebeb', endColorstr='#fff5f5f5', GradientType=0);background-repeat:repeat-x}.progress-bar{background-image:-webkit-linear-gradient(top,#337ab7 0,#286090 100%);background-image:-o-linear-gradient(top,#337ab7 0,#286090 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#337ab7),to(#286090));background-image:linear-gradient(to bottom,#337ab7 0,#286090 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff286090', GradientType=0);background-repeat:repeat-x}.progress-bar-success{background-image:-webkit-linear-gradient(top,#5cb85c 0,#449d44 100%);background-image:-o-linear-gradient(top,#5cb85c 0,#449d44 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#5cb85c),to(#449d44));background-image:linear-gradient(to bottom,#5cb85c 0,#449d44 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c', endColorstr='#ff449d44', GradientType=0);background-repeat:repeat-x}.progress-bar-info{background-image:-webkit-linear-gradient(top,#5bc0de 0,#31b0d5 100%);background-image:-o-linear-gradient(top,#5bc0de 0,#31b0d5 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#5bc0de),to(#31b0d5));background-image:linear-gradient(to bottom,#5bc0de 0,#31b0d5 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff31b0d5', GradientType=0);background-repeat:repeat-x}.progress-bar-warning{background-image:-webkit-linear-gradient(top,#f0ad4e 0,#ec971f 100%);background-image:-o-linear-gradient(top,#f0ad4e 0,#ec971f 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#f0ad4e),to(#ec971f));background-image:linear-gradient(to bottom,#f0ad4e 0,#ec971f 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e', endColorstr='#ffec971f', GradientType=0);background-repeat:repeat-x}.progress-bar-danger{background-image:-webkit-linear-gradient(top,#d9534f 0,#c9302c 100%);background-image:-o-linear-gradient(top,#d9534f 0,#c9302c 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#d9534f),to(#c9302c));background-image:linear-gradient(to bottom,#d9534f 0,#c9302c 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9534f', endColorstr='#ffc9302c', GradientType=0);background-repeat:repeat-x}.progress-bar-striped{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.list-group{border-radius:4px;-webkit-box-shadow:0 1px 2px rgba(0,0,0,.075);box-shadow:0 1px 2px rgba(0,0,0,.075)}.list-group-item.active,.list-group-item.active:focus,.list-group-item.active:hover{text-shadow:0 -1px 0 #286090;background-image:-webkit-linear-gradient(top,#337ab7 0,#2b669a 100%);background-image:-o-linear-gradient(top,#337ab7 0,#2b669a 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#337ab7),to(#2b669a));background-image:linear-gradient(to bottom,#337ab7 0,#2b669a 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2b669a', GradientType=0);background-repeat:repeat-x;border-color:#2b669a}.list-group-item.active .badge,.list-group-item.active:focus .badge,.list-group-item.active:hover .badge{text-shadow:none}.panel{-webkit-box-shadow:0 1px 2px rgba(0,0,0,.05);box-shadow:0 1px 2px rgba(0,0,0,.05)}.panel-default>.panel-heading{background-image:-webkit-linear-gradient(top,#f5f5f5 0,#e8e8e8 100%);background-image:-o-linear-gradient(top,#f5f5f5 0,#e8e8e8 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#f5f5f5),to(#e8e8e8));background-image:linear-gradient(to bottom,#f5f5f5 0,#e8e8e8 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#ffe8e8e8', GradientType=0);background-repeat:repeat-x}.panel-primary>.panel-heading{background-image:-webkit-linear-gradient(top,#337ab7 0,#2e6da4 100%);background-image:-o-linear-gradient(top,#337ab7 0,#2e6da4 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#337ab7),to(#2e6da4));background-image:linear-gradient(to bottom,#337ab7 0,#2e6da4 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2e6da4', GradientType=0);background-repeat:repeat-x}.panel-success>.panel-heading{background-image:-webkit-linear-gradient(top,#dff0d8 0,#d0e9c6 100%);background-image:-o-linear-gradient(top,#dff0d8 0,#d0e9c6 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#dff0d8),to(#d0e9c6));background-image:linear-gradient(to bottom,#dff0d8 0,#d0e9c6 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdff0d8', endColorstr='#ffd0e9c6', GradientType=0);background-repeat:repeat-x}.panel-info>.panel-heading{background-image:-webkit-linear-gradient(top,#d9edf7 0,#c4e3f3 100%);background-image:-o-linear-gradient(top,#d9edf7 0,#c4e3f3 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#d9edf7),to(#c4e3f3));background-image:linear-gradient(to bottom,#d9edf7 0,#c4e3f3 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7', endColorstr='#ffc4e3f3', GradientType=0);background-repeat:repeat-x}.panel-warning>.panel-heading{background-image:-webkit-linear-gradient(top,#fcf8e3 0,#faf2cc 100%);background-image:-o-linear-gradient(top,#fcf8e3 0,#faf2cc 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#fcf8e3),to(#faf2cc));background-image:linear-gradient(to bottom,#fcf8e3 0,#faf2cc 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffcf8e3', endColorstr='#fffaf2cc', GradientType=0);background-repeat:repeat-x}.panel-danger>.panel-heading{background-image:-webkit-linear-gradient(top,#f2dede 0,#ebcccc 100%);background-image:-o-linear-gradient(top,#f2dede 0,#ebcccc 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#f2dede),to(#ebcccc));background-image:linear-gradient(to bottom,#f2dede 0,#ebcccc 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede', endColorstr='#ffebcccc', GradientType=0);background-repeat:repeat-x}.well{background-image:-webkit-linear-gradient(top,#e8e8e8 0,#f5f5f5 100%);background-image:-o-linear-gradient(top,#e8e8e8 0,#f5f5f5 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#e8e8e8),to(#f5f5f5));background-image:linear-gradient(to bottom,#e8e8e8 0,#f5f5f5 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe8e8e8', endColorstr='#fff5f5f5', GradientType=0);background-repeat:repeat-x;border-color:#dcdcdc;-webkit-box-shadow:inset 0 1px 3px rgba(0,0,0,.05),0 1px 0 rgba(255,255,255,.1);box-shadow:inset 0 1px 3px rgba(0,0,0,.05),0 1px 0 rgba(255,255,255,.1)}
--------------------------------------------------------------------------------
/docs/Tutorial1-ExploringLMERobjects_files/bootstrap-3.3.5/css/fonts/Lato.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jknowles/MultilevelModelTutorialsR/ad4f1f359ddc5d6085dcc956d3983f83a2ce1015/docs/Tutorial1-ExploringLMERobjects_files/bootstrap-3.3.5/css/fonts/Lato.ttf
--------------------------------------------------------------------------------
/docs/Tutorial1-ExploringLMERobjects_files/bootstrap-3.3.5/css/fonts/LatoBold.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jknowles/MultilevelModelTutorialsR/ad4f1f359ddc5d6085dcc956d3983f83a2ce1015/docs/Tutorial1-ExploringLMERobjects_files/bootstrap-3.3.5/css/fonts/LatoBold.ttf
--------------------------------------------------------------------------------
/docs/Tutorial1-ExploringLMERobjects_files/bootstrap-3.3.5/css/fonts/LatoItalic.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jknowles/MultilevelModelTutorialsR/ad4f1f359ddc5d6085dcc956d3983f83a2ce1015/docs/Tutorial1-ExploringLMERobjects_files/bootstrap-3.3.5/css/fonts/LatoItalic.ttf
--------------------------------------------------------------------------------
/docs/Tutorial1-ExploringLMERobjects_files/bootstrap-3.3.5/css/fonts/NewsCycle.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jknowles/MultilevelModelTutorialsR/ad4f1f359ddc5d6085dcc956d3983f83a2ce1015/docs/Tutorial1-ExploringLMERobjects_files/bootstrap-3.3.5/css/fonts/NewsCycle.ttf
--------------------------------------------------------------------------------
/docs/Tutorial1-ExploringLMERobjects_files/bootstrap-3.3.5/css/fonts/NewsCycleBold.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jknowles/MultilevelModelTutorialsR/ad4f1f359ddc5d6085dcc956d3983f83a2ce1015/docs/Tutorial1-ExploringLMERobjects_files/bootstrap-3.3.5/css/fonts/NewsCycleBold.ttf
--------------------------------------------------------------------------------
/docs/Tutorial1-ExploringLMERobjects_files/bootstrap-3.3.5/css/fonts/OpenSans.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jknowles/MultilevelModelTutorialsR/ad4f1f359ddc5d6085dcc956d3983f83a2ce1015/docs/Tutorial1-ExploringLMERobjects_files/bootstrap-3.3.5/css/fonts/OpenSans.ttf
--------------------------------------------------------------------------------
/docs/Tutorial1-ExploringLMERobjects_files/bootstrap-3.3.5/css/fonts/OpenSansBold.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jknowles/MultilevelModelTutorialsR/ad4f1f359ddc5d6085dcc956d3983f83a2ce1015/docs/Tutorial1-ExploringLMERobjects_files/bootstrap-3.3.5/css/fonts/OpenSansBold.ttf
--------------------------------------------------------------------------------
/docs/Tutorial1-ExploringLMERobjects_files/bootstrap-3.3.5/css/fonts/OpenSansBoldItalic.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jknowles/MultilevelModelTutorialsR/ad4f1f359ddc5d6085dcc956d3983f83a2ce1015/docs/Tutorial1-ExploringLMERobjects_files/bootstrap-3.3.5/css/fonts/OpenSansBoldItalic.ttf
--------------------------------------------------------------------------------
/docs/Tutorial1-ExploringLMERobjects_files/bootstrap-3.3.5/css/fonts/OpenSansItalic.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jknowles/MultilevelModelTutorialsR/ad4f1f359ddc5d6085dcc956d3983f83a2ce1015/docs/Tutorial1-ExploringLMERobjects_files/bootstrap-3.3.5/css/fonts/OpenSansItalic.ttf
--------------------------------------------------------------------------------
/docs/Tutorial1-ExploringLMERobjects_files/bootstrap-3.3.5/css/fonts/OpenSansLight.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jknowles/MultilevelModelTutorialsR/ad4f1f359ddc5d6085dcc956d3983f83a2ce1015/docs/Tutorial1-ExploringLMERobjects_files/bootstrap-3.3.5/css/fonts/OpenSansLight.ttf
--------------------------------------------------------------------------------
/docs/Tutorial1-ExploringLMERobjects_files/bootstrap-3.3.5/css/fonts/OpenSansLightItalic.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jknowles/MultilevelModelTutorialsR/ad4f1f359ddc5d6085dcc956d3983f83a2ce1015/docs/Tutorial1-ExploringLMERobjects_files/bootstrap-3.3.5/css/fonts/OpenSansLightItalic.ttf
--------------------------------------------------------------------------------
/docs/Tutorial1-ExploringLMERobjects_files/bootstrap-3.3.5/css/fonts/Raleway.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jknowles/MultilevelModelTutorialsR/ad4f1f359ddc5d6085dcc956d3983f83a2ce1015/docs/Tutorial1-ExploringLMERobjects_files/bootstrap-3.3.5/css/fonts/Raleway.ttf
--------------------------------------------------------------------------------
/docs/Tutorial1-ExploringLMERobjects_files/bootstrap-3.3.5/css/fonts/RalewayBold.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jknowles/MultilevelModelTutorialsR/ad4f1f359ddc5d6085dcc956d3983f83a2ce1015/docs/Tutorial1-ExploringLMERobjects_files/bootstrap-3.3.5/css/fonts/RalewayBold.ttf
--------------------------------------------------------------------------------
/docs/Tutorial1-ExploringLMERobjects_files/bootstrap-3.3.5/css/fonts/Roboto.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jknowles/MultilevelModelTutorialsR/ad4f1f359ddc5d6085dcc956d3983f83a2ce1015/docs/Tutorial1-ExploringLMERobjects_files/bootstrap-3.3.5/css/fonts/Roboto.ttf
--------------------------------------------------------------------------------
/docs/Tutorial1-ExploringLMERobjects_files/bootstrap-3.3.5/css/fonts/RobotoBold.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jknowles/MultilevelModelTutorialsR/ad4f1f359ddc5d6085dcc956d3983f83a2ce1015/docs/Tutorial1-ExploringLMERobjects_files/bootstrap-3.3.5/css/fonts/RobotoBold.ttf
--------------------------------------------------------------------------------
/docs/Tutorial1-ExploringLMERobjects_files/bootstrap-3.3.5/css/fonts/RobotoLight.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jknowles/MultilevelModelTutorialsR/ad4f1f359ddc5d6085dcc956d3983f83a2ce1015/docs/Tutorial1-ExploringLMERobjects_files/bootstrap-3.3.5/css/fonts/RobotoLight.ttf
--------------------------------------------------------------------------------
/docs/Tutorial1-ExploringLMERobjects_files/bootstrap-3.3.5/css/fonts/RobotoMedium.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jknowles/MultilevelModelTutorialsR/ad4f1f359ddc5d6085dcc956d3983f83a2ce1015/docs/Tutorial1-ExploringLMERobjects_files/bootstrap-3.3.5/css/fonts/RobotoMedium.ttf
--------------------------------------------------------------------------------
/docs/Tutorial1-ExploringLMERobjects_files/bootstrap-3.3.5/css/fonts/SourceSansPro.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jknowles/MultilevelModelTutorialsR/ad4f1f359ddc5d6085dcc956d3983f83a2ce1015/docs/Tutorial1-ExploringLMERobjects_files/bootstrap-3.3.5/css/fonts/SourceSansPro.ttf
--------------------------------------------------------------------------------
/docs/Tutorial1-ExploringLMERobjects_files/bootstrap-3.3.5/css/fonts/SourceSansProBold.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jknowles/MultilevelModelTutorialsR/ad4f1f359ddc5d6085dcc956d3983f83a2ce1015/docs/Tutorial1-ExploringLMERobjects_files/bootstrap-3.3.5/css/fonts/SourceSansProBold.ttf
--------------------------------------------------------------------------------
/docs/Tutorial1-ExploringLMERobjects_files/bootstrap-3.3.5/css/fonts/SourceSansProItalic.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jknowles/MultilevelModelTutorialsR/ad4f1f359ddc5d6085dcc956d3983f83a2ce1015/docs/Tutorial1-ExploringLMERobjects_files/bootstrap-3.3.5/css/fonts/SourceSansProItalic.ttf
--------------------------------------------------------------------------------
/docs/Tutorial1-ExploringLMERobjects_files/bootstrap-3.3.5/css/fonts/SourceSansProLight.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jknowles/MultilevelModelTutorialsR/ad4f1f359ddc5d6085dcc956d3983f83a2ce1015/docs/Tutorial1-ExploringLMERobjects_files/bootstrap-3.3.5/css/fonts/SourceSansProLight.ttf
--------------------------------------------------------------------------------
/docs/Tutorial1-ExploringLMERobjects_files/bootstrap-3.3.5/css/fonts/Ubuntu.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jknowles/MultilevelModelTutorialsR/ad4f1f359ddc5d6085dcc956d3983f83a2ce1015/docs/Tutorial1-ExploringLMERobjects_files/bootstrap-3.3.5/css/fonts/Ubuntu.ttf
--------------------------------------------------------------------------------
/docs/Tutorial1-ExploringLMERobjects_files/bootstrap-3.3.5/fonts/glyphicons-halflings-regular.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jknowles/MultilevelModelTutorialsR/ad4f1f359ddc5d6085dcc956d3983f83a2ce1015/docs/Tutorial1-ExploringLMERobjects_files/bootstrap-3.3.5/fonts/glyphicons-halflings-regular.eot
--------------------------------------------------------------------------------
/docs/Tutorial1-ExploringLMERobjects_files/bootstrap-3.3.5/fonts/glyphicons-halflings-regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jknowles/MultilevelModelTutorialsR/ad4f1f359ddc5d6085dcc956d3983f83a2ce1015/docs/Tutorial1-ExploringLMERobjects_files/bootstrap-3.3.5/fonts/glyphicons-halflings-regular.ttf
--------------------------------------------------------------------------------
/docs/Tutorial1-ExploringLMERobjects_files/bootstrap-3.3.5/fonts/glyphicons-halflings-regular.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jknowles/MultilevelModelTutorialsR/ad4f1f359ddc5d6085dcc956d3983f83a2ce1015/docs/Tutorial1-ExploringLMERobjects_files/bootstrap-3.3.5/fonts/glyphicons-halflings-regular.woff
--------------------------------------------------------------------------------
/docs/Tutorial1-ExploringLMERobjects_files/bootstrap-3.3.5/fonts/glyphicons-halflings-regular.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jknowles/MultilevelModelTutorialsR/ad4f1f359ddc5d6085dcc956d3983f83a2ce1015/docs/Tutorial1-ExploringLMERobjects_files/bootstrap-3.3.5/fonts/glyphicons-halflings-regular.woff2
--------------------------------------------------------------------------------
/docs/Tutorial1-ExploringLMERobjects_files/bootstrap-3.3.5/js/bootstrap.min.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * Bootstrap v3.3.5 (http://getbootstrap.com)
3 | * Copyright 2011-2015 Twitter, Inc.
4 | * Licensed under the MIT license
5 | */
6 | if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(a){"use strict";var b=a.fn.jquery.split(" ")[0].split(".");if(b[0]<2&&b[1]<9||1==b[0]&&9==b[1]&&b[2]<1)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher")}(jQuery),+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]};return!1}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one("bsTransitionEnd",function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b(),a.support.transition&&(a.event.special.bsTransitionEnd={bindType:a.support.transition.end,delegateType:a.support.transition.end,handle:function(b){return a(b.target).is(this)?b.handleObj.handler.apply(this,arguments):void 0}})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var c=a(this),e=c.data("bs.alert");e||c.data("bs.alert",e=new d(this)),"string"==typeof b&&e[b].call(c)})}var c='[data-dismiss="alert"]',d=function(b){a(b).on("click",c,this.close)};d.VERSION="3.3.5",d.TRANSITION_DURATION=150,d.prototype.close=function(b){function c(){g.detach().trigger("closed.bs.alert").remove()}var e=a(this),f=e.attr("data-target");f||(f=e.attr("href"),f=f&&f.replace(/.*(?=#[^\s]*$)/,""));var g=a(f);b&&b.preventDefault(),g.length||(g=e.closest(".alert")),g.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(g.removeClass("in"),a.support.transition&&g.hasClass("fade")?g.one("bsTransitionEnd",c).emulateTransitionEnd(d.TRANSITION_DURATION):c())};var e=a.fn.alert;a.fn.alert=b,a.fn.alert.Constructor=d,a.fn.alert.noConflict=function(){return a.fn.alert=e,this},a(document).on("click.bs.alert.data-api",c,d.prototype.close)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof b&&b;e||d.data("bs.button",e=new c(this,f)),"toggle"==b?e.toggle():b&&e.setState(b)})}var c=function(b,d){this.$element=a(b),this.options=a.extend({},c.DEFAULTS,d),this.isLoading=!1};c.VERSION="3.3.5",c.DEFAULTS={loadingText:"loading..."},c.prototype.setState=function(b){var c="disabled",d=this.$element,e=d.is("input")?"val":"html",f=d.data();b+="Text",null==f.resetText&&d.data("resetText",d[e]()),setTimeout(a.proxy(function(){d[e](null==f[b]?this.options[b]:f[b]),"loadingText"==b?(this.isLoading=!0,d.addClass(c).attr(c,c)):this.isLoading&&(this.isLoading=!1,d.removeClass(c).removeAttr(c))},this),0)},c.prototype.toggle=function(){var a=!0,b=this.$element.closest('[data-toggle="buttons"]');if(b.length){var c=this.$element.find("input");"radio"==c.prop("type")?(c.prop("checked")&&(a=!1),b.find(".active").removeClass("active"),this.$element.addClass("active")):"checkbox"==c.prop("type")&&(c.prop("checked")!==this.$element.hasClass("active")&&(a=!1),this.$element.toggleClass("active")),c.prop("checked",this.$element.hasClass("active")),a&&c.trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active")),this.$element.toggleClass("active")};var d=a.fn.button;a.fn.button=b,a.fn.button.Constructor=c,a.fn.button.noConflict=function(){return a.fn.button=d,this},a(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(c){var d=a(c.target);d.hasClass("btn")||(d=d.closest(".btn")),b.call(d,"toggle"),a(c.target).is('input[type="radio"]')||a(c.target).is('input[type="checkbox"]')||c.preventDefault()}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(b){a(b.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(b.type))})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},c.DEFAULTS,d.data(),"object"==typeof b&&b),g="string"==typeof b?b:f.slide;e||d.data("bs.carousel",e=new c(this,f)),"number"==typeof b?e.to(b):g?e[g]():f.interval&&e.pause().cycle()})}var c=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=null,this.sliding=null,this.interval=null,this.$active=null,this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",a.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",a.proxy(this.pause,this)).on("mouseleave.bs.carousel",a.proxy(this.cycle,this))};c.VERSION="3.3.5",c.TRANSITION_DURATION=600,c.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},c.prototype.keydown=function(a){if(!/input|textarea/i.test(a.target.tagName)){switch(a.which){case 37:this.prev();break;case 39:this.next();break;default:return}a.preventDefault()}},c.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},c.prototype.getItemIndex=function(a){return this.$items=a.parent().children(".item"),this.$items.index(a||this.$active)},c.prototype.getItemForDirection=function(a,b){var c=this.getItemIndex(b),d="prev"==a&&0===c||"next"==a&&c==this.$items.length-1;if(d&&!this.options.wrap)return b;var e="prev"==a?-1:1,f=(c+e)%this.$items.length;return this.$items.eq(f)},c.prototype.to=function(a){var b=this,c=this.getItemIndex(this.$active=this.$element.find(".item.active"));return a>this.$items.length-1||0>a?void 0:this.sliding?this.$element.one("slid.bs.carousel",function(){b.to(a)}):c==a?this.pause().cycle():this.slide(a>c?"next":"prev",this.$items.eq(a))},c.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},c.prototype.next=function(){return this.sliding?void 0:this.slide("next")},c.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},c.prototype.slide=function(b,d){var e=this.$element.find(".item.active"),f=d||this.getItemForDirection(b,e),g=this.interval,h="next"==b?"left":"right",i=this;if(f.hasClass("active"))return this.sliding=!1;var j=f[0],k=a.Event("slide.bs.carousel",{relatedTarget:j,direction:h});if(this.$element.trigger(k),!k.isDefaultPrevented()){if(this.sliding=!0,g&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var l=a(this.$indicators.children()[this.getItemIndex(f)]);l&&l.addClass("active")}var m=a.Event("slid.bs.carousel",{relatedTarget:j,direction:h});return a.support.transition&&this.$element.hasClass("slide")?(f.addClass(b),f[0].offsetWidth,e.addClass(h),f.addClass(h),e.one("bsTransitionEnd",function(){f.removeClass([b,h].join(" ")).addClass("active"),e.removeClass(["active",h].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger(m)},0)}).emulateTransitionEnd(c.TRANSITION_DURATION)):(e.removeClass("active"),f.addClass("active"),this.sliding=!1,this.$element.trigger(m)),g&&this.cycle(),this}};var d=a.fn.carousel;a.fn.carousel=b,a.fn.carousel.Constructor=c,a.fn.carousel.noConflict=function(){return a.fn.carousel=d,this};var e=function(c){var d,e=a(this),f=a(e.attr("data-target")||(d=e.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""));if(f.hasClass("carousel")){var g=a.extend({},f.data(),e.data()),h=e.attr("data-slide-to");h&&(g.interval=!1),b.call(f,g),h&&f.data("bs.carousel").to(h),c.preventDefault()}};a(document).on("click.bs.carousel.data-api","[data-slide]",e).on("click.bs.carousel.data-api","[data-slide-to]",e),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var c=a(this);b.call(c,c.data())})})}(jQuery),+function(a){"use strict";function b(b){var c,d=b.attr("data-target")||(c=b.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,"");return a(d)}function c(b){return this.each(function(){var c=a(this),e=c.data("bs.collapse"),f=a.extend({},d.DEFAULTS,c.data(),"object"==typeof b&&b);!e&&f.toggle&&/show|hide/.test(b)&&(f.toggle=!1),e||c.data("bs.collapse",e=new d(this,f)),"string"==typeof b&&e[b]()})}var d=function(b,c){this.$element=a(b),this.options=a.extend({},d.DEFAULTS,c),this.$trigger=a('[data-toggle="collapse"][href="#'+b.id+'"],[data-toggle="collapse"][data-target="#'+b.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};d.VERSION="3.3.5",d.TRANSITION_DURATION=350,d.DEFAULTS={toggle:!0},d.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},d.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var b,e=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(e&&e.length&&(b=e.data("bs.collapse"),b&&b.transitioning))){var f=a.Event("show.bs.collapse");if(this.$element.trigger(f),!f.isDefaultPrevented()){e&&e.length&&(c.call(e,"hide"),b||e.data("bs.collapse",null));var g=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[g](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var h=function(){this.$element.removeClass("collapsing").addClass("collapse in")[g](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return h.call(this);var i=a.camelCase(["scroll",g].join("-"));this.$element.one("bsTransitionEnd",a.proxy(h,this)).emulateTransitionEnd(d.TRANSITION_DURATION)[g](this.$element[0][i])}}}},d.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var e=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};return a.support.transition?void this.$element[c](0).one("bsTransitionEnd",a.proxy(e,this)).emulateTransitionEnd(d.TRANSITION_DURATION):e.call(this)}}},d.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},d.prototype.getParent=function(){return a(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(a.proxy(function(c,d){var e=a(d);this.addAriaAndCollapsedClass(b(e),e)},this)).end()},d.prototype.addAriaAndCollapsedClass=function(a,b){var c=a.hasClass("in");a.attr("aria-expanded",c),b.toggleClass("collapsed",!c).attr("aria-expanded",c)};var e=a.fn.collapse;a.fn.collapse=c,a.fn.collapse.Constructor=d,a.fn.collapse.noConflict=function(){return a.fn.collapse=e,this},a(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(d){var e=a(this);e.attr("data-target")||d.preventDefault();var f=b(e),g=f.data("bs.collapse"),h=g?"toggle":e.data();c.call(f,h)})}(jQuery),+function(a){"use strict";function b(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#[A-Za-z]/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}function c(c){c&&3===c.which||(a(e).remove(),a(f).each(function(){var d=a(this),e=b(d),f={relatedTarget:this};e.hasClass("open")&&(c&&"click"==c.type&&/input|textarea/i.test(c.target.tagName)&&a.contains(e[0],c.target)||(e.trigger(c=a.Event("hide.bs.dropdown",f)),c.isDefaultPrevented()||(d.attr("aria-expanded","false"),e.removeClass("open").trigger("hidden.bs.dropdown",f))))}))}function d(b){return this.each(function(){var c=a(this),d=c.data("bs.dropdown");d||c.data("bs.dropdown",d=new g(this)),"string"==typeof b&&d[b].call(c)})}var e=".dropdown-backdrop",f='[data-toggle="dropdown"]',g=function(b){a(b).on("click.bs.dropdown",this.toggle)};g.VERSION="3.3.5",g.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=b(e),g=f.hasClass("open");if(c(),!g){"ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(a(this)).on("click",c);var h={relatedTarget:this};if(f.trigger(d=a.Event("show.bs.dropdown",h)),d.isDefaultPrevented())return;e.trigger("focus").attr("aria-expanded","true"),f.toggleClass("open").trigger("shown.bs.dropdown",h)}return!1}},g.prototype.keydown=function(c){if(/(38|40|27|32)/.test(c.which)&&!/input|textarea/i.test(c.target.tagName)){var d=a(this);if(c.preventDefault(),c.stopPropagation(),!d.is(".disabled, :disabled")){var e=b(d),g=e.hasClass("open");if(!g&&27!=c.which||g&&27==c.which)return 27==c.which&&e.find(f).trigger("focus"),d.trigger("click");var h=" li:not(.disabled):visible a",i=e.find(".dropdown-menu"+h);if(i.length){var j=i.index(c.target);38==c.which&&j>0&&j--,40==c.which&&jdocument.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&a?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!a?this.scrollbarWidth:""})},c.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},c.prototype.checkScrollbar=function(){var a=window.innerWidth;if(!a){var b=document.documentElement.getBoundingClientRect();a=b.right-Math.abs(b.left)}this.bodyIsOverflowing=document.body.clientWidth',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}},c.prototype.init=function(b,c,d){if(this.enabled=!0,this.type=b,this.$element=a(c),this.options=this.getOptions(d),this.$viewport=this.options.viewport&&a(a.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(var e=this.options.trigger.split(" "),f=e.length;f--;){var g=e[f];if("click"==g)this.$element.on("click."+this.type,this.options.selector,a.proxy(this.toggle,this));else if("manual"!=g){var h="hover"==g?"mouseenter":"focusin",i="hover"==g?"mouseleave":"focusout";this.$element.on(h+"."+this.type,this.options.selector,a.proxy(this.enter,this)),this.$element.on(i+"."+this.type,this.options.selector,a.proxy(this.leave,this))}}this.options.selector?this._options=a.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.getOptions=function(b){return b=a.extend({},this.getDefaults(),this.$element.data(),b),b.delay&&"number"==typeof b.delay&&(b.delay={show:b.delay,hide:b.delay}),b},c.prototype.getDelegateOptions=function(){var b={},c=this.getDefaults();return this._options&&a.each(this._options,function(a,d){c[a]!=d&&(b[a]=d)}),b},c.prototype.enter=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusin"==b.type?"focus":"hover"]=!0),c.tip().hasClass("in")||"in"==c.hoverState?void(c.hoverState="in"):(clearTimeout(c.timeout),c.hoverState="in",c.options.delay&&c.options.delay.show?void(c.timeout=setTimeout(function(){"in"==c.hoverState&&c.show()},c.options.delay.show)):c.show())},c.prototype.isInStateTrue=function(){for(var a in this.inState)if(this.inState[a])return!0;return!1},c.prototype.leave=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusout"==b.type?"focus":"hover"]=!1),c.isInStateTrue()?void 0:(clearTimeout(c.timeout),c.hoverState="out",c.options.delay&&c.options.delay.hide?void(c.timeout=setTimeout(function(){"out"==c.hoverState&&c.hide()},c.options.delay.hide)):c.hide())},c.prototype.show=function(){var b=a.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(b);var d=a.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(b.isDefaultPrevented()||!d)return;var e=this,f=this.tip(),g=this.getUID(this.type);this.setContent(),f.attr("id",g),this.$element.attr("aria-describedby",g),this.options.animation&&f.addClass("fade");var h="function"==typeof this.options.placement?this.options.placement.call(this,f[0],this.$element[0]):this.options.placement,i=/\s?auto?\s?/i,j=i.test(h);j&&(h=h.replace(i,"")||"top"),f.detach().css({top:0,left:0,display:"block"}).addClass(h).data("bs."+this.type,this),this.options.container?f.appendTo(this.options.container):f.insertAfter(this.$element),this.$element.trigger("inserted.bs."+this.type);var k=this.getPosition(),l=f[0].offsetWidth,m=f[0].offsetHeight;if(j){var n=h,o=this.getPosition(this.$viewport);h="bottom"==h&&k.bottom+m>o.bottom?"top":"top"==h&&k.top-mo.width?"left":"left"==h&&k.left-lg.top+g.height&&(e.top=g.top+g.height-i)}else{var j=b.left-f,k=b.left+f+c;jg.right&&(e.left=g.left+g.width-k)}return e},c.prototype.getTitle=function(){var a,b=this.$element,c=this.options;return a=b.attr("data-original-title")||("function"==typeof c.title?c.title.call(b[0]):c.title)},c.prototype.getUID=function(a){do a+=~~(1e6*Math.random());while(document.getElementById(a));return a},c.prototype.tip=function(){if(!this.$tip&&(this.$tip=a(this.options.template),1!=this.$tip.length))throw new Error(this.type+" `template` option must consist of exactly 1 top-level element!");return this.$tip},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},c.prototype.enable=function(){this.enabled=!0},c.prototype.disable=function(){this.enabled=!1},c.prototype.toggleEnabled=function(){this.enabled=!this.enabled},c.prototype.toggle=function(b){var c=this;b&&(c=a(b.currentTarget).data("bs."+this.type),c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c))),b?(c.inState.click=!c.inState.click,c.isInStateTrue()?c.enter(c):c.leave(c)):c.tip().hasClass("in")?c.leave(c):c.enter(c)},c.prototype.destroy=function(){var a=this;clearTimeout(this.timeout),this.hide(function(){a.$element.off("."+a.type).removeData("bs."+a.type),a.$tip&&a.$tip.detach(),a.$tip=null,a.$arrow=null,a.$viewport=null})};var d=a.fn.tooltip;a.fn.tooltip=b,a.fn.tooltip.Constructor=c,a.fn.tooltip.noConflict=function(){return a.fn.tooltip=d,this}}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof b&&b;(e||!/destroy|hide/.test(b))&&(e||d.data("bs.popover",e=new c(this,f)),"string"==typeof b&&e[b]())})}var c=function(a,b){this.init("popover",a,b)};if(!a.fn.tooltip)throw new Error("Popover requires tooltip.js");c.VERSION="3.3.5",c.DEFAULTS=a.extend({},a.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:'