Chapter 10 Methods

Far better an approximate answer to the right question, which is often vague, than an exact answer to the wrong question, which can always be made precise - John W. Tukey, 1962

We describe our methods in this chapter.

10.1 Linear Regression

10.2 Logistic Regression

10.3 Hierarchical Modeling

library(lme4)
library(arm)
data("sleepstudy")
fit_lme <- lmer(extra ~ group + (1 | ID), sleep)
display(fit_lme)
## lmer(formula = extra ~ group + (1 | ID), data = sleep)
##             coef.est coef.se
## (Intercept) 0.75     0.60   
## group2      1.58     0.39   
## 
## Error terms:
##  Groups   Name        Std.Dev.
##  ID       (Intercept) 1.69    
##  Residual             0.87    
## ---
## number of obs: 20, groups: ID, 10
## AIC = 78, DIC = 71.1
## deviance = 70.5
ranef(fit_lme)
## $ID
##    (Intercept)
## 1   -0.2118668
## 2   -1.7125900
## 3   -0.9622284
## 4   -1.8450067
## 5   -1.4477565
## 6    2.0833569
## 7    2.7013017
## 8   -0.3001446
## 9    0.6709115
## 10   1.0240229
library(brms)
library(ggplot2)
library(ggeffects)
library(sjPlot)
library(sjlabelled)
data(efc)

m <- brm(cbind(c82cop1, c83cop2, c84cop3) ~ c161sex + e42dep, data = efc)

plot_model(m)

10.3.1 Bayesian Hierarchical Modeling

data("sleep")
library(rjags)

#model_string <- 

10.4 Being Certain about What we can

Uncertainity reflects the lack of complete knolwedge about a paramet; variability refers to underlying differences among individuals or groups (Gelman and Hill 457)

10.5 Hypothesis Testing

10.6 Dimensionality Reduction

10.6.1 Principal Components Analysis

10.6.2 Factory Analysis

10.7 Advanced Statistical Learning

10.8 Supervised Learning

10.8.1 Naive Bayes

10.8.2 Linear Discriminant Analysis

10.8.3 Decision Trees

10.8.4 Random Forest

10.8.5 Gradient Boosted Machines

10.8.6 Partial Least Squares Regression

10.8.7 Neural Netorks

10.9 Unsupervised Learning

10.9.1 Hierarchical Clustering

10.9.2 Cluster Analysis