Exercise 1

Adjust the parameters, simulate your clustered data and present the results of the three types of models using the modelsummary package. Interpret your models and compare the estimations with each other, and with the six parameters used to simulate your data. Is there one single model that is superior to all the rest in terms of estimating the parameters? If so which is it, and what makes it better? If not, Which model works best for what purpose? In your answer, please pay attention to the standard errors and the Intraclass Correlation Coefficient (ICC) of your multilevel model(s). What does the ICC mean? How much does it deviate from what you would expect? For more about the ICC, please see below.

# Write your code here
library(faux)
#observations nested within clusters
obs_per_cluster <-  20
#number of clusters 
n_cluster <-  30
# Fixed intercept
alpha_0 <- 2
# Fixed slope
beta_0 <- 1.5
# Residuals st.dev (level 1) 
sig  <-  1
# Random intercept st.dev (level 2) 
sig_u <- 1.5
# Random slope st.dev (level 2)
sig_v <- 1.8
# Independent random effects
cor <- 0.5

# Create a dataset that can be reproduced
set.seed(888)  
# step 1: create the units 
df <- add_random(
    cluster = n_cluster,  # first the clusters
    obs = obs_per_cluster # second, the observations
    ) 
view(df)
# Print the result 
# try to figure out what just happened
df |> 
  print(n = 15)
## # A tibble: 600 × 2
##    cluster   obs  
##    <chr>     <chr>
##  1 cluster01 obs01
##  2 cluster01 obs02
##  3 cluster01 obs03
##  4 cluster01 obs04
##  5 cluster01 obs05
##  6 cluster01 obs06
##  7 cluster01 obs07
##  8 cluster01 obs08
##  9 cluster01 obs09
## 10 cluster01 obs10
## 11 cluster01 obs11
## 12 cluster01 obs12
## 13 cluster01 obs13
## 14 cluster01 obs14
## 15 cluster01 obs15
## # ℹ 585 more rows
# step 2: Add anything at level 2
# Here we have random intercept/slope 
df <- df |>
  add_ranef(
    "cluster",
    u_i = sig_u,
    v_i = sig_v,
    .cors = cor
    ) |> mutate(
      a_i = alpha_0 + u_i, 
      b_i = beta_0  + v_i
    )
view(df)

# Print the result 
# try to figure out what just happened
df |> 
  print(n = 15)
## # A tibble: 600 × 6
##    cluster   obs     u_i   v_i   a_i    b_i
##    <chr>     <chr> <dbl> <dbl> <dbl>  <dbl>
##  1 cluster01 obs01 -3.82 -2.20 -1.82 -0.700
##  2 cluster01 obs02 -3.82 -2.20 -1.82 -0.700
##  3 cluster01 obs03 -3.82 -2.20 -1.82 -0.700
##  4 cluster01 obs04 -3.82 -2.20 -1.82 -0.700
##  5 cluster01 obs05 -3.82 -2.20 -1.82 -0.700
##  6 cluster01 obs06 -3.82 -2.20 -1.82 -0.700
##  7 cluster01 obs07 -3.82 -2.20 -1.82 -0.700
##  8 cluster01 obs08 -3.82 -2.20 -1.82 -0.700
##  9 cluster01 obs09 -3.82 -2.20 -1.82 -0.700
## 10 cluster01 obs10 -3.82 -2.20 -1.82 -0.700
## 11 cluster01 obs11 -3.82 -2.20 -1.82 -0.700
## 12 cluster01 obs12 -3.82 -2.20 -1.82 -0.700
## 13 cluster01 obs13 -3.82 -2.20 -1.82 -0.700
## 14 cluster01 obs14 -3.82 -2.20 -1.82 -0.700
## 15 cluster01 obs15 -3.82 -2.20 -1.82 -0.700
## # ℹ 585 more rows
# step 3: add anything at level 1
df <- df |>
  mutate(
    x       = rnorm(n_cluster * obs_per_cluster),
    epsilon = rnorm(n_cluster * obs_per_cluster, 0, sig),
    y = a_i + b_i * x + epsilon
    )
view(df)

# Print the result 
# try to figure out what just happened
df |> 
  print(n = 20)
## # A tibble: 600 × 9
##    cluster   obs     u_i   v_i   a_i    b_i       x epsilon       y
##    <chr>     <chr> <dbl> <dbl> <dbl>  <dbl>   <dbl>   <dbl>   <dbl>
##  1 cluster01 obs01 -3.82 -2.20 -1.82 -0.700 -0.456    0.136 -1.37  
##  2 cluster01 obs02 -3.82 -2.20 -1.82 -0.700  0.0190  -0.262 -2.10  
##  3 cluster01 obs03 -3.82 -2.20 -1.82 -0.700 -0.318    0.211 -1.39  
##  4 cluster01 obs04 -3.82 -2.20 -1.82 -0.700 -0.550    0.239 -1.20  
##  5 cluster01 obs05 -3.82 -2.20 -1.82 -0.700  1.47     1.02  -1.83  
##  6 cluster01 obs06 -3.82 -2.20 -1.82 -0.700 -0.287    0.527 -1.09  
##  7 cluster01 obs07 -3.82 -2.20 -1.82 -0.700  0.422    0.145 -1.97  
##  8 cluster01 obs08 -3.82 -2.20 -1.82 -0.700 -0.0691   0.881 -0.891 
##  9 cluster01 obs09 -3.82 -2.20 -1.82 -0.700 -1.76    -0.238 -0.826 
## 10 cluster01 obs10 -3.82 -2.20 -1.82 -0.700 -2.52     0.748  0.692 
## 11 cluster01 obs11 -3.82 -2.20 -1.82 -0.700  1.36    -1.41  -4.18  
## 12 cluster01 obs12 -3.82 -2.20 -1.82 -0.700  0.445   -0.679 -2.81  
## 13 cluster01 obs13 -3.82 -2.20 -1.82 -0.700 -0.868   -0.583 -1.80  
## 14 cluster01 obs14 -3.82 -2.20 -1.82 -0.700  0.760   -2.15  -4.50  
## 15 cluster01 obs15 -3.82 -2.20 -1.82 -0.700 -1.04     0.500 -0.596 
## 16 cluster01 obs16 -3.82 -2.20 -1.82 -0.700 -0.187   -1.91  -3.60  
## 17 cluster01 obs17 -3.82 -2.20 -1.82 -0.700  0.404    1.54  -0.561 
## 18 cluster01 obs18 -3.82 -2.20 -1.82 -0.700  1.27     0.687 -2.02  
## 19 cluster01 obs19 -3.82 -2.20 -1.82 -0.700 -1.25     0.868 -0.0797
## 20 cluster01 obs20 -3.82 -2.20 -1.82 -0.700  0.164   -0.675 -2.61  
## # ℹ 580 more rows
# For the models, we really only need 
# the cluster id, the y and the x

df  <- df |> select(cluster, x, y)

# Print the result 
# try to figure out what just happened
df |> 
  print(n = 20)
## # A tibble: 600 × 3
##    cluster         x       y
##    <chr>       <dbl>   <dbl>
##  1 cluster01 -0.456  -1.37  
##  2 cluster01  0.0190 -2.10  
##  3 cluster01 -0.318  -1.39  
##  4 cluster01 -0.550  -1.20  
##  5 cluster01  1.47   -1.83  
##  6 cluster01 -0.287  -1.09  
##  7 cluster01  0.422  -1.97  
##  8 cluster01 -0.0691 -0.891 
##  9 cluster01 -1.76   -0.826 
## 10 cluster01 -2.52    0.692 
## 11 cluster01  1.36   -4.18  
## 12 cluster01  0.445  -2.81  
## 13 cluster01 -0.868  -1.80  
## 14 cluster01  0.760  -4.50  
## 15 cluster01 -1.04   -0.596 
## 16 cluster01 -0.187  -3.60  
## 17 cluster01  0.404  -0.561 
## 18 cluster01  1.27   -2.02  
## 19 cluster01 -1.25   -0.0797
## 20 cluster01  0.164  -2.61  
## # ℹ 580 more rows
view(df)

#Test data against three types of models:
#Complete pooling: 
complete_pooling <- lm(y ~ x, df)

#No pooling: 
no_pooling <- lm(y ~ x + cluster, df)
no_pooling_inter <- lm(y ~ x + cluster + x:cluster, df)
  
#Multilevel model (partial pooling):
multilevel <- lmer(y ~ x + (1 | cluster), df)
multilevel_randomslope <- lmer(y ~ x + (x | cluster), df)
  
modelsummary(
  list(
    "COMPLETE POOLING" = complete_pooling,
    "NO POOLING" = no_pooling,
    "NO POOLING + INTERACTION" = no_pooling_inter,
    "MULTILEVEL MODEL" = multilevel ,
    "MULTILEVEL MODEL + RANDOM SLOPES" = multilevel_randomslope 
  ),
  stars = TRUE
)
 COMPLETE POOLING  NO POOLING  NO POOLING + INTERACTION  MULTILEVEL MODEL  MULTILEVEL MODEL + RANDOM SLOPES
