I am running some multilevel regressions. Somehow, the predictor "trst_means" appears twice in the regression summary (and probably distorts the results).
library(lme4)
swd.mod1 <- lmer(stfdem ~ 1+gndr+agea.rc+trst_means+icpdwk2+eisced.rc+hinctnta.rc+clsprty+polintr+(1|cntry),REML = T,data = ESS_subset)
summary(swd.mod1)
As you can see below, trst_means appears as trst_means2 and trst_means3.
Linear mixed model fit by REML ['lmerMod']
Formula: stfdem ~ 1 + gndr + agea.rc + trst_means + icpdwk2 + eisced.rc +
hinctnta.rc + clsprty + polintr + (1 | cntry)
Data: ESS_subset
REML criterion at convergence: 145674.3
Scaled residuals:
Min 1Q Median 3Q Max
-4.5415 -0.6089 0.0563 0.6537 3.6293
Random effects:
Groups Name Variance Std.Dev.
cntry (Intercept) 0.5894 0.7677
Residual 3.7336 1.9323
Number of obs: 35014, groups: cntry, 25
Fixed effects:
Estimate Std. Error t value
(Intercept) 3.852760 0.178131 21.629
gndr -0.146807 0.021119 -6.951
agea.rc 0.008464 0.006412 1.320
trst_means2 1.882941 0.024889 75.655
trst_means3 3.286516 0.042815 76.760
icpdwk2 0.056214 0.023767 2.365
eisced.rc 0.055574 0.014223 3.907
hinctnta.rc 0.214884 0.015703 13.684
clsprty -0.195291 0.022631 -8.629
polintr -0.001448 0.013307 -0.109
Trst_means is a variable I have recoded in the following way:
trstinst$trst_means.rc <- as.data.frame(sapply(trstinst, function(x)cut(x,
breaks = c(0, 3.6, 7.2, 10),
labels = c(1,2,3)))
)
Here would be an extract of the data frame I am working with:
df = dput(head(ESS_subset))
structure(list(idno = c(10105L, 10107L, 10109L, 10201L, 10202L,
10208L), cntry = c("BE", "BE", "BE", "BE", "BE", "BE"), stfdem = c(5L,
1L, 6L, 9L, 2L, 7L), gndr = c(1L, 1L, 2L, 2L, 2L, 1L), clsprty = c(2L,
2L, 2L, 2L, 1L, 1L), polintr = c(3L, 3L, 3L, 3L, 3L, 2L), icpdwk2 = c(2L,
1L, 2L, 1L, 1L, 1L), agea.rc = c(1, 3, 7, 2, 2, 3), hinctnta.rc = c(NA,
2, 1, 1, 2, 2), eisced.rc = c(2, 4, 2, 2, 2, 4), trst_means = c("2",
"1", "1", "2", "2", "2"), wl = c(NA_character_, NA_character_,
NA_character_, NA_character_, NA_character_, NA_character_),
wl = c(NA, NA, NA, NA, 0, 1)), row.names = c(NA, 6L), class = "data.frame")
Thank you!