This week we used ProjectSTAR data again, which is…“a sample of more than 6,000 students nested within 200+ schools collected between 1985 and 1990 as part of the Tennessee Class Size Experiment.” -Dr. Broda (Module 7)
#Load in our MVP packages
suppressPackageStartupMessages(library(tidyverse))
library(lme4)
library(Hmisc)
projectSTAR <- haven::read_dta("projectSTAR.dta")
glimpse(projectSTAR)
Rows: 6,325
Columns: 27
$ stdntid <dbl> 10001, 10133, 10246, 10263, 10266, 10275, 10281, 10282, 10285, 10286, 10287, 10289, 10290, 10291, 10292, 10294, 10295, 10299, 10300, 10302, 1…
$ race <dbl+lbl> 1, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 1, 2, 2, 2, 2, 2, 2,…
$ gender <dbl+lbl> 1, 1, 2, 2, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 2, 2, 1, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 1,…
$ FLAGSGK <dbl+lbl> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,…
$ flaggk <dbl+lbl> 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0,…
$ gkclasstype <dbl+lbl> 3, 3, 3, 1, 2, 3, 1, 3, 1, 2, 3, 3, 2, 3, 3, 3, 1, 2, 3, 3, 2, 1, 1, 3, 2, 1, 1, 2, 3, 2, 3, 3, 3, 2, 3, 2, 3, 3, 1, 1, 3, 1, 3, 1, 3, 1,…
$ gkschid <dbl> 169229, 169280, 218562, 205492, 257899, 161176, 189382, 189382, 201449, 230612, 128068, 262937, 169219, 169229, 205491, 159171, 161176, 16821…
$ gksurban <dbl+lbl> 2, 2, 4, 2, 3, 3, 2, 2, 3, 3, 3, 2, 2, 2, 2, 3, 3, 3, 3, 3, 2, 1, 2, 3, 1, 4, 2, 3, 2, 3, 4, 3, 2, 2, 2, 3, 2, 2, 4, 3, 1, 1, 1, 1, 1, 1,…
$ gktchid <dbl> 16922904, 16928003, 21856202, 20549204, 25789904, 16117602, 18938204, 18938203, 20144901, 23061203, 12806803, 26293701, 16921902, 16922904, 2…
$ gktgen <dbl+lbl> 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,…
$ gktrace <dbl+lbl> 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 2, 1, NA, 1, 1, 1, …
$ gkthighdegree <dbl+lbl> 2, 2, 3, 2, 3, 2, 3, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 2, 2, 3, 2, 2, 3, 2, 2, 3, 3, 2, 2, 2, NA, 2, 2, 3, …
$ gktcareer <dbl+lbl> 4, 4, 4, 4, 4, NA, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, NA, 2, 4, 4, 2, 4, 4, 4, 4, NA, NA, 4, 4, 6, …
$ gktyears <dbl> 5, 7, 8, 3, 12, 2, 7, 14, 4, 6, 11, 16, 12, 5, 17, 10, 6, 10, 13, 9, 18, 1, 7, 13, 1, 14, 18, 8, 8, 4, NA, 13, 17, 15, 16, 13, 3, 17, 11, 2, …
$ gkclasssize <dbl> 24, 22, 17, 17, 24, 24, 13, 24, 14, 23, 23, 22, 20, 24, 23, 27, 17, 24, 22, 23, 22, 17, 13, 18, 20, 14, 14, 23, 24, 24, 21, 18, 23, 19, 22, 2…
$ gkfreelunch <dbl+lbl> 2, 2, 2, 1, 2, 2, 2, 1, 1, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 1, 2, 2, 2, 2, 2, 1, 2, 2, 2, 1, 2, 1, 2, 2, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, 1,…
$ gkrepeat <dbl+lbl> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,…
$ gkspeced <dbl+lbl> 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 1, 2, 2,…
$ gkspecin <dbl+lbl> 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,…
$ gkpresent <dbl> 161, 175, 132, 178, 170, 94, 160, 154, 172, 95, 163, 172, 180, 149, 173, NA, 160, 173, 170, 161, 128, 151, 64, 84, 145, 160, 161, 177, 154, 1…
$ gkabsent <dbl> 19, 5, 28, 2, 10, 3, 2, 7, 8, 2, 17, 8, 0, 31, 7, NA, 20, 7, 2, 19, 24, 0, 8, 9, 7, 4, 19, 3, 3, 4, 15, 26, 6, 5, 10, 3, 15, 13, 2, 1, 12, 7,…
$ gktreadss <dbl> NA, 427, 450, 483, 456, 411, 443, 448, 463, 472, 428, 545, 408, 422, 472, NA, 437, 450, 497, 460, 408, NA, 467, 403, 411, 490, 503, NA, 442, …
$ gktmathss <dbl> NA, 478, 494, 513, 513, 468, 473, 449, 520, 536, 484, 626, 454, 439, 528, NA, 463, 484, 547, 576, 449, NA, 576, 392, 444, 559, 576, NA, 547, …
$ gktlistss <dbl> NA, 509, 549, 554, 520, 571, 595, 540, 565, 595, NA, 622, 474, 536, 578, NA, 554, 565, 524, 595, 512, NA, 565, 501, 505, 595, 671, NA, 532, 5…
$ gkwordskillss <dbl> NA, 418, 444, 431, 468, 396, 444, 444, 480, 486, 423, 524, 410, 423, 458, NA, 427, 435, 512, 449, 405, NA, 480, 410, 405, 512, 480, NA, 435, …
$ gkmotivraw <dbl> 23, 24, 28, 27, 25, 24, NA, NA, 26, 27, 24, 24, 23, 28, 24, NA, 26, 25, NA, 26, 25, 29, NA, 24, 26, 24, 25, 28, NA, 27, NA, 17, 24, 23, 25, 2…
$ gkselfconcraw <dbl> 52, 53, 56, 61, 54, 55, NA, NA, 52, 61, 55, 49, 49, 59, 50, NA, 58, 45, NA, 55, 52, 64, NA, 49, 58, 57, 52, 60, NA, 61, NA, 31, 58, 52, 56, 5…
##Part 1: Running our “Final” 2-level Model…DV=gktmathss (math scores), Student level IV: gkselfconcraw (self-concept), gkclasstype (classroom type) and gkthighdegree (teacher highest degree) as teacher/classroom level IVs.
model.final <- lmer(gktmathss ~ gkselfconcraw + gkclasstype + gkthighdegree + (1|gktchid), REML = FALSE, data = projectSTAR)
summary(model.final)
Linear mixed model fit by maximum likelihood ['lmerMod']
Formula: gktmathss ~ gkselfconcraw + gkclasstype + gkthighdegree + (1 | gktchid)
Data: projectSTAR
AIC BIC logLik deviance df.resid
49055.9 49094.8 -24522.0 49043.9 4750
Scaled residuals:
Min 1Q Median 3Q Max
-3.8391 -0.6386 -0.0618 0.5814 3.8970
Random effects:
Groups Name Variance Std.Dev.
gktchid (Intercept) 663.4 25.76
Residual 1550.2 39.37
Number of obs: 4756, groups: gktchid, 301
Fixed effects:
Estimate Std. Error t value
(Intercept) 464.8157 10.1601 45.749
gkselfconcraw 0.4458 0.1196 3.726
gkclasstype -4.6260 1.9336 -2.392
gkthighdegree 2.7561 2.7143 1.015
Correlation of Fixed Effects:
(Intr) gkslfc gkclss
gkselfcncrw -0.660
gkclasstype -0.377 0.017
gkthighdegr -0.630 -0.010 -0.002
##Part 2: Begin to check assumptions ##Question 2: Use the “augment” function from the broom.mixed Package to Get Predictions, Residuals, Cook’s Distances, Etc.:
library(broom.mixed)
diagnostics <- augment(model.final)
##Part 2 ##Question 2 cont’d: Assess Normality of Residuals (Visually, with a Histogram)
ggplot(data = diagnostics, mapping = aes(x = .resid)) +
geom_histogram(binwidth = .25) + theme_classic() +
labs(title = "Histogram of Residuals for Math Scores Model",
x = "Residual Value") +
geom_vline(xintercept = c(-2.5, 2.5), linetype = "dotted")
##Part 2 ##Question 2 cont’d: Shapiro Wilk Test
shapiro.test(diagnostics$.resid)
Shapiro-Wilk normality test
data: diagnostics$.resid
W = 0.99119, p-value < 2.2e-16
##Question 3: Use Residuals vs. Fitted (RVF) Plot to Assess Homoskedasticity of Errors (Basic RVF Plot, Without Groups)
ggplot(data = diagnostics, mapping = aes(x = .fitted, y = .resid)) +
geom_point() + labs(title = "RVF Plot for Math Scores Model",
x = "Predicted Value, Math Scores",
y = "Residual Value") + theme_classic()
##trying same thing with color…???
ggplot(data = diagnostics, mapping = aes(x = .fitted, y = .resid, color = gktchid)) +
geom_point() + labs(title = "RVF Plot for Math Scores Model, by Kindergarten ID",
x = "Predicted Value, Math Scores",
y = "Residual Value") + theme_classic()
##attempt to make gktchid more meaningful…(is that even possible?)
math.clean <- projectSTAR %>%
mutate(.,
gktchid_1000 = gktchid/10000)
glimpse(math.clean)
Rows: 6,325
Columns: 28
$ stdntid <dbl> 10001, 10133, 10246, 10263, 10266, 10275, 10281, 10282, 10285, 10286, 10287, 10289, 10290, 10291, 10292, 10294, 10295, 10299, 10300, 10302, 1…
$ race <dbl+lbl> 1, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 1, 2, 2, 2, 2, 2, 2,…
$ gender <dbl+lbl> 1, 1, 2, 2, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 2, 2, 1, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 1,…
$ FLAGSGK <dbl+lbl> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,…
$ flaggk <dbl+lbl> 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0,…
$ gkclasstype <dbl+lbl> 3, 3, 3, 1, 2, 3, 1, 3, 1, 2, 3, 3, 2, 3, 3, 3, 1, 2, 3, 3, 2, 1, 1, 3, 2, 1, 1, 2, 3, 2, 3, 3, 3, 2, 3, 2, 3, 3, 1, 1, 3, 1, 3, 1, 3, 1,…
$ gkschid <dbl> 169229, 169280, 218562, 205492, 257899, 161176, 189382, 189382, 201449, 230612, 128068, 262937, 169219, 169229, 205491, 159171, 161176, 16821…
$ gksurban <dbl+lbl> 2, 2, 4, 2, 3, 3, 2, 2, 3, 3, 3, 2, 2, 2, 2, 3, 3, 3, 3, 3, 2, 1, 2, 3, 1, 4, 2, 3, 2, 3, 4, 3, 2, 2, 2, 3, 2, 2, 4, 3, 1, 1, 1, 1, 1, 1,…
$ gktchid <dbl> 16922904, 16928003, 21856202, 20549204, 25789904, 16117602, 18938204, 18938203, 20144901, 23061203, 12806803, 26293701, 16921902, 16922904, 2…
$ gktgen <dbl+lbl> 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,…
$ gktrace <dbl+lbl> 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 2, 1, NA, 1, 1, 1, …
$ gkthighdegree <dbl+lbl> 2, 2, 3, 2, 3, 2, 3, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 2, 2, 3, 2, 2, 3, 2, 2, 3, 3, 2, 2, 2, NA, 2, 2, 3, …
$ gktcareer <dbl+lbl> 4, 4, 4, 4, 4, NA, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, NA, 2, 4, 4, 2, 4, 4, 4, 4, NA, NA, 4, 4, 6, …
$ gktyears <dbl> 5, 7, 8, 3, 12, 2, 7, 14, 4, 6, 11, 16, 12, 5, 17, 10, 6, 10, 13, 9, 18, 1, 7, 13, 1, 14, 18, 8, 8, 4, NA, 13, 17, 15, 16, 13, 3, 17, 11, 2, …
$ gkclasssize <dbl> 24, 22, 17, 17, 24, 24, 13, 24, 14, 23, 23, 22, 20, 24, 23, 27, 17, 24, 22, 23, 22, 17, 13, 18, 20, 14, 14, 23, 24, 24, 21, 18, 23, 19, 22, 2…
$ gkfreelunch <dbl+lbl> 2, 2, 2, 1, 2, 2, 2, 1, 1, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 1, 2, 2, 2, 2, 2, 1, 2, 2, 2, 1, 2, 1, 2, 2, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, 1,…
$ gkrepeat <dbl+lbl> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,…
$ gkspeced <dbl+lbl> 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 1, 2, 2,…
$ gkspecin <dbl+lbl> 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,…
$ gkpresent <dbl> 161, 175, 132, 178, 170, 94, 160, 154, 172, 95, 163, 172, 180, 149, 173, NA, 160, 173, 170, 161, 128, 151, 64, 84, 145, 160, 161, 177, 154, 1…
$ gkabsent <dbl> 19, 5, 28, 2, 10, 3, 2, 7, 8, 2, 17, 8, 0, 31, 7, NA, 20, 7, 2, 19, 24, 0, 8, 9, 7, 4, 19, 3, 3, 4, 15, 26, 6, 5, 10, 3, 15, 13, 2, 1, 12, 7,…
$ gktreadss <dbl> NA, 427, 450, 483, 456, 411, 443, 448, 463, 472, 428, 545, 408, 422, 472, NA, 437, 450, 497, 460, 408, NA, 467, 403, 411, 490, 503, NA, 442, …
$ gktmathss <dbl> NA, 478, 494, 513, 513, 468, 473, 449, 520, 536, 484, 626, 454, 439, 528, NA, 463, 484, 547, 576, 449, NA, 576, 392, 444, 559, 576, NA, 547, …
$ gktlistss <dbl> NA, 509, 549, 554, 520, 571, 595, 540, 565, 595, NA, 622, 474, 536, 578, NA, 554, 565, 524, 595, 512, NA, 565, 501, 505, 595, 671, NA, 532, 5…
$ gkwordskillss <dbl> NA, 418, 444, 431, 468, 396, 444, 444, 480, 486, 423, 524, 410, 423, 458, NA, 427, 435, 512, 449, 405, NA, 480, 410, 405, 512, 480, NA, 435, …
$ gkmotivraw <dbl> 23, 24, 28, 27, 25, 24, NA, NA, 26, 27, 24, 24, 23, 28, 24, NA, 26, 25, NA, 26, 25, 29, NA, 24, 26, 24, 25, 28, NA, 27, NA, 17, 24, 23, 25, 2…
$ gkselfconcraw <dbl> 52, 53, 56, 61, 54, 55, NA, NA, 52, 61, 55, 49, 49, 59, 50, NA, 58, 45, NA, 55, 52, 64, NA, 49, 58, 57, 52, 60, NA, 61, NA, 31, 58, 52, 56, 5…
$ gktchid_1000 <dbl> 1692.290, 1692.800, 2185.620, 2054.920, 2578.990, 1611.760, 1893.820, 1893.820, 2014.490, 2306.120, 1280.680, 2629.370, 1692.190, 1692.290, 2…
##redo the color plot to see if it is easier to see what is going…
ggplot(data = diagnostics, mapping = aes(x = .fitted, y = .resid, color = gktchid_1000)) +
geom_point() + labs(title = "RVF Plot for Math Scores Model, by Kindergarten ID",
x = "Predicted Value, Math Scores",
y = "Residual Value") + theme_classic()
##Oh I don’t think it is working because I did not include this divided variable in my original “final model” Moving on :)
##Question 4: Using Cook’s Distance to Identify Outliers
ggplot(data = diagnostics, mapping = aes(x = .fitted, y = .cooksd, label = gktchid)) +
geom_point() + geom_text(nudge_x = .25) + theme_classic() +
labs(title = "Cook's Distance Plot for Math Scores Model",
x = "Predicted Value, % Math Scores",
y = "Cook's Distance") +
geom_hline(yintercept = 4/816, linetype = "dotted")
##Part 3 ##Robustness check! AKA:re-Run Model with Robust Standard Errors
library(robustlmm)
model.robust <- rlmer(gktmathss ~ gkselfconcraw + gkclasstype + gkthighdegree + (1|gktchid), REML=FALSE, data = projectSTAR)
summary(model.robust)
Robust linear mixed model fit by DAStau
Formula: gktmathss ~ gkselfconcraw + gkclasstype + gkthighdegree + (1 | gktchid)
Data: projectSTAR
Scaled residuals:
Min 1Q Median 3Q Max
-4.1521 -0.6275 -0.0298 0.6357 4.1638
Random effects:
Groups Name Variance Std.Dev.
gktchid (Intercept) 619.8 24.90
Residual 1396.2 37.37
Number of obs: 4756, groups: gktchid, 301
Fixed effects:
Estimate Std. Error t value
(Intercept) 461.6699 9.9800 46.26
gkselfconcraw 0.4537 0.1165 3.89
gkclasstype -4.0642 1.9121 -2.13
gkthighdegree 2.7485 2.6839 1.02
Correlation of Fixed Effects:
(Intr) gkslfc gkclss
gkselfcncrw -0.654
gkclasstype -0.379 0.017
gkthighdegr -0.635 -0.009 -0.002
Robustness weights for the residuals:
3806 weights are ~= 1. The remaining 950 ones are summarized as
Min. 1st Qu. Median Mean 3rd Qu. Max.
0.323 0.642 0.809 0.775 0.937 0.999
Robustness weights for the random effects:
241 weights are ~= 1. The remaining 60 ones are summarized as
Min. 1st Qu. Median Mean 3rd Qu. Max.
0.353 0.667 0.889 0.810 0.971 0.998
Rho functions used for fitting:
Residuals:
eff: smoothed Huber (k = 1.345, s = 10)
sig: smoothed Huber, Proposal II (k = 1.345, s = 10)
Random Effects, variance component 1 (gktchid):
eff: smoothed Huber (k = 1.345, s = 10)
vcp: smoothed Huber, Proposal II (k = 1.345, s = 10)
##re-run model with outliers removed (Cook’s Distance >.10)
STAR.trimmed <- diagnostics %>%
filter(., .cooksd < .10)
model.trimmed <- lmer(gktmathss ~ gkselfconcraw + gkclasstype + gkthighdegree + (1|gktchid), REML=FALSE, data = STAR.trimmed)
summary(model.trimmed)
Linear mixed model fit by maximum likelihood ['lmerMod']
Formula: gktmathss ~ gkselfconcraw + gkclasstype + gkthighdegree + (1 | gktchid)
Data: STAR.trimmed
AIC BIC logLik deviance df.resid
47346.0 47384.7 -23667.0 47334.0 4657
Scaled residuals:
Min 1Q Median 3Q Max
-3.05922 -0.65534 -0.04224 0.61962 3.08934
Random effects:
Groups Name Variance Std.Dev.
gktchid (Intercept) 704.3 26.54
Residual 1300.7 36.06
Number of obs: 4663, groups: gktchid, 301
Fixed effects:
Estimate Std. Error t value
(Intercept) 461.5853 9.9617 46.336
gkselfconcraw 0.4567 0.1113 4.102
gkclasstype -4.0598 1.9670 -2.064
gkthighdegree 2.8253 2.7594 1.024
Correlation of Fixed Effects:
(Intr) gkslfc gkclss
gkselfcncrw -0.627
gkclasstype -0.390 0.017
gkthighdegr -0.655 -0.009 -0.002
##Now time to make a table to compare original “final” model, Robust Model and Trimmed Model for Differences (sensetivity analysis)
library(modelsummary)
models <- list(model.final, model.trimmed)
modelsummary(models, output = "markdown")
| Model 1 | Model 2 | |
|---|---|---|
| (Intercept) | 464.816 | 461.585 |
| (10.160) | (9.962) | |
| gkselfconcraw | 0.446 | 0.457 |
| (0.120) | (0.111) | |
| gkclasstype | -4.626 | -4.060 |
| (1.934) | (1.967) | |
| gkthighdegree | 2.756 | 2.825 |
| (2.714) | (2.759) | |
| sd__(Intercept) | 25.756 | 26.539 |
| sd__Observation | 39.373 | 36.065 |
| AIC | 49055.9 | 47346.0 |
| BIC | 49094.8 | 47384.7 |
| Log.Lik. | -24521.975 | -23667.004 |