(Intercept) 1.844*** -1.557*** -1.868*** 1.844*** 1.896***
(0.108) (0.463) (0.232) (0.317) (0.321)
x 1.184*** 1.196*** -0.883*** 1.195*** 1.374***
(0.115) (0.092) (0.231) (0.092) (0.366)
clustercluster02 2.940*** 3.252***
(0.654) (0.327)
clustercluster03 3.945*** 4.338***
(0.654) (0.327)
clustercluster04 1.937** 2.253***
(0.654) (0.327)
clustercluster05 0.384 1.710***
(0.656) (0.345)
clustercluster06 4.384*** 5.100***
(0.655) (0.334)
clustercluster07 0.143 0.945**
(0.655) (0.330)
clustercluster08 4.088*** 3.751***
(0.656) (0.339)
clustercluster09 4.348*** 4.952***
(0.654) (0.333)
clustercluster10 4.774*** 4.695***
(0.654) (0.329)
clustercluster11 3.690*** 4.125***
(0.654) (0.328)
clustercluster12 5.212*** 5.548***
(0.654) (0.327)
clustercluster13 5.445*** 6.117***
(0.654) (0.335)
clustercluster14 6.087*** 6.425***
(0.655) (0.331)
clustercluster15 3.042*** 3.387***
(0.654) (0.327)
clustercluster16 3.037*** 2.825***
(0.654) (0.333)
clustercluster17 7.059*** 7.378***
(0.654) (0.327)
clustercluster18 1.405* 1.692***
(0.654) (0.327)
clustercluster19 1.503* 1.234***
(0.654) (0.329)
clustercluster20 3.150*** 3.581***
(0.656) (0.348)
clustercluster21 2.420*** 2.921***
(0.654) (0.333)
clustercluster22 3.509*** 3.827***
(0.654) (0.327)
clustercluster23 2.986*** 3.140***
(0.654) (0.328)
clustercluster24 4.555*** 4.975***
(0.654) (0.327)
clustercluster25 1.664* 2.176***
(0.654) (0.337)
clustercluster26 3.352*** 3.681***
(0.654) (0.328)
clustercluster27 2.846*** 3.424***
(0.654) (0.342)
clustercluster28 5.431*** 6.551***
(0.654) (0.330)
clustercluster29 3.532*** 3.544***
(0.655) (0.331)
clustercluster30 5.168*** 5.409***
(0.654) (0.335)
x × clustercluster02 -0.957**
(0.311)
x × clustercluster03 3.590***
(0.319)
x × clustercluster04 2.395***
(0.351)
x × clustercluster05 -0.702+
(0.378)
x × clustercluster06 0.890**
(0.303)
x × clustercluster07 -0.879*
(0.360)
x × clustercluster08 3.893***
(0.338)
x × clustercluster09 3.448***
(0.369)
x × clustercluster10 4.814***
(0.344)
x × clustercluster11 3.341***
(0.317)
x × clustercluster12 4.665***
(0.364)
x × clustercluster13 3.128***
(0.313)
x × clustercluster14 1.969***
(0.315)
x × clustercluster15 1.250***
(0.304)
x × clustercluster16 -0.459
(0.391)
x × clustercluster17 3.436***
(0.327)
x × clustercluster18 3.263***
(0.385)
x × clustercluster19 -1.156***
(0.299)
x × clustercluster20 1.800***
(0.360)
x × clustercluster21 2.795***
(0.332)
x × clustercluster22 1.738***
(0.354)
x × clustercluster23 0.587
(0.368)
x × clustercluster24 3.730***
(0.347)
x × clustercluster25 3.221***
(0.516)
x × clustercluster26 2.277***
(0.335)
x × clustercluster27 3.044***
(0.435)
x × clustercluster28 7.722***
(0.397)
x × clustercluster29 3.311***
(0.320)
x × clustercluster30 1.724***
(0.428)
SD (Intercept cluster) 1.672 1.744
SD (x cluster) 1.988
Cor (Intercept~x cluster) 0.616
SD (Observations) 2.068 1.028
Num.Obs. 600 600 600 600 600
R2 0.151 0.506 0.884
R2 Adj. 0.150 0.480 0.871
R2 Marg. 0.152 0.181
R2 Cond. 0.487 0.886
AIC 2873.1 2606.6 1794.9 2663.2 1978.3
BIC 2886.3 2747.3 2063.1 2680.8 2004.6
ICC 0.4 0.9
Log.Lik. -1433.550 -1271.312 -836.443
RMSE 2.64 2.01 0.98 2.02 0.98
+ p < 0.1, * p < 0.05, ** p < 0.01, *** p < 0.001

Answer:

Complete pooling: the value of Y when X is zero is 1.844 (global intercept), assuming all observations are independent. The average change in Y per unit change in X is 1.184 (global slope), assuming all observations are independent.

No pooling: the value of Y when X is zero is -1.557 (global intercept). The average change in Y per unit change in X is 1.196. (global slope). The coefficients per each cluster are interpreted as the difference in the value of Y for one unit change in X compared to the cluster one (reference group). In the example, in the cluster02, the difference in Y for a one unit change in X is 2.940 compared to the cluster01.

No pooling + interaction: the value of Y when X is zero is -1.868. The average change in Y per unit change in X is -0.883. In the cluster02, the difference in Y for a one unit change in X is 3.252 compared to the cluster01. There is a significant interaction between X and clusters.

Multilevel model: The expected value of Y when X is zero for the reference cluster is 1.844, with a margin of error of approximately ±0.31. The average change in Y per unit change in X is 1.195, with a margin of error of approximately ±0.09.

Multilevel + random slope: on average, for the reference cluster, the expected value of Y increases by 1.374 units for each unit change in X. Additionally, the global intercept is 1.896, indicating the expected value of Y when X is zero for the reference cluster.

According to the values of AIC (1978) and BIC (2004), the multilevel + random slopes is the best fit model. The Intraclass Correlation Coefficient (ICC) represents the proportion of total variance in the dependent variable that is attributed to between-group variation. This indicates that a substantial portion (0.9) of the total variance in Y is due to differences between clusters.

Exercise 2

Use your models to create a caterpillar plot for the intercepts and lattice and/or spaghetti plots to show the features of your multilevel models. Describe and discuss the plots: what new light do they shed? What are the advantages or disadvantages of presenting the models using these plots?

# Write your code here
# First, we need the list of clusters
clusters <- df |> 
  pull(cluster) |> 
  unique()

# fit the models
#Multilevel model (partial pooling):
multilevel <- lmer(y ~ x + (1 | cluster), df)
multilevel_randomslope <- lmer(y ~ x + (x | cluster), df)

# predictions of y for each cluster at x = 0
predict_y1 <- multilevel |> 
  ranef() |> 
  # Used the broom.mixed::augment function 
  # to calculate the confidence intervals
  augment() |> 
  # convert to a tibble
  as_tibble() |> 
  # Include only the random intercept
  filter(variable == "(Intercept)") |> 
  # Now we order the results by ascending estimates
  arrange(estimate) |> 
  mutate(cluster = fct_inorder(level)) 

predict_y2 <- multilevel_randomslope |> 
  ranef() |> 
  # Used the broom.mixed::augment function 
  # to calculate the confidence intervals
  augment() |> 
  # convert to a tibble
  as_tibble() |> 
  # Include only the random intercept
  filter(variable == "(Intercept)") |> 
  # Now we order the results by ascending estimates
  arrange(estimate) |> 
  mutate(cluster = fct_inorder(level))

# caterpillar plots multilevel models
predict_y1 |>
  ggplot(aes(xmin = estimate - 1.96 * std.error, xmax = estimate + 1.96 * std.error, y = cluster, x = estimate)) +
  geom_pointrange()+
  ggtitle("Multilevel model")

predict_y2 |>
  ggplot(aes(xmin = estimate - 1.96 * std.error, xmax = estimate + 1.96 * std.error, y = cluster, x = estimate)) +
  geom_pointrange()+
  ggtitle("Multilevel model + random slopes")

##Lattice plot multilevel models
predictions(multilevel) |>  
  ggplot(aes(x, y, color = cluster)) + 
  geom_point() + 
  # Use facets to create the lattice plot
  facet_wrap(~cluster)+
  ggtitle("Lattice plot: Multilevel model")

  # Remove it to create the spaghetti plot

multilevel_randomslope <- lmer(y ~ x + (x | cluster), df)
predictions(multilevel_randomslope) |>  
  ggplot(aes(x, y, color = cluster)) + 
  geom_point() + 
  # Use facets to create the lattice plot
  facet_wrap(~cluster)+
  ggtitle("Lattice plot: Multilevel model + random slopes")

  # Remove it to create the spaghetti plot

Answer:

Caterpillar plots and lattice plots provide valuable insights into the structure of the data and the effects of clusters. They are beneficial for understanding how individual and group-level factors contribute to the observed outcomes and are helpful for understanding of the variation at the individual level (random effects) within different clusters. We can see how much the variation is, Clusters to the left (toward -5) have lower intercepts, while clusters to the right (toward 5) have higher intercepts. The confidence interval for the multilevel model is largest than the multilevel + random slope.

Exercise 3 and 4

library(ggpubr)
## Warning: package 'ggpubr' was built under R version 4.3.2
radon_mn <- read_rds("https://bit.ly/BMLR-Radon") |> 
  filter(state == "MN") |>
  # drop counties without measurements
  mutate(county = fct_drop(county))


table1(~radon + log.radon + first_floor + fullfips + u | county, overall=T, data=radon_mn)
## Warning in .table1.internal(x = x, labels = labels, groupspan = groupspan, :
## Table has 86 columns. Are you sure this is what you want?
AITKIN
(N=4)
ANOKA
(N=52)
BECKER
(N=3)
BELTRAMI
(N=7)
BENTON
(N=4)
BIG STONE
(N=3)
BLUE EARTH
(N=14)
BROWN
(N=4)
CARLTON
(N=10)
CARVER
(N=6)
CASS
(N=5)
CHIPPEWA
(N=4)
CHISAGO
(N=6)
CLAY
(N=14)
CLEARWATER
(N=4)
COOK
(N=2)
COTTONWOOD
(N=4)
CROW WING
(N=12)
DAKOTA
(N=63)
DODGE
(N=3)
DOUGLAS
(N=9)
FARIBAULT
(N=6)
FILLMORE
(N=2)
FREEBORN
(N=9)
GOODHUE
(N=14)
HENNEPIN
(N=105)
HOUSTON
(N=6)
HUBBARD
(N=5)
ISANTI
(N=3)
ITASCA
(N=11)
JACKSON
(N=5)
KANABEC
(N=4)
KANDIYOHI
(N=4)
KITTSON
(N=3)
KOOCHICHING
(N=7)
LAC QUI PARLE
(N=2)
LAKE
(N=9)
LAKE OF THE WOODS
(N=4)
LE SUEUR
(N=5)
LINCOLN
(N=4)
LYON
(N=8)
MAHNOMEN
(N=1)
MARSHALL
(N=9)
MARTIN
(N=7)
MCLEOD
(N=13)
MEEKER
(N=5)
MILLE LACS
(N=2)
MORRISON
(N=9)
MOWER
(N=13)
MURRAY
(N=1)
NICOLLET
(N=4)
NOBLES
(N=3)
NORMAN
(N=3)
OLMSTED
(N=23)
OTTER TAIL
(N=8)
PENNINGTON
(N=3)
PINE
(N=6)
PIPESTONE
(N=4)
POLK
(N=4)
POPE
(N=2)
RAMSEY
(N=32)
REDWOOD
(N=5)
RENVILLE
(N=3)
RICE
(N=11)
ROCK
(N=2)
ROSEAU
(N=14)
SCOTT
(N=13)
SHERBURNE
(N=8)
SIBLEY
(N=4)
ST LOUIS
(N=116)
STEARNS
(N=25)
STEELE
(N=10)
STEVENS
(N=2)
SWIFT
(N=4)
TODD
(N=3)
TRAVERSE
(N=4)
WABASHA
(N=7)
WADENA
(N=5)
WASECA
(N=4)
WASHINGTON
(N=46)
WATONWAN
(N=3)
WILKIN
(N=1)
WINONA
(N=13)
WRIGHT
(N=13)
YELLOW MEDICINE
(N=2)
TRUE
(N=919)
radon
Mean (SD) 2.08 (0.789) 2.96 (2.03) 3.33 (1.85) 4.03 (2.05) 3.78 (1.89) 4.93 (2.30) 7.65 (3.71) 5.83 (3.34) 2.95 (1.55) 7.25 (6.07) 4.46 (2.04) 7.13 (3.94) 3.68 (2.70) 8.89 (7.53) 3.13 (1.62) 2.05 (0.919) 5.10 (4.89) 3.10 (1.88) 4.71 (3.55) 6.10 (0.964) 5.50 (1.74) 2.75 (1.89) 2.85 (0.495) 9.54 (9.31) 8.75 (10.5) 4.58 (3.52) 5.25 (2.84) 2.68 (1.55) 2.93 (0.702) 3.02 (2.30) 8.94 (5.25) 4.03 (2.71) 8.60 (3.87) 4.10 (3.02) 1.60 (0.640) 13.7 (3.32) 1.94 (2.05) 5.15 (3.35) 5.68 (3.84) 9.88 (5.87) 6.86 (2.48) 3.90 (NA) 9.88 (16.2) 4.29 (3.58) 5.79 (6.96) 3.74 (2.06) 3.10 (3.68) 3.10 (1.12) 7.09 (6.23) 12.1 (NA) 9.70 (4.83) 7.10 (2.29) 3.77 (3.75) 4.33 (3.04) 5.21 (4.48) 3.27 (2.78) 2.12 (1.14) 6.88 (4.73) 5.10 (3.83) 3.60 (0.283) 3.64 (2.29) 8.54 (7.35) 4.63 (2.20) 6.94 (4.55) 5.00 (4.81) 4.33 (3.06) 7.51 (7.46) 3.16 (1.19) 3.83 (1.61) 3.07 (3.70) 4.93 (3.23) 5.61 (2.95) 6.25 (2.47) 2.93 (1.39) 4.97 (2.51) 8.23 (7.55) 6.94 (3.75) 3.26 (1.67) 3.08 (4.18) 4.73 (3.96) 9.90 (4.06) 9.30 (NA) 6.12 (4.13) 5.80 (3.75) 3.30 (0.566) 4.77 (4.48)
Median [Min, Max] 2.20 [1.00, 2.90] 2.25 [0.200, 8.10] 4.30 [1.20, 4.50] 4.60 [0.400, 6.30] 2.90 [2.70, 6.60] 5.00 [2.60, 7.20] 6.85 [1.80, 14.3] 5.35 [2.50, 10.1] 2.80 [0.800, 5.60] 7.15 [0, 14.7] 4.00 [1.90, 7.40] 8.55 [1.40, 10.0] 3.25 [0.800, 8.10] 7.85 [0.900, 26.6] 3.40 [0.900, 4.80] 2.05 [1.40, 2.70] 4.65 [0, 11.1] 2.70 [0.900, 6.70] 4.30 [0.500, 21.2] 5.70 [5.40, 7.20] 5.50 [2.70, 7.80] 2.85 [0.100, 5.20] 2.85 [2.50, 3.20] 6.30 [2.20, 32.6] 5.25 [2.60, 43.5] 3.90 [0.400, 23.6] 4.20 [2.20, 9.00] 2.80 [0.800, 4.60] 3.00 [2.20, 3.60] 2.50 [1.10, 9.40] 8.40 [2.90, 15.3] 3.20 [1.80, 7.90] 9.00 [4.10, 12.3] 4.50 [0.900, 6.90] 1.40 [1.00, 2.80] 13.7 [11.3, 16.0] 1.30 [0.500, 7.10] 3.80 [2.90, 10.1] 4.20 [3.30, 12.5] 9.25 [3.50, 17.5] 6.15 [4.60, 12.0] 3.90 [3.90, 3.90] 1.50 [0.900, 48.2] 4.10 [0.500, 9.20] 2.80 [0, 25.4] 3.20 [2.10, 7.20] 3.10 [0.500, 5.70] 3.00 [1.40, 4.90] 6.40 [1.10, 24.0] 12.1 [12.1, 12.1] 9.45 [4.20, 15.7] 6.20 [5.40, 9.70] 1.60 [1.60, 8.10] 3.20 [0.600, 11.2] 3.50 [1.10, 12.6] 3.70 [0.300, 5.80] 1.70 [1.20, 4.10] 6.85 [1.70, 12.1] 4.70 [1.40, 9.60] 3.60 [3.40, 3.80] 3.30 [0.700, 10.1] 7.40 [1.90, 20.7] 5.80 [2.10, 6.00] 5.60 [2.40, 19.0] 5.00 [1.60, 8.40] 3.60 [1.10, 11.4] 4.30 [1.20, 25.2] 2.95 [1.60, 5.10] 4.40 [1.50, 5.00] 2.00 [0.200, 32.2] 5.00 [1.00, 14.5] 4.75 [1.50, 10.6] 6.25 [4.50, 8.00] 2.70 [1.50, 4.80] 6.00 [2.10, 6.80] 5.35 [2.90, 19.3] 8.40 [1.10, 11.5] 3.20 [0.700, 4.80] 1.30 [0.400, 9.30] 3.75 [0.800, 20.4] 10.2 [5.70, 13.8] 9.30 [9.30, 9.30] 4.70 [0.500, 11.8] 5.10 [2.10, 15.9] 3.30 [2.90, 3.70] 3.60 [0, 48.2]
log.radon
Mean (SD) 0.660 (0.459) 0.833 (0.770) 1.05 (0.750) 1.14 (0.968) 1.25 (0.424) 1.51 (0.516) 1.91 (0.553) 1.63 (0.608) 0.931 (0.615) 1.20 (1.90) 1.40 (0.504) 1.73 (0.936) 1.04 (0.845) 1.78 (1.01) 0.978 (0.740) 0.665 (0.464) 0.734 (2.12) 0.941 (0.669) 1.29 (0.752) 1.80 (0.153) 1.65 (0.351) 0.517 (1.47) 1.04 (0.175) 1.94 (0.807) 1.85 (0.711) 1.29 (0.710) 1.53 (0.552) 0.809 (0.714) 1.06 (0.249) 0.926 (0.584) 2.02 (0.689) 1.24 (0.632) 2.06 (0.510) 1.11 (1.07) 0.407 (0.375) 2.60 (0.246) 0.322 (0.826) 1.51 (0.561) 1.60 (0.528) 2.14 (0.674) 1.88 (0.323) 1.36 (NA) 1.20 (1.50) 0.938 (1.26) 1.07 (1.40) 1.21 (0.492) 0.524 (1.72) 1.07 (0.389) 1.59 (0.940) 2.49 (NA) 2.17 (0.557) 1.93 (0.306) 1.01 (0.936) 1.21 (0.761) 1.35 (0.828) 0.621 (1.60) 0.642 (0.494) 1.68 (0.884) 1.36 (0.891) 1.28 (0.0786) 1.09 (0.668) 1.84 (0.902) 1.43 (0.597) 1.78 (0.565) 1.30 (1.17) 1.25 (0.681) 1.58 (0.972) 1.09 (0.376) 1.24 (0.566) 0.768 (0.800) 1.38 (0.702) 1.58 (0.599) 1.79 (0.407) 0.987 (0.484) 1.48 (0.645) 1.83 (0.830) 1.72 (0.837) 0.997 (0.790) 0.435 (1.34) 1.25 (0.797) 2.23 (0.449) 2.23 (NA) 1.46 (1.04) 1.59 (0.599) 1.19 (0.172) 1.22 (0.853)
Median [Min, Max] 0.788 [0, 1.06] 0.811 [-1.61, 2.09] 1.46 [0.182, 1.50] 1.53 [-0.916, 1.84] 1.06 [0.993, 1.89] 1.61 [0.956, 1.97] 1.92 [0.588, 2.66] 1.64 [0.916, 2.31] 1.01 [-0.223, 1.72] 1.90 [-2.30, 2.69] 1.39 [0.642, 2.00] 2.14 [0.336, 2.30] 1.11 [-0.223, 2.09] 2.05 [-0.105, 3.28] 1.22 [-0.105, 1.57] 0.665 [0.336, 0.993] 1.42 [-2.30, 2.41] 0.991 [-0.105, 1.90] 1.46 [-0.693, 3.05] 1.74 [1.69, 1.97] 1.70 [0.993, 2.05] 1.03 [-2.30, 1.65] 1.04 [0.916, 1.16] 1.84 [0.788, 3.48] 1.66 [0.956, 3.77] 1.36 [-0.916, 3.16] 1.42 [0.788, 2.20] 1.03 [-0.223, 1.53] 1.10 [0.788, 1.28] 0.916 [0.0953, 2.24] 2.13 [1.06, 2.73] 1.15 [0.588, 2.07] 2.16 [1.41, 2.51] 1.50 [-0.105, 1.93] 0.336 [0, 1.03] 2.60 [2.42, 2.77] 0.262 [-0.693, 1.96] 1.33 [1.06, 2.31] 1.44 [1.19, 2.53] 2.21 [1.25, 2.86] 1.81 [1.53, 2.48] 1.36 [1.36, 1.36] 0.405 [-0.105, 3.88] 1.41 [-0.693, 2.22] 1.03 [-2.30, 3.23] 1.16 [0.742, 1.97] 0.524 [-0.693, 1.74] 1.10 [0.336, 1.59] 1.86 [0.0953, 3.18] 2.49 [2.49, 2.49] 2.24 [1.44, 2.75] 1.82 [1.69, 2.27] 0.470 [0.470, 2.09] 1.16 [-0.511, 2.42] 1.25 [0.0953, 2.53] 1.31 [-1.20, 1.76] 0.524 [0.182, 1.41] 1.85 [0.531, 2.49] 1.42 [0.336, 2.26] 1.28 [1.22, 1.34] 1.19 [-0.357, 2.31] 2.00 [0.642, 3.03] 1.76 [0.742, 1.79] 1.72 [0.875, 2.94] 1.30 [0.470, 2.13] 1.28 [0.0953, 2.43] 1.46 [0.182, 3.23] 1.08 [0.470, 1.63] 1.48 [0.405, 1.61] 0.693 [-1.61, 3.47] 1.61 [0, 2.67] 1.56 [0.405, 2.36] 1.79 [1.50, 2.08] 0.987 [0.405, 1.57] 1.79 [0.742, 1.92] 1.64 [1.06, 2.96] 2.13 [0.0953, 2.44] 1.16 [-0.357, 1.57] 0.213 [-0.916, 2.23] 1.32 [-0.223, 3.02] 2.32 [1.74, 2.62] 2.23 [2.23, 2.23] 1.55 [-0.693, 2.47] 1.63 [0.742, 2.77] 1.19 [1.06, 1.31] 1.28 [-2.30, 3.88]
first_floor
Mean (SD) 0.250 (0.500) 0.0577 (0.235) 0.667 (0.577) 0.571 (0.535) 0.250 (0.500) 0 (0) 0.143 (0.363) 0.500 (0.577) 0.100 (0.316) 0.500 (0.548) 0 (0) 0 (0) 0 (0) 0.286 (0.469) 0.500 (0.577) 0 (0) 0.750 (0.500) 0.250 (0.452) 0.0635 (0.246) 0 (0) 0.111 (0.333) 0.167 (0.408) 0.500 (0.707) 0.222 (0.441) 0.143 (0.363) 0.105 (0.308) 0.333 (0.516) 0.600 (0.548) 0 (0) 0 (0) 0 (0) 0 (0) 0 (0) 0.667 (0.577) 0.571 (0.535) 0.500 (0.707) 0.111 (0.333) 0.500 (0.577) 0.200 (0.447) 0.250 (0.500) 0.125 (0.354) 0 (NA) 0.556 (0.527) 0.143 (0.378) 0.308 (0.480) 0 (0) 0.500 (0.707) 0.111 (0.333) 0.154 (0.376) 0 (NA) 0 (0) 0 (0) 0.333 (0.577) 0.130 (0.344) 0.375 (0.518) 0.667 (0.577) 0.167 (0.408) 0.250 (0.500) 0.500 (0.577) 0 (0) 0.0938 (0.296) 0.200 (0.447) 0.333 (0.577) 0.0909 (0.302) 0 (0) 0.571 (0.514) 0.308 (0.480) 0 (0) 0 (0) 0.138 (0.346) 0.160 (0.374) 0 (0) 0 (0) 0 (0) 0.333 (0.577) 0.250 (0.500) 0.143 (0.378) 0.400 (0.548) 0.250 (0.500) 0.109 (0.315) 0.667 (0.577) 0 (NA) 0.231 (0.439) 0.0769 (0.277) 0 (0) 0.166 (0.373)
Median [Min, Max] 0 [0, 1.00] 0 [0, 1.00] 1.00 [0, 1.00] 1.00 [0, 1.00] 0 [0, 1.00] 0 [0, 0] 0 [0, 1.00] 0.500 [0, 1.00] 0 [0, 1.00] 0.500 [0, 1.00] 0 [0, 0] 0 [0, 0] 0 [0, 0] 0 [0, 1.00] 0.500 [0, 1.00] 0 [0, 0] 1.00 [0, 1.00] 0 [0, 1.00] 0 [0, 1.00] 0 [0, 0] 0 [0, 1.00] 0 [0, 1.00] 0.500 [0, 1.00] 0 [0, 1.00] 0 [0, 1.00] 0 [0, 1.00] 0 [0, 1.00] 1.00 [0, 1.00] 0 [0, 0] 0 [0, 0] 0 [0, 0] 0 [0, 0] 0 [0, 0] 1.00 [0, 1.00] 1.00 [0, 1.00] 0.500 [0, 1.00] 0 [0, 1.00] 0.500 [0, 1.00] 0 [0, 1.00] 0 [0, 1.00] 0 [0, 1.00] 0 [0, 0] 1.00 [0, 1.00] 0 [0, 1.00] 0 [0, 1.00] 0 [0, 0] 0.500 [0, 1.00] 0 [0, 1.00] 0 [0, 1.00] 0 [0, 0] 0 [0, 0] 0 [0, 0] 0 [0, 1.00] 0 [0, 1.00] 0 [0, 1.00] 1.00 [0, 1.00] 0 [0, 1.00] 0 [0, 1.00] 0.500 [0, 1.00] 0 [0, 0] 0 [0, 1.00] 0 [0, 1.00] 0 [0, 1.00] 0 [0, 1.00] 0 [0, 0] 1.00 [0, 1.00] 0 [0, 1.00] 0 [0, 0] 0 [0, 0] 0 [0, 1.00] 0 [0, 1.00] 0 [0, 0] 0 [0, 0] 0 [0, 0] 0 [0, 1.00] 0 [0, 1.00] 0 [0, 1.00] 0 [0, 1.00] 0 [0, 1.00] 0 [0, 1.00] 1.00 [0, 1.00] 0 [0, 0] 0 [0, 1.00] 0 [0, 1.00] 0 [0, 0] 0 [0, 1.00]
fullfips
Mean (SD) 27000 (0) 27000 (0) 27000 (0) 27000 (0) 27000 (0) 27000 (0) 27000 (0) 27000 (0) 27000 (0) 27000 (0) 27000 (0) 27000 (0) 27000 (0) 27000 (0) 27000 (0) 27000 (0) 27000 (0) 27000 (0) 27000 (0) 27000 (0) 27000 (0) 27000 (0) 27000 (0) 27000 (0) 27000 (0) 27100 (0) 27100 (0) 27100 (0) 27100 (0) 27100 (0) 27100 (0) 27100 (0) 27100 (0) 27100 (0) 27100 (0) 27100 (0) 27100 (0) 27100 (0) 27100 (0) 27100 (0) 27100 (0) 27100 (NA) 27100 (0) 27100 (0) 27100 (0) 27100 (0) 27100 (0) 27100 (0) 27100 (0) 27100 (NA) 27100 (0) 27100 (0) 27100 (0) 27100 (0) 27100 (0) 27100 (0) 27100 (0) 27100 (0) 27100 (0) 27100 (0) 27100 (0) 27100 (0) 27100 (0) 27100 (0) 27100 (0) 27100 (0) 27100 (0) 27100 (0) 27100 (0) 27100 (0) 27100 (0) 27100 (0) 27100 (0) 27200 (0) 27200 (0) 27200 (0) 27200 (0) 27200 (0) 27200 (0) 27200 (0) 27200 (0) 27200 (NA) 27200 (0) 27200 (0) 27200 (0) 27100 (52.1)
Median [Min, Max] 27000 [27000, 27000] 27000 [27000, 27000] 27000 [27000, 27000] 27000 [27000, 27000] 27000 [27000, 27000] 27000 [27000, 27000] 27000 [27000, 27000] 27000 [27000, 27000] 27000 [27000, 27000] 27000 [27000, 27000] 27000 [27000, 27000] 27000 [27000, 27000] 27000 [27000, 27000] 27000 [27000, 27000] 27000 [27000, 27000] 27000 [27000, 27000] 27000 [27000, 27000] 27000 [27000, 27000] 27000 [27000, 27000] 27000 [27000, 27000] 27000 [27000, 27000] 27000 [27000, 27000] 27000 [27000, 27000] 27000 [27000, 27000] 27000 [27000, 27000] 27100 [27100, 27100] 27100 [27100, 27100] 27100 [27100, 27100] 27100 [27100, 27100] 27100 [27100, 27100] 27100 [27100, 27100] 27100 [27100, 27100] 27100 [27100, 27100] 27100 [27100, 27100] 27100 [27100, 27100] 27100 [27100, 27100] 27100 [27100, 27100] 27100 [27100, 27100] 27100 [27100, 27100] 27100 [27100, 27100] 27100 [27100, 27100] 27100 [27100, 27100] 27100 [27100, 27100] 27100 [27100, 27100] 27100 [27100, 27100] 27100 [27100, 27100] 27100 [27100, 27100] 27100 [27100, 27100] 27100 [27100, 27100] 27100 [27100, 27100] 27100 [27100, 27100] 27100 [27100, 27100] 27100 [27100, 27100] 27100 [27100, 27100] 27100 [27100, 27100] 27100 [27100, 27100] 27100 [27100, 27100] 27100 [27100, 27100] 27100 [27100, 27100] 27100 [27100, 27100] 27100 [27100, 27100] 27100 [27100, 27100] 27100 [27100, 27100] 27100 [27100, 27100] 27100 [27100, 27100] 27100 [27100, 27100] 27100 [27100, 27100] 27100 [27100, 27100] 27100 [27100, 27100] 27100 [27100, 27100] 27100 [27100, 27100] 27100 [27100, 27100] 27100 [27100, 27100] 27200 [27200, 27200] 27200 [27200, 27200] 27200 [27200, 27200] 27200 [27200, 27200] 27200 [27200, 27200] 27200 [27200, 27200] 27200 [27200, 27200] 27200 [27200, 27200] 27200 [27200, 27200] 27200 [27200, 27200] 27200 [27200, 27200] 27200 [27200, 27200] 27100 [27000, 27200]
u
Mean (SD) -0.689 (0) -0.847 (0) -0.113 (0) -0.593 (0) -0.143 (0) 0.387 (0) 0.272 (0) 0.278 (0) -0.332 (0) 0.0959 (0) -0.608 (0) 0.274 (0) -0.735 (0) 0.344 (0) -0.0599 (0) -0.505 (0) 0.340 (0) -0.633 (0) -0.0241 (0) 0.264 (0) 0.156 (0) 0.295 (0) 0.415 (0) 0.224 (0) 0.197 (0) -0.0965 (0) 0.504 (0) -0.401 (0) -0.752 (0) -0.663 (0) 0.309 (0) -0.0534 (0) 0.110 (0) -0.00780 (0) -0.882 (0) 0.311 (0) -0.692 (0) -0.682 (0) 0.194 (0) 0.445 (0) 0.395 (0) 0.150 (NA) 0.0138 (0) 0.166 (0) 0.140 (0) 0.0240 (0) -0.210 (0) -0.0932 (0) 0.261 (0) 0.399 (NA) 0.248 (0) 0.405 (0) 0.265 (0) 0.243 (0) -0.205 (0) -0.0740 (0) -0.163 (0) 0.479 (0) 0.266 (0) 0.281 (0) -0.418 (0) 0.366 (0) 0.381 (0) 0.193 (0) 0.528 (0) -0.212 (0) 0.0631 (0) -0.683 (0) 0.237 (0) -0.475 (0) 0.116 (0) 0.270 (0) 0.471 (0) 0.316 (0) -0.0468 (0) 0.498 (0) 0.150 (0) -0.672 (0) 0.212 (0) -0.147 (0) 0.183 (0) 0.236 (NA) 0.463 (0) -0.0900 (0) 0.355 (0) -0.132 (0.365)
Median [Min, Max] -0.689 [-0.689, -0.689] -0.847 [-0.847, -0.847] -0.113 [-0.113, -0.113] -0.593 [-0.593, -0.593] -0.143 [-0.143, -0.143] 0.387 [0.387, 0.387] 0.272 [0.272, 0.272] 0.278 [0.278, 0.278] -0.332 [-0.332, -0.332] 0.0959 [0.0959, 0.0959] -0.608 [-0.608, -0.608] 0.274 [0.274, 0.274] -0.735 [-0.735, -0.735] 0.344 [0.344, 0.344] -0.0599 [-0.0599, -0.0599] -0.505 [-0.505, -0.505] 0.340 [0.340, 0.340] -0.633 [-0.633, -0.633] -0.0241 [-0.0241, -0.0241] 0.264 [0.264, 0.264] 0.156 [0.156, 0.156] 0.295 [0.295, 0.295] 0.415 [0.415, 0.415] 0.224 [0.224, 0.224] 0.197 [0.197, 0.197] -0.0965 [-0.0965, -0.0965] 0.504 [0.504, 0.504] -0.401 [-0.401, -0.401] -0.752 [-0.752, -0.752] -0.663 [-0.663, -0.663] 0.309 [0.309, 0.309] -0.0534 [-0.0534, -0.0534] 0.110 [0.110, 0.110] -0.00780 [-0.00780, -0.00780] -0.882 [-0.882, -0.882] 0.311 [0.311, 0.311] -0.692 [-0.692, -0.692] -0.682 [-0.682, -0.682] 0.194 [0.194, 0.194] 0.445 [0.445, 0.445] 0.395 [0.395, 0.395] 0.150 [0.150, 0.150] 0.0138 [0.0138, 0.0138] 0.166 [0.166, 0.166] 0.140 [0.140, 0.140] 0.0240 [0.0240, 0.0240] -0.210 [-0.210, -0.210] -0.0932 [-0.0932, -0.0932] 0.261 [0.261, 0.261] 0.399 [0.399, 0.399] 0.248 [0.248, 0.248] 0.405 [0.405, 0.405] 0.265 [0.265, 0.265] 0.243 [0.243, 0.243] -0.205 [-0.205, -0.205] -0.0740 [-0.0740, -0.0740] -0.163 [-0.163, -0.163] 0.479 [0.479, 0.479] 0.266 [0.266, 0.266] 0.281 [0.281, 0.281] -0.418 [-0.418, -0.418] 0.366 [0.366, 0.366] 0.381 [0.381, 0.381] 0.193 [0.193, 0.193] 0.528 [0.528, 0.528] -0.212 [-0.212, -0.212] 0.0631 [0.0631, 0.0631] -0.683 [-0.683, -0.683] 0.237 [0.237, 0.237] -0.475 [-0.475, -0.475] 0.116 [0.116, 0.116] 0.270 [0.270, 0.270] 0.471 [0.471, 0.471] 0.316 [0.316, 0.316] -0.0468 [-0.0468, -0.0468] 0.498 [0.498, 0.498] 0.150 [0.150, 0.150] -0.672 [-0.672, -0.672] 0.212 [0.212, 0.212] -0.147 [-0.147, -0.147] 0.183 [0.183, 0.183] 0.236 [0.236, 0.236] 0.463 [0.463, 0.463] -0.0900 [-0.0900, -0.0900] 0.355 [0.355, 0.355] -0.0965 [-0.882, 0.528]
radon_mn_count <- radon_mn |>
  count(county, name = "n.obs")

m.no_pool <- radon_mn |>
  lm(log.radon ~ 0 + county, data = _)

m.partial_pool <- radon_mn |>
  lmer(log.radon ~ (1|county), data = _)

modelsummary(
  list(
    "No Pooling" = m.no_pool,
    "Multilevel partial pooling" = m.partial_pool
  ),
  stars = TRUE
)
No Pooling Multilevel partial pooling
countyAITKIN 0.660+
(0.399)
countyANOKA 0.833***
(0.111)
countyBECKER 1.048*
(0.461)
countyBELTRAMI 1.141***
(0.302)
countyBENTON 1.252**
(0.399)
countyBIG STONE 1.513**
(0.461)
countyBLUE EARTH 1.909***
(0.213)
countyBROWN 1.629***
(0.399)
countyCARLTON 0.931***
(0.252)
countyCARVER 1.204***
(0.326)
countyCASS 1.401***
(0.357)
countyCHIPPEWA 1.730***
(0.399)
countyCHISAGO 1.039**
(0.326)
countyCLAY 1.783***
(0.213)
countyCLEARWATER 0.978*
(0.399)
countyCOOK 0.665
(0.565)
countyCOTTONWOOD 0.734+
(0.399)
countyCROW WING 0.941***
(0.230)
countyDAKOTA 1.293***
(0.101)
countyDODGE 1.800***
(0.461)
countyDOUGLAS 1.654***
(0.266)
countyFARIBAULT 0.517
(0.326)
countyFILLMORE 1.040+
(0.565)
countyFREEBORN 1.942***
(0.266)
countyGOODHUE 1.848***
(0.213)
countyHENNEPIN 1.285***
(0.078)
countyHOUSTON 1.533***
(0.326)
countyHUBBARD 0.809*
(0.357)
countyISANTI 1.056*
(0.461)
countyITASCA 0.926***
(0.241)
countyJACKSON 2.021***
(0.357)
countyKANABEC 1.236**
(0.399)
countyKANDIYOHI 2.062***
(0.399)
countyKITTSON 1.110*
(0.461)
countyKOOCHICHING 0.407
(0.302)
countyLAC QUI PARLE 2.599***
(0.565)
countyLAKE 0.322
(0.266)
countyLAKE OF THE WOODS 1.507***
(0.399)
countyLE SUEUR 1.604***
(0.357)
countyLINCOLN 2.136***
(0.399)
countyLYON 1.877***
(0.282)
countyMAHNOMEN 1.361+
(0.798)
countyMARSHALL 1.202***
(0.266)
countyMARTIN 0.938**
(0.302)
countyMCLEOD 1.074***
(0.221)
countyMEEKER 1.215***
(0.357)
countyMILLE LACS 0.524
(0.565)
countyMORRISON 1.068***
(0.266)
countyMOWER 1.591***
(0.221)
countyMURRAY 2.493**
(0.798)
countyNICOLLET 2.165***
(0.399)
countyNOBLES 1.928***
(0.461)
countyNORMAN 1.011*
(0.461)
countyOLMSTED 1.213***
(0.166)
countyOTTER TAIL 1.348***
(0.282)
countyPENNINGTON 0.621
(0.461)
countyPINE 0.642*
(0.326)
countyPIPESTONE 1.681***
(0.399)
countyPOLK 1.362***
(0.399)
countyPOPE 1.279*
(0.565)
countyRAMSEY 1.091***
(0.141)
countyREDWOOD 1.839***
(0.357)
countyRENVILLE 1.431**
(0.461)
countyRICE 1.782***
(0.241)
countyROCK 1.299*
(0.565)
countyROSEAU 1.254***
(0.213)
countySCOTT 1.581***
(0.221)
countySHERBURNE 1.090***
(0.282)
countySIBLEY 1.242**
(0.399)
countyST LOUIS 0.768***
(0.074)
countySTEARNS 1.377***
(0.160)
countySTEELE 1.580***
(0.252)
countySTEVENS 1.792**
(0.565)
countySWIFT 0.987*
(0.399)
countyTODD 1.484**
(0.461)
countyTRAVERSE 1.828***
(0.399)
countyWABASHA 1.719***
(0.302)
countyWADENA 0.997**
(0.357)
countyWASECA 0.435
(0.399)
countyWASHINGTON 1.251***
(0.118)
countyWATONWAN 2.229***
(0.461)
countyWILKIN 2.230**
(0.798)
countyWINONA 1.457***
(0.221)
countyWRIGHT 1.590***
(0.221)
countyYELLOW MEDICINE 1.187*
(0.565)
(Intercept) 1.313***
(0.049)
SD (Intercept county) 0.310
SD (Observations) 0.798
Num.Obs. 919 919
R2 0.740
R2 Adj. 0.714
R2 Marg. 0.000
R2 Cond. 0.131
AIC 2276.9 2265.4
BIC 2691.7 2279.9
ICC 0.1
Log.Lik. -1052.452
RMSE 0.76 0.78
+ p < 0.1, * p < 0.05, ** p < 0.01, *** p < 0.001
# Use here the two models - first the fixed effects (no pooling)
# model, and then the multilevel (partial pooling) model.
a <- m.no_pool |> 
  predictions(newdata = datagrid(county = unique)) |> 
  as_tibble() |> inner_join(radon_mn_count, by = "county") |> 
  select(county, estimate, conf.low, conf.high, n.obs) |> 
  ggplot(
    aes(
      x    = n.obs, 
      y    = estimate, 
      ymin = conf.low, 
      ymax = conf.high
      )
    ) + 
  geom_pointrange(
    position = position_jitter(width = .5, height = 0)
    ) +
  geom_hline(yintercept=1.22, color = "red")+ 
  labs(title = 'No pooling (Fixed model)') +
  scale_x_continuous(trans = 'log10', breaks = c()) 



b <- m.partial_pool |> 
  predictions(newdata = datagrid(county = unique)) |> 
  as_tibble() |> inner_join(radon_mn_count, by = "county") |> 
  select(county, estimate, conf.low, conf.high, n.obs) |> 
  ggplot(
    aes(
      x    = n.obs, 
      y    = estimate, 
      ymin = conf.low, 
      ymax = conf.high
      )
    ) + 
  geom_pointrange(
    position = position_jitter(width = .5, height = 0)
    ) +
  geom_hline(yintercept=1.22, color = "red")+ 
  labs(x = 'Number of observations',
       title = 'Partial pooling (Multilevel model)') +
  scale_x_continuous(trans = 'log10', breaks = c(1, 2, 4, 6, 8, 10, 20, 40, 60, 80, 100)) 



plots <- 
  ggarrange(a + rremove('ylab') + 
              rremove('xlab'), b + 
              rremove('ylab'), nrow = 2)

  
  annotate_figure(plots, 
                left = text_grob('Estimated log radon in the county', 
                                         rot = 90))

Interpretation:

We estimated the log.radon for each county and adjust for the number of observation using no pooling and multilevel model. with both models, we saw similar effect estimated. However, the confidence interval in the no pooling model with small observation is larger than the multilevel model. The reason for this is that in no pooling model, the confidence interval was calculated using the overall average as the intercept. In the multilevel model, confidence interval was calculated using random intercept that every county has. therefore, the CIs are more uniform in any n.obs.

Exercise 5

## MODEL FITTING:
# Fit the model (you will need to fit all three models)
mdl.compl_pool <- radon_mn |>
  lm(log.radon ~ first_floor, data = _)

mdl.no_pool <- radon_mn |>
  lm(log.radon ~ first_floor + county + first_floor:county, data = _)

mdl.partial_pool <- radon_mn |>
  lmer(log.radon ~ first_floor + (first_floor|county), data = _)



# Collect the predictions
# complete pool
pred_compl.pool <- mdl.compl_pool |>
  predictions(newdata = datagrid(first_floor = c(0, 1))) |> 
  select(first_floor, estimate, conf.low, conf.high) |>  
  as_tibble( )  

# no pool
pred_no.pool <- mdl.no_pool |>
  predictions(newdata = datagrid(first_floor = c(0, 1),
                  county = c("BLUE EARTH", "CLAY", "DAKOTA", "DOUGLAS", 
                             "KOOCHICHING", "LAC QUI PARLE", "MCLEOD", "MILLE LACS", 
                             "HENNEPIN", "MOWER", "OTTER TAIL", "RAMSEY", "REDWOOD",
                             "RICE", "SCOTT", "ST LOUIS", "STEARNS"))) |> 
  select(county, first_floor, estimate, conf.low, conf.high) |> 
  as_tibble( )

# partial pool
pred_partial <- mdl.partial_pool |>
  predictions(
    newdata = datagrid(
      first_floor = c(0, 1),
      county = c("BLUE EARTH", "CLAY", "DAKOTA", "DOUGLAS", 
                 "KOOCHICHING", "LAC QUI PARLE", "MCLEOD", "MILLE LACS", 
                 "HENNEPIN", "MOWER", "OTTER TAIL", "RAMSEY", "REDWOOD",
                 "RICE", "SCOTT", "ST LOUIS", "STEARNS")
    )
  ) |> 
  select(county, first_floor, estimate, conf.low, conf.high) |> 
  as_tibble( )  



### GRAPH PREDICTIONS
radon_mn |> 
  filter(county %in% c("BLUE EARTH", "CLAY", "DAKOTA", "DOUGLAS", 
                       "KOOCHICHING", "LAC QUI PARLE", "MCLEOD", "MILLE LACS", 
                       "HENNEPIN", "MOWER", "OTTER TAIL", "RAMSEY", "REDWOOD",
                       "RICE", "SCOTT", "ST LOUIS", "STEARNS")) |>
  ggplot(aes(x = first_floor, y = log.radon)) +
  geom_point()  +
  geom_line(data = pred_compl.pool, aes(first_floor, estimate), color = "purple", linetype = 'dashed')  +  ## NO POOL
  geom_line(data = pred_no.pool, aes(x = first_floor, y = estimate), color = 'steelblue', linetype = 'twodash') + ## PARTIAL
  geom_line(data = pred_partial, aes(first_floor, estimate), color = "red")  +  ## MULTILEVEL
  facet_wrap(~county, scales = "free_y") +
  scale_x_continuous(breaks = c(0, 1), labels = c('floor = 0', 'floor = 1')) +
  theme_bw() + 
  labs(y = 'Log Radon level', x = NULL)

#

Interpretation:

The forecasts of three models are illustrated by three distinct lines: the dashed purple line corresponds to the complete pooling model, the blue line represents the no pooling model, and the red line denotes the multilevel model.

The no pooling model shows high sensitivity, closely fitting even with limited data points, as observed in 6 of the counties Blue Earth, Douglas, Koochiching, Lac Qui Parle, Mille Lacs and RedWood. In contrast, the complete pooling model maintains a consistent intercept and slope across all county-level data points, exhibiting minimal sensitivity to county variations. This characteristic suggests a tendency to overfit the data by the no pooling model.

The partial model strikes a balance between complete pooling and no pooling extremes. While introducing some bias, it avoids overfitting, providing a more balanced and generalizable approach. The red line, representing the partial model, consistently falls between the pooled and non-pooled models, as observed in our graphs.

Another characteristic is that partial pooled and complete pooled models always point the prediction to the same direction, wheter the no pooled model, strikes in an opposite direction, like in the counties of Blue Earth, Koochiching and Redwood.

Taking all this in to account, Radon exposure seems to be higher on the ground floor rather than in the first floor, according to the partial and complete models.

Exercise 6

## Warning: Using `size` aesthetic for lines was deprecated in ggplot2 3.4.0.
## ℹ Please use `linewidth` instead.
## This warning is displayed once every 8 hours.
## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
## generated.

Interpretation:

The plot displays county-level predicted values of the coefficients for log radon levels plotted against uranium at the county level. The county coefficients closely track the estimated multilevel regression line, suggesting a linear relationship between radon and uranium predicted values.

Exercise 7

## # A tibble: 935 × 9
##    cluster   obs     u_i    v_i   a_i   b_i     x epsilon       y
##    <chr>     <chr> <dbl>  <dbl> <dbl> <dbl> <int>   <dbl>   <dbl>
##  1 cluster01 obs01 0.295 -0.839  1.76 -1.52     0  0.575   2.33  
##  2 cluster01 obs02 0.295 -0.839  1.76 -1.52     0  0.602   2.36  
##  3 cluster01 obs03 0.295 -0.839  1.76 -1.52     0  0.136   1.89  
##  4 cluster01 obs04 0.295 -0.839  1.76 -1.52     0  1.48    3.24  
##  5 cluster01 obs05 0.295 -0.839  1.76 -1.52     0 -0.302   1.46  
##  6 cluster01 obs06 0.295 -0.839  1.76 -1.52     1  0.321   0.558 
##  7 cluster01 obs07 0.295 -0.839  1.76 -1.52     0 -0.369   1.39  
##  8 cluster01 obs08 0.295 -0.839  1.76 -1.52     0  0.348   2.10  
##  9 cluster01 obs09 0.295 -0.839  1.76 -1.52     1 -0.497  -0.260 
## 10 cluster01 obs10 0.295 -0.839  1.76 -1.52     0 -0.388   1.37  
## 11 cluster01 obs11 0.295 -0.839  1.76 -1.52     0  0.255   2.01  
## 12 cluster02 obs01 0.290 -0.605  1.75 -1.29     1  1.11    1.57  
## 13 cluster02 obs02 0.290 -0.605  1.75 -1.29     1 -0.969  -0.502 
## 14 cluster02 obs03 0.290 -0.605  1.75 -1.29     0 -1.05    0.706 
## 15 cluster02 obs04 0.290 -0.605  1.75 -1.29     0 -0.640   1.11  
## 16 cluster02 obs05 0.290 -0.605  1.75 -1.29     0 -0.0724  1.68  
## 17 cluster02 obs06 0.290 -0.605  1.75 -1.29     1 -0.536  -0.0692
## 18 cluster02 obs07 0.290 -0.605  1.75 -1.29     0 -1.18    0.570 
## 19 cluster02 obs08 0.290 -0.605  1.75 -1.29     1  1.21    1.67  
## 20 cluster02 obs09 0.290 -0.605  1.75 -1.29     0  0.481   2.23  
## # ℹ 915 more rows
radon compl pool sim.radon compl pool radon no pool sim.radon no pool radon partial pool sim.radon partial pool
(Intercept) 1.327*** 1.471*** 0.618 2.017*** 1.463*** 1.464***
(0.030) (0.030) (0.431) (0.245) (0.054) (0.046)
first_floor -0.613*** -0.732*** 0.171 -1.868** -0.681*** -0.703***
(0.073) (0.064) (0.862) (0.574) (0.088) (0.061)
countyANOKA 0.285
(0.444)
countyBECKER 0.841
(0.862)
countyBELTRAMI 1.085+
(0.610)
countyBENTON 0.697
(0.610)
countyBIG STONE 0.895
(0.610)
countyBLUE EARTH 1.242*
(0.482)
countyBROWN 1.490*
(0.682)
countyCARLTON 0.225
(0.498)
countyCARVER 1.145+
(0.610)
countyCASS 0.783
(0.545)
countyCHIPPEWA 1.113+
(0.570)
countyCHISAGO 0.421
(0.528)
countyCLAY 1.478**
(0.492)
countyCLEARWATER 0.606
(0.682)
countyCOOK 0.047
(0.682)
countyCOTTONWOOD 1.299
(0.862)
countyCROW WING 0.324
(0.498)
countyDAKOTA 0.734+
(0.442)
countyDODGE 1.183+
(0.610)
countyDOUGLAS 1.079*
(0.506)
countyFARIBAULT -0.050
(0.545)
countyFILLMORE 0.545
(0.862)
countyFREEBORN 1.520**
(0.515)
countyGOODHUE 1.187*
(0.482)
countyHENNEPIN 0.756+
(0.438)
countyHOUSTON 1.093+
(0.570)
countyHUBBARD 0.348
(0.682)
countyISANTI 0.438
(0.610)
countyITASCA 0.308
(0.486)
countyJACKSON 1.403*
(0.545)
countyKANABEC 0.619
(0.570)
countyKANDIYOHI 1.444*
(0.570)
countyKITTSON 1.314
(0.862)
countyKOOCHICHING -0.329
(0.610)
countyLAC QUI PARLE 2.155*
(0.862)
countyLAKE -0.288
(0.506)
countyLAKE OF THE WOODS 1.136+
(0.682)
countyLE SUEUR 1.028+
(0.570)
countyLINCOLN 1.812**
(0.610)
countyLYON 1.252*
(0.515)
countyMAHNOMEN 0.743
(0.862)
countyMARSHALL 1.930***
(0.570)
countyMARTIN 0.592
(0.528)
countyMCLEOD 0.767
(0.498)
countyMEEKER 0.597
(0.545)
countyMILLE LACS 1.123
(0.862)
countyMORRISON 0.447
(0.506)
countyMOWER 1.230*
(0.486)
countyMURRAY 1.875*
(0.862)
countyNICOLLET 1.547**
(0.570)
countyNOBLES 1.310*
(0.610)
countyNORMAN 0.663
(0.682)
countyOLMSTED 0.771+
(0.462)
countyOTTER TAIL 0.865
(0.545)
countyPENNINGTON 1.140
(0.862)
countyPINE 0.116
(0.545)
countyPIPESTONE 1.137+
(0.610)
countyPOLK 1.479*
(0.682)
countyPOPE 0.662
(0.682)
countyRAMSEY 0.455
(0.453)
countyREDWOOD 0.923
(0.570)
countyRENVILLE 0.649
(0.682)
countyRICE 1.255*
(0.492)
countyROCK 0.681
(0.682)
countyROSEAU 0.975+
(0.528)
countySCOTT 0.933+
(0.498)
countySHERBURNE 0.472
(0.506)
countySIBLEY 0.625
(0.570)
countyST LOUIS 0.228
(0.438)
countySTEARNS 0.919*
(0.461)
countySTEELE 0.962+
(0.492)
countySTEVENS 1.174+
(0.682)
countySWIFT 0.369
(0.570)
countyTODD 0.712
(0.682)
countyTRAVERSE 1.465*
(0.610)
countyWABASHA 1.372**
(0.528)
countyWADENA 0.776
(0.610)
countyWASECA -0.003
(0.610)
countyWASHINGTON 0.747+
(0.447)
countyWATONWAN 2.007*
(0.862)
countyWILKIN 1.612+
(0.862)
countyWINONA 1.322**
(0.492)
countyWRIGHT 1.035*
(0.482)
countyYELLOW MEDICINE 0.569
(0.682)
first_floor × countyANOKA -1.383
(0.970)
first_floor × countyBECKER -0.786
(1.257)
first_floor × countyBELTRAMI -1.153
(1.034)
first_floor × countyBENTON -0.421
(1.219)
first_floor × countyBLUE EARTH 0.179
(1.034)
first_floor × countyBROWN -1.127
(1.141)
first_floor × countyCARLTON 0.709
(1.167)
first_floor × countyCARVER -1.289
(1.056)
first_floor × countyCLAY -1.268
(0.969)
first_floor × countyCLEARWATER -0.663
(1.141)
first_floor × countyCOTTONWOOD -1.747
(1.219)
first_floor × countyCROW WING -0.173
(0.996)
first_floor × countyDAKOTA -1.104
(0.945)
first_floor × countyDOUGLAS -0.560
(1.171)
first_floor × countyFARIBAULT -0.476
(1.188)
first_floor × countyFILLMORE -0.418
(1.363)
first_floor × countyFREEBORN -1.053
(1.050)
first_floor × countyGOODHUE 0.132
(1.034)
first_floor × countyHENNEPIN -1.013
(0.894)
first_floor × countyHOUSTON -0.703
(1.078)
first_floor × countyHUBBARD -0.432
(1.099)
first_floor × countyKITTSON -1.403
(1.257)
first_floor × countyKOOCHICHING 0.037
(1.034)
first_floor × countyLAC QUI PARLE -0.519
(1.363)
first_floor × countyLAKE -0.238
(1.171)
first_floor × countyLAKE OF THE WOODS -0.662
(1.141)
first_floor × countyLE SUEUR -0.382
(1.200)
first_floor × countyLINCOLN -1.348
(1.219)
first_floor × countyLYON -0.109
(1.175)
first_floor × countyMARSHALL -2.593**
(0.997)
first_floor × countyMARTIN -2.074+
(1.181)
first_floor × countyMCLEOD -1.181
(0.972)
first_floor × countyMILLE LACS -2.604+
(1.363)
first_floor × countyMORRISON -0.136
(1.171)
first_floor × countyMOWER -1.840+
(1.036)
first_floor × countyNORMAN -0.982
(1.257)
first_floor × countyOLMSTED -1.521
(0.978)
first_floor × countyOTTER TAIL -0.529
(1.020)
first_floor × countyPENNINGTON -1.876
(1.257)
first_floor × countyPINE -0.722
(1.188)
first_floor × countyPIPESTONE -0.467
(1.219)
first_floor × countyPOLK -1.641
(1.141)
first_floor × countyRAMSEY 0.027
(0.974)
first_floor × countyREDWOOD 1.318
(1.200)
first_floor × countyRENVILLE 0.320
(1.257)
first_floor × countyRICE -1.168
(1.165)
first_floor × countyROSEAU -0.764
(0.952)
first_floor × countySCOTT -0.070
(0.972)
first_floor × countyST LOUIS -0.735
(0.885)
first_floor × countySTEARNS -1.170
(0.954)
first_floor × countyTODD 0.292
(1.257)
first_floor × countyTRAVERSE -1.189
(1.219)
first_floor × countyWABASHA -2.065+
(1.181)
first_floor × countyWADENA -1.161
(1.099)
first_floor × countyWASECA -0.891
(1.219)
first_floor × countyWASHINGTON -1.218
(0.932)
first_floor × countyWATONWAN -0.764
(1.257)
first_floor × countyWINONA -2.265*
(0.992)
first_floor × countyWRIGHT -0.991
(1.161)
countycluster02 -0.558
(0.370)
countycluster03 -0.543
(0.357)
countycluster04 -0.458
(0.346)
countycluster05 -0.571
(0.357)
countycluster06 -1.066**
(0.370)
countycluster07 -0.661+
(0.370)
countycluster08 -0.782*
(0.370)
countycluster09 -0.245
(0.330)
countycluster10 -0.740*
(0.357)
countycluster11 -0.684*
(0.346)
countycluster12 -0.962**
(0.346)
countycluster13 -0.108
(0.337)
countycluster14 -0.884*
(0.346)
countycluster15 -0.070
(0.357)
countycluster16 -0.576+
(0.346)
countycluster17 -0.638+
(0.337)
countycluster18 -0.039
(0.330)
countycluster19 -0.379
(0.337)
countycluster20 -0.538
(0.346)
countycluster21 -0.171
(0.370)
countycluster22 -0.294
(0.337)
countycluster23 -0.289
(0.330)
countycluster24 -0.643+
(0.346)
countycluster25 -0.408
(0.357)
countycluster26 -0.590+
(0.346)
countycluster27 -1.299***
(0.357)
countycluster28 -1.319***
(0.337)
countycluster29 -0.597+
(0.357)
countycluster30 -0.694+
(0.370)
countycluster31 -1.305***
(0.357)
countycluster32 -0.124
(0.346)
countycluster33 -0.597
(0.387)
countycluster34 -0.824*
(0.370)
countycluster35 -1.110**
(0.337)
countycluster36 0.088
(0.357)
countycluster37 -1.308***
(0.337)
countycluster38 -1.331***
(0.346)
countycluster39 -0.117
(0.337)
countycluster40 -0.872*
(0.357)
countycluster41 -1.081**
(0.357)
countycluster42 -0.451
(0.387)
countycluster43 -0.600
(0.370)
countycluster44 -0.171
(0.357)
countycluster45 0.416
(0.357)
countycluster46 -0.264
(0.346)
countycluster47 -0.330
(0.330)
countycluster48 -0.905*
(0.387)
countycluster49 -0.395
(0.346)
countycluster50 -0.968*
(0.410)
countycluster51 -1.213***
(0.357)
countycluster52 -0.164
(0.370)
countycluster53 -0.298
(0.357)
countycluster54 -0.585+
(0.346)
countycluster55 -0.363
(0.337)
countycluster56 -0.699*
(0.346)
countycluster57 -0.885*
(0.370)
countycluster58 -0.656+
(0.357)
countycluster59 -1.088**
(0.387)
countycluster60 -0.359
(0.357)
countycluster61 -0.328
(0.346)
countycluster62 -0.608+
(0.346)
countycluster63 0.088
(0.337)
countycluster64 -0.359
(0.330)
countycluster65 -1.268***
(0.346)
countycluster66 -0.576+
(0.346)
countycluster67 -0.535
(0.357)
countycluster68 -0.907*
(0.357)
countycluster69 0.027
(0.346)
countycluster70 0.088
(0.357)
countycluster71 -1.386***
(0.330)
countycluster72 -0.472
(0.346)
countycluster73 -0.369
(0.357)
countycluster74 -0.552
(0.387)
countycluster75 -0.033
(0.346)
countycluster76 -0.647+
(0.337)
countycluster77 -0.275
(0.337)
countycluster78 -1.222***
(0.357)
countycluster79 -0.269
(0.346)
countycluster80 -0.609+
(0.346)
countycluster81 -0.440
(0.346)
countycluster82 0.380
(0.337)
countycluster83 -1.308***
(0.370)
countycluster84 -0.509
(0.346)
countycluster85 -0.024
(0.370)
first_floor × countycluster02 1.077
(0.736)
first_floor × countycluster03 0.472
(0.760)
first_floor × countycluster04 1.058
(0.812)
first_floor × countycluster05 0.619
(0.760)
first_floor × countycluster06 1.348+
(0.736)
first_floor × countycluster07 1.059
(0.736)
first_floor × countycluster08 1.194
(0.736)
first_floor × countycluster10 1.834*
(0.760)
first_floor × countycluster11 0.788
(0.812)
first_floor × countycluster12 1.977*
(0.812)
first_floor × countycluster13 2.044*
(0.961)
first_floor × countycluster14 2.144**
(0.812)
first_floor × countycluster15 1.066
(0.760)
first_floor × countycluster16 0.788
(0.812)
first_floor × countycluster17 1.701+
(0.961)
first_floor × countycluster19 -1.413
(0.961)
first_floor × countycluster20 1.102
(0.812)
first_floor × countycluster21 1.691*
(0.736)
first_floor × countycluster22 1.940*
(0.961)
first_floor × countycluster24 0.463
(0.812)
first_floor × countycluster25 0.805
(0.760)
first_floor × countycluster26 1.442+
(0.812)
first_floor × countycluster27 0.315
(0.760)
first_floor × countycluster28 2.393*
(0.961)
first_floor × countycluster29 1.871*
(0.760)
first_floor × countycluster30 1.144
(0.736)
first_floor × countycluster31 2.563***
(0.760)
first_floor × countycluster32 0.127
(0.812)
first_floor × countycluster33 1.150
(0.726)
first_floor × countycluster34 1.326+
(0.736)
first_floor × countycluster35 1.208
(0.961)
first_floor × countycluster36 1.686*
(0.760)
first_floor × countycluster37 2.523**
(0.961)
first_floor × countycluster38 0.650
(0.812)
first_floor × countycluster39 0.345
(0.961)
first_floor × countycluster40 1.465+
(0.760)
first_floor × countycluster41 1.725*
(0.760)
first_floor × countycluster42 1.427*
(0.726)
first_floor × countycluster43 1.468*
(0.736)
first_floor × countycluster44 1.593*
(0.760)
first_floor × countycluster45 0.600
(0.760)
first_floor × countycluster46 0.146
(0.812)
first_floor × countycluster48 1.638*
(0.726)
first_floor × countycluster49 1.790*
(0.812)
first_floor × countycluster50 0.833
(0.726)
first_floor × countycluster51 1.144
(0.760)
first_floor × countycluster52 1.400+
(0.736)
first_floor × countycluster53 1.357+
(0.760)
first_floor × countycluster54 0.802
(0.812)
first_floor × countycluster55 2.067*
(0.961)
first_floor × countycluster56 1.563+
(0.812)
first_floor × countycluster57 1.821*
(0.736)
first_floor × countycluster58 0.632
(0.760)
first_floor × countycluster59 1.193
(0.726)
first_floor × countycluster60 0.819
(0.760)
first_floor × countycluster61 0.451
(0.812)
first_floor × countycluster62 0.656
(0.812)
first_floor × countycluster63 1.105
(0.961)
first_floor × countycluster65 0.863
(0.812)
first_floor × countycluster66 1.543+
(0.812)
first_floor × countycluster67 0.813
(0.760)
first_floor × countycluster68 1.400+
(0.760)
first_floor × countycluster69 0.812
(0.812)
first_floor × countycluster70 0.642
(0.760)
first_floor × countycluster72 1.712*
(0.812)
first_floor × countycluster73 1.201
(0.760)
first_floor × countycluster74 1.434*
(0.726)
first_floor × countycluster75 1.261
(0.812)
first_floor × countycluster76 -0.706
(0.961)
first_floor × countycluster77 1.809+
(0.961)
first_floor × countycluster78 1.154
(0.760)
first_floor × countycluster79 1.200
(0.812)
first_floor × countycluster80 1.782*
(0.812)
first_floor × countycluster81 0.434
(0.812)
first_floor × countycluster82 0.796
(0.961)
first_floor × countycluster83 1.450*
(0.736)
first_floor × countycluster84 0.631
(0.812)
first_floor × countycluster85 1.359+
(0.736)
SD (Intercept county) 0.349 0.336
SD (first_floor county) 0.344 0.120
Cor (Intercept~first_floor county) -0.337 0.068
SD (Observations) 0.746 0.739
Num.Obs. 919 935 919 935 919 935
R2 0.072 0.124 0.354 0.410
R2 Adj. 0.071 0.123 0.234 0.285
R2 Marg. 0.086 0.115
R2 Cond. 0.257 0.271
AIC 2253.0 2271.3 2205.4 2226.1 2180.3 2211.2
BIC 2267.5 2285.8 2909.6 3024.7 2209.3 2240.3
ICC 0.2 0.2
Log.Lik. -1123.512 -1132.651 -956.680 -948.028
RMSE 0.82 0.81 0.69 0.67 0.72 0.71
+ p < 0.1, * p < 0.05, ** p < 0.01, *** p < 0.001

Interpretation:

Based on the table summarizing the model, we can see that both the complete model and partial models are quite similar for both datasets. This is also reflected in the graphs of the first 17 counties and by the model comparison parameters at the end of the table.

In contrast, the no pooled model is different is rather different between the original radon dataset and the simulated dataset. This is likely caused by the fact that in the simulated data, al counties have the same observations, which is not the case in the original dataset. We should further explore the simulation to be able to adjust this. It makes sense that this is mainly reflected in the no pooled model, since the clusters are evaluated here separately.