Main Analysis Using lmer() Function
Determine the baseline model:Try to include all Lv1 and Lv2 predictors:
summary(RIM.Any.Sum.cat <- lmer(EmoProblem ~
SocialSecurity + SSI + AFDC + FoodStamp + Unemploy + Housing +
AnySS +
SumSS +
MoneyProblem + PerPoverty_bylevels_L2 + ModalRace_bylevels_L2 + Urbanicity_L2 + ModalEducation_bylevels_L2 +
(1 | CLUSTERID), data = dat2))
## fixed-effect model matrix is rank deficient so dropping 1 column / coefficient
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: EmoProblem ~ SocialSecurity + SSI + AFDC + FoodStamp + Unemploy +
## Housing + AnySS + SumSS + MoneyProblem + PerPoverty_bylevels_L2 +
## ModalRace_bylevels_L2 + Urbanicity_L2 + ModalEducation_bylevels_L2 +
## (1 | CLUSTERID)
## Data: dat2
##
## REML criterion at convergence: 34920.4
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -1.9984 -0.7185 -0.1835 0.5085 5.5004
##
## Random effects:
## Groups Name Variance Std.Dev.
## CLUSTERID (Intercept) 1.113 1.055
## Residual 52.958 7.277
## Number of obs: 5120, groups: CLUSTERID, 132
##
## Fixed effects:
## Estimate Std. Error df t value Pr(>|t|)
## (Intercept) 11.2277 1.2834 118.2025 8.749 1.77e-14 ***
## SocialSecurity -0.6201 0.4985 5090.8266 -1.244 0.21364
## SSI 0.8857 0.4948 5090.0928 1.790 0.07352 .
## AFDC 0.4642 0.5211 5106.1763 0.891 0.37316
## FoodStamp 0.5888 0.5185 5105.5185 1.136 0.25621
## Unemploy 0.4010 0.6167 5084.4677 0.650 0.51553
## Housing 0.7801 0.6267 5099.7273 1.245 0.21322
## AnySS 1.4196 0.5182 5087.9132 2.740 0.00617 **
## MoneyProblem 0.4128 0.2786 5097.6258 1.482 0.13852
## PerPoverty_bylevels_L2 0.1568 0.2213 130.3052 0.708 0.47991
## ModalRace_bylevels_L2 0.4969 0.3593 101.7262 1.383 0.16966
## Urbanicity_L2 -0.3485 0.2896 124.0409 -1.203 0.23120
## ModalEducation_bylevels_L2 -0.7083 0.4411 116.6082 -1.606 0.11103
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation matrix not shown by default, as p = 13 > 12.
## Use print(x, correlation=TRUE) or
## vcov(x) if you need it
## fit warnings:
## fixed-effect model matrix is rank deficient so dropping 1 column / coefficient
The fixed part has collinearity issue -> SumSS and the SS program categories cannot coexist in a model!
summary(RIM.Any <- lmer(EmoProblem ~
#SocialSecurity + SSI + AFDC + FoodStamp + Unemploy + Housing +
AnySS +
# SumSS +
MoneyProblem + PerPoverty_bylevels_L2 + ModalRace_bylevels_L2 + Urbanicity_L2 + ModalEducation_bylevels_L2 +
(1 | CLUSTERID), data = dat2))
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: EmoProblem ~ AnySS + MoneyProblem + PerPoverty_bylevels_L2 +
## ModalRace_bylevels_L2 + Urbanicity_L2 + ModalEducation_bylevels_L2 +
## (1 | CLUSTERID)
## Data: dat2
##
## REML criterion at convergence: 34939.5
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -1.9104 -0.7150 -0.1906 0.5113 5.4913
##
## Random effects:
## Groups Name Variance Std.Dev.
## CLUSTERID (Intercept) 1.135 1.066
## Residual 53.053 7.284
## Number of obs: 5120, groups: CLUSTERID, 132
##
## Fixed effects:
## Estimate Std. Error df t value Pr(>|t|)
## (Intercept) 11.1814 1.2893 119.1174 8.672 2.54e-14 ***
## AnySS 1.8997 0.2457 5083.7268 7.731 1.28e-14 ***
## MoneyProblem 0.5217 0.2759 5105.2692 1.891 0.0587 .
## PerPoverty_bylevels_L2 0.2101 0.2211 128.8209 0.950 0.3439
## ModalRace_bylevels_L2 0.5269 0.3605 102.0672 1.462 0.1469
## Urbanicity_L2 -0.4125 0.2900 123.6653 -1.423 0.1573
## ModalEducation_bylevels_L2 -0.6970 0.4433 117.6721 -1.572 0.1186
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation of Fixed Effects:
## (Intr) AnySS MnyPrb PP__L2 MR__L2 Urb_L2
## AnySS -0.044
## MoneyProblm -0.070 -0.183
## PrPvrty__L2 -0.528 -0.093 -0.005
## MdlRc_by_L2 -0.403 -0.038 0.005 -0.134
## Urbancty_L2 -0.373 0.035 0.040 -0.101 0.001
## MdlEdct__L2 -0.894 0.038 0.041 0.528 0.174 0.103
summary(RIM.Any.cat <- lmer(EmoProblem ~
SocialSecurity + SSI + AFDC + FoodStamp + Unemploy + Housing +
AnySS +
# SumSS +
MoneyProblem + PerPoverty_bylevels_L2 + ModalRace_bylevels_L2 + Urbanicity_L2 + ModalEducation_bylevels_L2 +
(1 | CLUSTERID), data = dat2))
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: EmoProblem ~ SocialSecurity + SSI + AFDC + FoodStamp + Unemploy +
## Housing + AnySS + MoneyProblem + PerPoverty_bylevels_L2 +
## ModalRace_bylevels_L2 + Urbanicity_L2 + ModalEducation_bylevels_L2 +
## (1 | CLUSTERID)
## Data: dat2
##
## REML criterion at convergence: 34920.4
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -1.9984 -0.7185 -0.1835 0.5085 5.5004
##
## Random effects:
## Groups Name Variance Std.Dev.
## CLUSTERID (Intercept) 1.113 1.055
## Residual 52.958 7.277
## Number of obs: 5120, groups: CLUSTERID, 132
##
## Fixed effects:
## Estimate Std. Error df t value Pr(>|t|)
## (Intercept) 11.2277 1.2834 118.2025 8.749 1.77e-14 ***
## SocialSecurity -0.6201 0.4985 5090.8266 -1.244 0.21364
## SSI 0.8857 0.4948 5090.0928 1.790 0.07352 .
## AFDC 0.4642 0.5211 5106.1763 0.891 0.37316
## FoodStamp 0.5888 0.5185 5105.5185 1.136 0.25621
## Unemploy 0.4010 0.6167 5084.4677 0.650 0.51553
## Housing 0.7801 0.6267 5099.7273 1.245 0.21322
## AnySS 1.4196 0.5182 5087.9132 2.740 0.00617 **
## MoneyProblem 0.4128 0.2786 5097.6258 1.482 0.13852
## PerPoverty_bylevels_L2 0.1568 0.2213 130.3052 0.708 0.47991
## ModalRace_bylevels_L2 0.4969 0.3593 101.7262 1.383 0.16966
## Urbanicity_L2 -0.3485 0.2896 124.0409 -1.203 0.23120
## ModalEducation_bylevels_L2 -0.7083 0.4411 116.6082 -1.606 0.11103
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation matrix not shown by default, as p = 13 > 12.
## Use print(x, correlation=TRUE) or
## vcov(x) if you need it
summary(RIM.Sum <- lmer(EmoProblem ~
# SocialSecurity + SSI + AFDC + FoodStamp + Unemploy + Housing +
# AnySS +
SumSS +
MoneyProblem + PerPoverty_bylevels_L2 + ModalRace_bylevels_L2 + Urbanicity_L2 + ModalEducation_bylevels_L2 +
(1 | CLUSTERID), data = dat2))
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: EmoProblem ~ SumSS + MoneyProblem + PerPoverty_bylevels_L2 +
## ModalRace_bylevels_L2 + Urbanicity_L2 + ModalEducation_bylevels_L2 +
## (1 | CLUSTERID)
## Data: dat2
##
## REML criterion at convergence: 34937.4
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -1.9275 -0.7160 -0.1851 0.5099 5.4892
##
## Random effects:
## Groups Name Variance Std.Dev.
## CLUSTERID (Intercept) 1.124 1.060
## Residual 53.024 7.282
## Number of obs: 5120, groups: CLUSTERID, 132
##
## Fixed effects:
## Estimate Std. Error df t value Pr(>|t|)
## (Intercept) 11.3131 1.2855 118.3052 8.801 1.33e-14 ***
## SumSS 1.0291 0.1295 5018.4752 7.947 2.35e-15 ***
## MoneyProblem 0.4846 0.2765 5103.3794 1.753 0.0797 .
## PerPoverty_bylevels_L2 0.1831 0.2209 128.8333 0.829 0.4088
## ModalRace_bylevels_L2 0.4949 0.3597 101.6569 1.376 0.1719
## Urbanicity_L2 -0.3559 0.2896 123.4913 -1.229 0.2213
## ModalEducation_bylevels_L2 -0.7346 0.4420 116.9243 -1.662 0.0992 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation of Fixed Effects:
## (Intr) SumSS MnyPrb PP__L2 MR__L2 Urb_L2
## SumSS -0.031
## MoneyProblm -0.072 -0.194
## PrPvrty__L2 -0.528 -0.106 -0.001
## MdlRc_by_L2 -0.403 -0.048 0.007 -0.132
## Urbancty_L2 -0.373 0.058 0.035 -0.103 -0.001
## MdlEdct__L2 -0.894 0.027 0.043 0.528 0.174 0.103
summary(RIM.Sum.Any <- lmer(EmoProblem ~
#SocialSecurity + SSI + AFDC + FoodStamp + Unemploy + Housing +
AnySS +
SumSS +
MoneyProblem + PerPoverty_bylevels_L2 + ModalRace_bylevels_L2 + Urbanicity_L2 + ModalEducation_bylevels_L2 +
(1 | CLUSTERID), data = dat2))
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: EmoProblem ~ AnySS + SumSS + MoneyProblem + PerPoverty_bylevels_L2 +
## ModalRace_bylevels_L2 + Urbanicity_L2 + ModalEducation_bylevels_L2 +
## (1 | CLUSTERID)
## Data: dat2
##
## REML criterion at convergence: 34933.2
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -1.9229 -0.7162 -0.1902 0.5119 5.4974
##
## Random effects:
## Groups Name Variance Std.Dev.
## CLUSTERID (Intercept) 1.12 1.058
## Residual 52.99 7.280
## Number of obs: 5120, groups: CLUSTERID, 132
##
## Fixed effects:
## Estimate Std. Error df t value Pr(>|t|)
## (Intercept) 11.2259 1.2850 118.6343 8.736 1.85e-14 ***
## AnySS 0.8937 0.4449 5094.5538 2.009 0.04462 *
## SumSS 0.6363 0.2345 5111.9844 2.713 0.00669 **
## MoneyProblem 0.4645 0.2766 5103.2477 1.679 0.09312 .
## PerPoverty_bylevels_L2 0.1788 0.2207 128.8653 0.810 0.41932
## ModalRace_bylevels_L2 0.4976 0.3593 101.6526 1.385 0.16914
## Urbanicity_L2 -0.3705 0.2894 123.6363 -1.280 0.20287
## ModalEducation_bylevels_L2 -0.7094 0.4418 117.1568 -1.606 0.11100
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation of Fixed Effects:
## (Intr) AnySS SumSS MnyPrb PP__L2 MR__L2 Urb_L2
## AnySS -0.034
## SumSS 0.011 -0.834
## MoneyProblm -0.070 -0.036 -0.077
## PrPvrty__L2 -0.528 -0.009 -0.051 -0.001
## MdlRc_by_L2 -0.403 0.004 -0.030 0.007 -0.132
## Urbancty_L2 -0.372 -0.025 0.053 0.036 -0.103 -0.001
## MdlEdct__L2 -0.894 0.029 -0.009 0.042 0.527 0.174 0.102
anova(RIM.Any.cat, RIM.Any)[1:8] #nested, sig., support RIM.Any.cat
## refitting model(s) with ML (instead of REML)
## npar AIC BIC logLik deviance Chisq Df Pr(>Chisq)
## RIM.Any 9 34951 35010 -17467 34933
## RIM.Any.cat 15 34947 35045 -17459 34917 16.189 6 0.01278 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
anova(RIM.Sum.Any, RIM.Sum)[1:8] #nested, sig., support RIM.Sum.Any
## refitting model(s) with ML (instead of REML)
## npar AIC BIC logLik deviance Chisq Df Pr(>Chisq)
## RIM.Sum 9 34948 35007 -17465 34930
## RIM.Sum.Any 10 34946 35011 -17463 34926 4.0454 1 0.04429 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
anova(RIM.Any.cat, RIM.Sum.Any)[1:8] #non-nested, BIC support the more parsimonious model: RIM.Sum.Any
## refitting model(s) with ML (instead of REML)
## npar AIC BIC logLik deviance Chisq Df Pr(>Chisq)
## RIM.Sum.Any 10 34946 35011 -17463 34926
## RIM.Any.cat 15 34947 35045 -17459 34917 8.7957 5 0.1175
Baseline model therefore is RIM.Sum.Any
RIM <- RIM.Sum.Any
Step 1: Add quadratic effect to SumSS
summary(RIM.quad <- lmer(EmoProblem ~
AnySS +
SumSS +
I(SumSS^2) +
MoneyProblem + PerPoverty_bylevels_L2 + ModalRace_bylevels_L2 + Urbanicity_L2 + ModalEducation_bylevels_L2 +
(1 | CLUSTERID), data = dat2))
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula:
## EmoProblem ~ AnySS + SumSS + I(SumSS^2) + MoneyProblem + PerPoverty_bylevels_L2 +
## ModalRace_bylevels_L2 + Urbanicity_L2 + ModalEducation_bylevels_L2 +
## (1 | CLUSTERID)
## Data: dat2
##
## REML criterion at convergence: 34927.5
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -2.0007 -0.7146 -0.1900 0.5100 5.5044
##
## Random effects:
## Groups Name Variance Std.Dev.
## CLUSTERID (Intercept) 1.116 1.056
## Residual 52.934 7.276
## Number of obs: 5120, groups: CLUSTERID, 132
##
## Fixed effects:
## Estimate Std. Error df t value Pr(>|t|)
## (Intercept) 11.2709 1.2836 118.5910 8.781 1.45e-14 ***
## AnySS -1.2260 0.9162 5088.2710 -1.338 0.18093
## SumSS 3.1184 0.9669 5086.5090 3.225 0.00127 **
## I(SumSS^2) -0.5618 0.2123 5089.4157 -2.646 0.00817 **
## MoneyProblem 0.4265 0.2768 5101.9137 1.541 0.12337
## PerPoverty_bylevels_L2 0.1688 0.2205 128.8813 0.765 0.44540
## ModalRace_bylevels_L2 0.4724 0.3590 101.6951 1.316 0.19117
## Urbanicity_L2 -0.3785 0.2891 123.5476 -1.309 0.19282
## ModalEducation_bylevels_L2 -0.7013 0.4413 117.0521 -1.589 0.11470
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation of Fixed Effects:
## (Intr) AnySS SumSS I(SSS^ MnyPrb PP__L2 MR__L2 Urb_L2
## AnySS -0.028
## SumSS 0.015 -0.946
## I(SumSS^2) -0.013 0.874 -0.970
## MoneyProblm -0.071 0.028 -0.069 0.052
## PrPvrty__L2 -0.528 0.010 -0.029 0.017 0.000
## MdlRc_by_L2 -0.403 0.025 -0.033 0.026 0.008 -0.131
## Urbancty_L2 -0.372 -0.003 0.003 0.011 0.036 -0.103 -0.001
## MdlEdct__L2 -0.894 0.008 0.005 -0.007 0.041 0.527 0.174 0.102
anova(RIM.quad, RIM)[1:8]
## refitting model(s) with ML (instead of REML)
## npar AIC BIC logLik deviance Chisq Df Pr(>Chisq)
## RIM 10 34946 35011 -17463 34926
## RIM.quad 11 34941 35013 -17459 34919 7.0143 1 0.008086 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
RIM.quad fit significantly better than RIM. p=.008086
Step 2: Add interaction term to SumSS
summary(RIM.quad.int_urban <- lmer(EmoProblem ~
AnySS +
SumSS*Urbanicity_L2 +
SumSS +
I(SumSS^2) +
MoneyProblem + PerPoverty_bylevels_L2 + ModalRace_bylevels_L2 + Urbanicity_L2 + ModalEducation_bylevels_L2 +
(1 | CLUSTERID), data = dat2))
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: EmoProblem ~ AnySS + SumSS * Urbanicity_L2 + SumSS + I(SumSS^2) +
## MoneyProblem + PerPoverty_bylevels_L2 + ModalRace_bylevels_L2 +
## Urbanicity_L2 + ModalEducation_bylevels_L2 + (1 | CLUSTERID)
## Data: dat2
##
## REML criterion at convergence: 34925.4
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -1.9601 -0.7092 -0.1939 0.5046 5.5179
##
## Random effects:
## Groups Name Variance Std.Dev.
## CLUSTERID (Intercept) 1.146 1.071
## Residual 52.899 7.273
## Number of obs: 5120, groups: CLUSTERID, 132
##
## Fixed effects:
## Estimate Std. Error df t value Pr(>|t|)
## (Intercept) 11.5215 1.3005 122.7859 8.859 7.57e-15 ***
## AnySS -1.0906 0.9195 5087.8029 -1.186 0.2356
## SumSS 2.2781 1.0863 5109.8788 2.097 0.0360 *
## Urbanicity_L2 -0.5623 0.3102 155.0179 -1.812 0.0719 .
## I(SumSS^2) -0.5020 0.2152 5089.2835 -2.333 0.0197 *
## MoneyProblem 0.4187 0.2768 5101.6588 1.513 0.1304
## PerPoverty_bylevels_L2 0.1711 0.2218 129.2444 0.771 0.4418
## ModalRace_bylevels_L2 0.4590 0.3615 102.4482 1.270 0.2070
## ModalEducation_bylevels_L2 -0.6845 0.4440 117.4942 -1.542 0.1258
## SumSS:Urbanicity_L2 0.4408 0.2601 4722.9191 1.694 0.0903 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation of Fixed Effects:
## (Intr) AnySS SumSS Urb_L2 I(SSS^ MnyPrb PP__L2 MR__L2 ME__L2
## AnySS -0.017
## SumSS -0.041 -0.879
## Urbancty_L2 -0.388 -0.033 0.161
## I(SumSS^2) 0.007 0.874 -0.926 -0.047
## MoneyProblm -0.072 0.026 -0.055 0.039 0.049
## PrPvrty__L2 -0.524 0.010 -0.026 -0.097 0.017 0.000
## MdlRc_by_L2 -0.403 0.023 -0.019 0.007 0.022 0.009 -0.132
## MdlEdct__L2 -0.886 0.009 -0.003 0.090 -0.004 0.041 0.527 0.173
## SmSS:Urb_L2 0.118 0.087 -0.456 -0.349 0.164 -0.015 0.001 -0.023 0.017
summary(RIM.quad.int_educ <- lmer(EmoProblem ~
AnySS +
SumSS*ModalEducation_bylevels_L2 +
SumSS +
I(SumSS^2) +
MoneyProblem + PerPoverty_bylevels_L2 + ModalRace_bylevels_L2 + Urbanicity_L2 + ModalEducation_bylevels_L2 +
(1 | CLUSTERID), data = dat2))
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: EmoProblem ~ AnySS + SumSS * ModalEducation_bylevels_L2 + SumSS +
## I(SumSS^2) + MoneyProblem + PerPoverty_bylevels_L2 + ModalRace_bylevels_L2 +
## Urbanicity_L2 + ModalEducation_bylevels_L2 + (1 | CLUSTERID)
## Data: dat2
##
## REML criterion at convergence: 34924.9
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -2.0530 -0.7164 -0.1830 0.5075 5.5087
##
## Random effects:
## Groups Name Variance Std.Dev.
## CLUSTERID (Intercept) 1.154 1.074
## Residual 52.892 7.273
## Number of obs: 5120, groups: CLUSTERID, 132
##
## Fixed effects:
## Estimate Std. Error df t value
## (Intercept) 10.7694 1.3219 124.8540 8.147
## AnySS -0.9837 0.9260 5092.3070 -1.062
## SumSS 3.8337 1.0466 5109.7153 3.663
## ModalEducation_bylevels_L2 -0.4243 0.4700 135.2830 -0.903
## I(SumSS^2) -0.5124 0.2141 5091.3383 -2.393
## MoneyProblem 0.4294 0.2767 5102.2356 1.551
## PerPoverty_bylevels_L2 0.1600 0.2222 128.3167 0.720
## ModalRace_bylevels_L2 0.4442 0.3623 101.6081 1.226
## Urbanicity_L2 -0.3801 0.2912 122.6510 -1.305
## SumSS:ModalEducation_bylevels_L2 -0.5209 0.2917 4231.4651 -1.785
## Pr(>|t|)
## (Intercept) 3.3e-13 ***
## AnySS 0.288142
## SumSS 0.000252 ***
## ModalEducation_bylevels_L2 0.368322
## I(SumSS^2) 0.016729 *
## MoneyProblem 0.120857
## PerPoverty_bylevels_L2 0.472613
## ModalRace_bylevels_L2 0.222999
## Urbanicity_L2 0.194254
## SumSS:ModalEducation_bylevels_L2 0.074259 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation of Fixed Effects:
## (Intr) AnySS SumSS ME__L2 I(SSS^ MnyPrb PP__L2 MR__L2 Urb_L2
## AnySS -0.057
## SumSS -0.066 -0.808
## MdlEdct__L2 -0.894 0.054 0.129
## I(SumSS^2) -0.039 0.877 -0.839 0.035
## MoneyProblm -0.071 0.029 -0.061 0.041 0.053
## PrPvrty__L2 -0.511 0.006 -0.037 0.490 0.013 0.000
## MdlRc_by_L2 -0.385 0.018 -0.047 0.149 0.020 0.008 -0.130
## Urbancty_L2 -0.364 -0.003 0.002 0.096 0.010 0.036 -0.102 0.000
## SmSS:ME__L2 0.207 -0.146 -0.383 -0.324 -0.129 -0.008 0.028 0.045 0.002
### Other Lv2 covariates are also tested, but only urbanicity and education are significant.
### Construct of a model with both interaction terms:
summary(RIM.quad.int <- lmer(EmoProblem ~
AnySS +
SumSS*Urbanicity_L2 + SumSS*ModalEducation_bylevels_L2 +
SumSS +
I(SumSS^2) +
MoneyProblem + PerPoverty_bylevels_L2 + ModalRace_bylevels_L2 + Urbanicity_L2 + ModalEducation_bylevels_L2 +
(1 | CLUSTERID), data = dat2))
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula:
## EmoProblem ~ AnySS + SumSS * Urbanicity_L2 + SumSS * ModalEducation_bylevels_L2 +
## SumSS + I(SumSS^2) + MoneyProblem + PerPoverty_bylevels_L2 +
## ModalRace_bylevels_L2 + Urbanicity_L2 + ModalEducation_bylevels_L2 +
## (1 | CLUSTERID)
## Data: dat2
##
## REML criterion at convergence: 34924
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -2.0117 -0.7150 -0.1896 0.5068 5.5184
##
## Random effects:
## Groups Name Variance Std.Dev.
## CLUSTERID (Intercept) 1.173 1.083
## Residual 52.875 7.271
## Number of obs: 5120, groups: CLUSTERID, 132
##
## Fixed effects:
## Estimate Std. Error df t value
## (Intercept) 11.0575 1.3459 132.7950 8.216
## AnySS -0.9194 0.9271 5091.8413 -0.992
## SumSS 3.0377 1.2113 5099.3051 2.508
## Urbanicity_L2 -0.5260 0.3128 156.3076 -1.682
## ModalEducation_bylevels_L2 -0.4602 0.4726 137.0581 -0.974
## I(SumSS^2) -0.4737 0.2161 5091.5300 -2.192
## MoneyProblem 0.4225 0.2768 5101.6340 1.527
## PerPoverty_bylevels_L2 0.1636 0.2230 128.7143 0.734
## ModalRace_bylevels_L2 0.4387 0.3638 102.1820 1.206
## SumSS:Urbanicity_L2 0.3504 0.2680 4832.6414 1.307
## SumSS:ModalEducation_bylevels_L2 -0.4276 0.3006 4384.6165 -1.423
## Pr(>|t|)
## (Intercept) 1.66e-13 ***
## AnySS 0.3214
## SumSS 0.0122 *
## Urbanicity_L2 0.0946 .
## ModalEducation_bylevels_L2 0.3319
## I(SumSS^2) 0.0284 *
## MoneyProblem 0.1269
## PerPoverty_bylevels_L2 0.4645
## ModalRace_bylevels_L2 0.2306
## SumSS:Urbanicity_L2 0.1912
## SumSS:ModalEducation_bylevels_L2 0.1549
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation of Fixed Effects:
## (Intr) AnySS SumSS Urb_L2 ME__L2 I(SSS^ MnyPrb PP__L2 MR__L2
## AnySS -0.047
## SumSS -0.141 -0.724
## Urbancty_L2 -0.395 -0.022 0.181
## MdlEdct__L2 -0.891 0.051 0.143 0.112
## I(SumSS^2) -0.015 0.874 -0.787 -0.039 0.026
## MoneyProblm -0.072 0.028 -0.044 0.039 0.042 0.050
## PrPvrty__L2 -0.502 0.006 -0.036 -0.098 0.489 0.014 0.000
## MdlRc_by_L2 -0.382 0.017 -0.035 0.004 0.150 0.018 0.008 -0.131
## SmSS:Urb_L2 0.168 0.052 -0.504 -0.356 -0.063 0.136 -0.017 0.008 -0.012
## SmSS:ME__L2 0.238 -0.129 -0.443 -0.084 -0.329 -0.091 -0.012 0.029 0.040
## SSS:U_
## AnySS
## SumSS
## Urbancty_L2
## MdlEdct__L2
## I(SumSS^2)
## MoneyProblm
## PrPvrty__L2
## MdlRc_by_L2
## SmSS:Urb_L2
## SmSS:ME__L2 0.240
anova(RIM.quad.int_urban, RIM.quad)[1:8] # ns but p<.1
## refitting model(s) with ML (instead of REML)
## npar AIC BIC logLik deviance Chisq Df Pr(>Chisq)
## RIM.quad 11 34941 35013 -17459 34919
## RIM.quad.int_urban 12 34940 35019 -17458 34916 2.8045 1 0.094 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
anova(RIM.quad.int_educ, RIM.quad)[1:8] # ns but p<.1
## refitting model(s) with ML (instead of REML)
## npar AIC BIC logLik deviance Chisq Df Pr(>Chisq)
## RIM.quad 11 34941 35013 -17459 34919
## RIM.quad.int_educ 12 34940 35018 -17458 34916 3.1038 1 0.07811 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
anova(RIM.quad.int, RIM.quad)[1:8] # ns but p<.1
## refitting model(s) with ML (instead of REML)
## npar AIC BIC logLik deviance Chisq Df Pr(>Chisq)
## RIM.quad 11 34941 35013 -17459 34919
## RIM.quad.int 13 34940 35025 -17457 34914 4.7747 2 0.09187 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
anova(RIM.quad.int_educ, RIM.quad.int_urban)[1:8] # these two models are almost identical in fit, but the one with education interaction has a slightly lower BIC
## refitting model(s) with ML (instead of REML)
## npar AIC BIC logLik deviance Chisq Df Pr(>Chisq)
## RIM.quad.int_educ 12 34940 35018 -17458 34916
## RIM.quad.int_urban 12 34940 35019 -17458 34916 0 0
We cannot decide whether to include interaction term. Will revisit this issue later.
Step 3: Add random slope to SumSS (I also tested for AnySS, but model won’t converge)
summary(RSM.quad.int_urban <- lmer(EmoProblem ~
AnySS +
#SumSS*ModalEducation_bylevels_L2 +
SumSS*Urbanicity_L2 +
SumSS +
I(SumSS^2) +
MoneyProblem + PerPoverty_bylevels_L2 + ModalRace_bylevels_L2 + Urbanicity_L2 + ModalEducation_bylevels_L2 +
(1 + SumSS| CLUSTERID), data = dat2))
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: EmoProblem ~ AnySS + SumSS * Urbanicity_L2 + SumSS + I(SumSS^2) +
## MoneyProblem + PerPoverty_bylevels_L2 + ModalRace_bylevels_L2 +
## Urbanicity_L2 + ModalEducation_bylevels_L2 + (1 + SumSS | CLUSTERID)
## Data: dat2
##
## REML criterion at convergence: 34922.3
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -1.9775 -0.7149 -0.1892 0.5035 5.5217
##
## Random effects:
## Groups Name Variance Std.Dev. Corr
## CLUSTERID (Intercept) 0.9794 0.9896
## SumSS 0.2427 0.4926 0.29
## Residual 52.7378 7.2621
## Number of obs: 5120, groups: CLUSTERID, 132
##
## Fixed effects:
## Estimate Std. Error df t value Pr(>|t|)
## (Intercept) 11.3762 1.2927 120.4647 8.800 1.18e-14 ***
## AnySS -1.1142 0.9314 2885.4588 -1.196 0.2317
## SumSS 2.2246 1.1167 993.7271 1.992 0.0466 *
## Urbanicity_L2 -0.5600 0.3011 121.9906 -1.860 0.0653 .
## I(SumSS^2) -0.5222 0.2203 1406.7269 -2.371 0.0179 *
## MoneyProblem 0.4197 0.2772 5058.2912 1.514 0.1301
## PerPoverty_bylevels_L2 0.1733 0.2227 131.5614 0.778 0.4378
## ModalRace_bylevels_L2 0.4644 0.3647 105.4777 1.273 0.2057
## ModalEducation_bylevels_L2 -0.6156 0.4431 115.8271 -1.389 0.1674
## SumSS:Urbanicity_L2 0.5013 0.2838 109.9791 1.766 0.0801 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation of Fixed Effects:
## (Intr) AnySS SumSS Urb_L2 I(SSS^ MnyPrb PP__L2 MR__L2 ME__L2
## AnySS -0.018
## SumSS -0.030 -0.871
## Urbancty_L2 -0.380 -0.030 0.142
## I(SumSS^2) 0.004 0.874 -0.917 -0.046
## MoneyProblm -0.071 0.027 -0.053 0.041 0.047
## PrPvrty__L2 -0.522 0.005 -0.024 -0.103 0.018 -0.005
## MdlRc_by_L2 -0.403 0.016 -0.015 0.006 0.016 0.011 -0.135
## MdlEdct__L2 -0.888 0.014 -0.008 0.093 0.001 0.039 0.523 0.167
## SmSS:Urb_L2 0.091 0.080 -0.467 -0.284 0.150 -0.014 0.007 -0.010 0.013
summary(RSM.quad.int_educ <- lmer(EmoProblem ~
AnySS +
SumSS*ModalEducation_bylevels_L2 +
#SumSS*Urbanicity_L2 +
SumSS +
I(SumSS^2) +
MoneyProblem + PerPoverty_bylevels_L2 + ModalRace_bylevels_L2 + Urbanicity_L2 + ModalEducation_bylevels_L2 +
(1 + SumSS| CLUSTERID), data = dat2))
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: EmoProblem ~ AnySS + SumSS * ModalEducation_bylevels_L2 + SumSS +
## I(SumSS^2) + MoneyProblem + PerPoverty_bylevels_L2 + ModalRace_bylevels_L2 +
## Urbanicity_L2 + ModalEducation_bylevels_L2 + (1 + SumSS | CLUSTERID)
## Data: dat2
##
## REML criterion at convergence: 34922.6
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -2.0488 -0.7202 -0.1835 0.5098 5.5110
##
## Random effects:
## Groups Name Variance Std.Dev. Corr
## CLUSTERID (Intercept) 0.9883 0.9941
## SumSS 0.1856 0.4308 0.35
## Residual 52.7704 7.2643
## Number of obs: 5120, groups: CLUSTERID, 132
##
## Fixed effects:
## Estimate Std. Error df t value
## (Intercept) 10.8184 1.3080 120.5871 8.271
## AnySS -1.0259 0.9357 2924.4937 -1.096
## SumSS 3.8722 1.0819 403.0787 3.579
## ModalEducation_bylevels_L2 -0.4331 0.4599 118.0033 -0.942
## I(SumSS^2) -0.5351 0.2184 1255.6589 -2.450
## MoneyProblem 0.4294 0.2771 5047.1212 1.549
## PerPoverty_bylevels_L2 0.1609 0.2230 130.6049 0.722
## ModalRace_bylevels_L2 0.4533 0.3653 104.3786 1.241
## Urbanicity_L2 -0.4079 0.2893 122.2365 -1.410
## SumSS:ModalEducation_bylevels_L2 -0.5135 0.3153 85.5780 -1.629
## Pr(>|t|)
## (Intercept) 2.04e-13 ***
## AnySS 0.272976
## SumSS 0.000387 ***
## ModalEducation_bylevels_L2 0.348202
## I(SumSS^2) 0.014404 *
## MoneyProblem 0.121353
## PerPoverty_bylevels_L2 0.471833
## ModalRace_bylevels_L2 0.217441
## Urbanicity_L2 0.161022
## SumSS:ModalEducation_bylevels_L2 0.107063
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation of Fixed Effects:
## (Intr) AnySS SumSS ME__L2 I(SSS^ MnyPrb PP__L2 MR__L2 Urb_L2
## AnySS -0.049
## SumSS -0.058 -0.793
## MdlEdct__L2 -0.893 0.050 0.108
## I(SumSS^2) -0.030 0.877 -0.825 0.030
## MoneyProblm -0.071 0.029 -0.057 0.041 0.051
## PrPvrty__L2 -0.512 0.001 -0.033 0.497 0.013 -0.005
## MdlRc_by_L2 -0.392 0.013 -0.033 0.153 0.015 0.010 -0.134
## Urbancty_L2 -0.366 -0.007 0.011 0.098 -0.002 0.038 -0.106 0.003
## SmSS:ME__L2 0.169 -0.141 -0.416 -0.264 -0.119 -0.010 0.029 0.030 -0.003
summary(RSM.quad.int <- lmer(EmoProblem ~
AnySS +
SumSS*ModalEducation_bylevels_L2 +
SumSS*Urbanicity_L2 +
SumSS +
I(SumSS^2) +
MoneyProblem + PerPoverty_bylevels_L2 + ModalRace_bylevels_L2 + Urbanicity_L2 + ModalEducation_bylevels_L2 +
(1 + SumSS| CLUSTERID), data = dat2))
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: EmoProblem ~ AnySS + SumSS * ModalEducation_bylevels_L2 + SumSS *
## Urbanicity_L2 + SumSS + I(SumSS^2) + MoneyProblem + PerPoverty_bylevels_L2 +
## ModalRace_bylevels_L2 + Urbanicity_L2 + ModalEducation_bylevels_L2 +
## (1 + SumSS | CLUSTERID)
## Data: dat2
##
## REML criterion at convergence: 34921.2
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -2.0103 -0.7180 -0.1877 0.5049 5.5212
##
## Random effects:
## Groups Name Variance Std.Dev. Corr
## CLUSTERID (Intercept) 0.9879 0.9939
## SumSS 0.2032 0.4508 0.38
## Residual 52.7428 7.2624
## Number of obs: 5120, groups: CLUSTERID, 132
##
## Fixed effects:
## Estimate Std. Error df t value
## (Intercept) 11.0618 1.3209 122.0832 8.374
## AnySS -0.9618 0.9375 3030.2026 -1.026
## SumSS 2.9496 1.2593 346.8280 2.342
## ModalEducation_bylevels_L2 -0.4631 0.4607 118.1663 -1.005
## Urbanicity_L2 -0.5361 0.3023 121.4762 -1.773
## I(SumSS^2) -0.4960 0.2205 1418.5354 -2.250
## MoneyProblem 0.4219 0.2772 5051.0469 1.522
## PerPoverty_bylevels_L2 0.1663 0.2237 131.4434 0.743
## ModalRace_bylevels_L2 0.4528 0.3667 105.5354 1.235
## SumSS:ModalEducation_bylevels_L2 -0.4064 0.3261 91.7904 -1.247
## SumSS:Urbanicity_L2 0.4185 0.2885 110.5361 1.451
## Pr(>|t|)
## (Intercept) 1.09e-13 ***
## AnySS 0.3050
## SumSS 0.0197 *
## ModalEducation_bylevels_L2 0.3168
## Urbanicity_L2 0.0787 .
## I(SumSS^2) 0.0246 *
## MoneyProblem 0.1281
## PerPoverty_bylevels_L2 0.4587
## ModalRace_bylevels_L2 0.2196
## SumSS:ModalEducation_bylevels_L2 0.2157
## SumSS:Urbanicity_L2 0.1497
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation of Fixed Effects:
## (Intr) AnySS SumSS ME__L2 Urb_L2 I(SSS^ MnyPrb PP__L2 MR__L2
## AnySS -0.042
## SumSS -0.113 -0.706
## MdlEdct__L2 -0.891 0.047 0.115
## Urbancty_L2 -0.384 -0.021 0.153 0.107
## I(SumSS^2) -0.013 0.875 -0.768 0.023 -0.039
## MoneyProblm -0.072 0.028 -0.041 0.042 0.041 0.049
## PrPvrty__L2 -0.506 0.001 -0.036 0.497 -0.105 0.015 -0.006
## MdlRc_by_L2 -0.390 0.012 -0.026 0.154 0.005 0.014 0.010 -0.134
## SmSS:ME__L2 0.188 -0.125 -0.468 -0.260 -0.068 -0.085 -0.014 0.031 0.027
## SmSS:Urb_L2 0.126 0.049 -0.508 -0.047 -0.283 0.128 -0.017 0.015 -0.003
## SSS:ME
## AnySS
## SumSS
## MdlEdct__L2
## Urbancty_L2
## I(SumSS^2)
## MoneyProblm
## PrPvrty__L2
## MdlRc_by_L2
## SmSS:ME__L2
## SmSS:Urb_L2 0.229
summary(RSM.quad <- lmer(EmoProblem ~
AnySS +
SumSS +
I(SumSS^2) +
MoneyProblem + PerPoverty_bylevels_L2 + ModalRace_bylevels_L2 + Urbanicity_L2 + ModalEducation_bylevels_L2 +
(1 + SumSS| CLUSTERID), data = dat2))
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula:
## EmoProblem ~ AnySS + SumSS + I(SumSS^2) + MoneyProblem + PerPoverty_bylevels_L2 +
## ModalRace_bylevels_L2 + Urbanicity_L2 + ModalEducation_bylevels_L2 +
## (1 + SumSS | CLUSTERID)
## Data: dat2
##
## REML criterion at convergence: 34924.7
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -2.0140 -0.7147 -0.1906 0.5092 5.5090
##
## Random effects:
## Groups Name Variance Std.Dev. Corr
## CLUSTERID (Intercept) 0.9781 0.9890
## SumSS 0.2489 0.4989 0.22
## Residual 52.7675 7.2641
## Number of obs: 5120, groups: CLUSTERID, 132
##
## Fixed effects:
## Estimate Std. Error df t value Pr(>|t|)
## (Intercept) 11.1747 1.2820 118.0167 8.717 2.12e-14 ***
## AnySS -1.2459 0.9287 2714.8884 -1.342 0.17985
## SumSS 3.1485 0.9877 1525.2055 3.188 0.00146 **
## I(SumSS^2) -0.5803 0.2179 1190.6118 -2.664 0.00783 **
## MoneyProblem 0.4285 0.2772 5055.4336 1.546 0.12225
## PerPoverty_bylevels_L2 0.1698 0.2217 130.7193 0.766 0.44500
## ModalRace_bylevels_L2 0.4702 0.3626 104.0257 1.297 0.19756
## Urbanicity_L2 -0.4029 0.2877 122.7265 -1.401 0.16383
## ModalEducation_bylevels_L2 -0.6328 0.4412 115.5004 -1.434 0.15419
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation of Fixed Effects:
## (Intr) AnySS SumSS I(SSS^ MnyPrb PP__L2 MR__L2 Urb_L2
## AnySS -0.026
## SumSS 0.014 -0.946
## I(SumSS^2) -0.010 0.875 -0.968
## MoneyProblm -0.070 0.028 -0.067 0.050
## PrPvrty__L2 -0.525 0.006 -0.025 0.017 -0.005
## MdlRc_by_L2 -0.403 0.017 -0.024 0.019 0.010 -0.134
## Urbancty_L2 -0.370 -0.008 0.010 -0.002 0.038 -0.106 0.003
## MdlEdct__L2 -0.893 0.013 -0.001 -0.001 0.040 0.524 0.168 0.100
summary(RSM <- lmer(EmoProblem ~
AnySS +
SumSS +
MoneyProblem + PerPoverty_bylevels_L2 + ModalRace_bylevels_L2 + Urbanicity_L2 + ModalEducation_bylevels_L2 +
(1 + SumSS| CLUSTERID), data = dat2))
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: EmoProblem ~ AnySS + SumSS + MoneyProblem + PerPoverty_bylevels_L2 +
## ModalRace_bylevels_L2 + Urbanicity_L2 + ModalEducation_bylevels_L2 +
## (1 + SumSS | CLUSTERID)
## Data: dat2
##
## REML criterion at convergence: 34930.6
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -1.9200 -0.7212 -0.1893 0.5112 5.5020
##
## Random effects:
## Groups Name Variance Std.Dev. Corr
## CLUSTERID (Intercept) 0.9837 0.9918
## SumSS 0.2423 0.4922 0.21
## Residual 52.8339 7.2687
## Number of obs: 5120, groups: CLUSTERID, 132
##
## Fixed effects:
## Estimate Std. Error df t value Pr(>|t|)
## (Intercept) 11.1403 1.2828 118.0825 8.685 2.51e-14 ***
## AnySS 0.9181 0.4498 2998.2155 2.041 0.0413 *
## SumSS 0.6015 0.2461 317.8559 2.444 0.0151 *
## MoneyProblem 0.4654 0.2770 5049.3680 1.680 0.0930 .
## PerPoverty_bylevels_L2 0.1800 0.2217 130.6769 0.812 0.4184
## ModalRace_bylevels_L2 0.4886 0.3626 103.8615 1.347 0.1808
## Urbanicity_L2 -0.4032 0.2879 122.7819 -1.401 0.1639
## ModalEducation_bylevels_L2 -0.6362 0.4415 115.6377 -1.441 0.1523
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation of Fixed Effects:
## (Intr) AnySS SumSS MnyPrb PP__L2 MR__L2 Urb_L2
## AnySS -0.035
## SumSS 0.015 -0.820
## MoneyProblm -0.070 -0.033 -0.077
## PrPvrty__L2 -0.525 -0.019 -0.033 -0.005
## MdlRc_by_L2 -0.403 0.002 -0.022 0.009 -0.134
## Urbancty_L2 -0.370 -0.012 0.034 0.038 -0.106 0.003
## MdlEdct__L2 -0.893 0.029 -0.011 0.040 0.524 0.168 0.100
# Modal comparisons
anova(RIM.quad.int, RSM.quad.int)[1:8] # ns, nested, RIM fit better
## refitting model(s) with ML (instead of REML)
## npar AIC BIC logLik deviance Chisq Df Pr(>Chisq)
## RIM.quad.int 13 34940 35025 -17457 34914
## RSM.quad.int 15 34942 35040 -17456 34912 2.3473 2 0.3092
anova(RIM.quad.int_educ, RSM.quad.int_educ)[1:8] # ns, nested, RIM fit better
## refitting model(s) with ML (instead of REML)
## npar AIC BIC logLik deviance Chisq Df Pr(>Chisq)
## RIM.quad.int_educ 12 34940 35018 -17458 34916
## RSM.quad.int_educ 14 34942 35033 -17457 34914 1.9654 2 0.3743
anova(RIM.quad.int_urban, RSM.quad.int_urban)[1:8] # ns, nested, RIM fit better
## refitting model(s) with ML (instead of REML)
## npar AIC BIC logLik deviance Chisq Df Pr(>Chisq)
## RIM.quad.int_urban 12 34940 35019 -17458 34916
## RSM.quad.int_urban 14 34941 35033 -17457 34913 2.7562 2 0.2521
anova(RIM.quad, RSM.quad)[1:8] # ns, nested, RIM fit better
## refitting model(s) with ML (instead of REML)
## npar AIC BIC logLik deviance Chisq Df Pr(>Chisq)
## RIM.quad 11 34941 35013 -17459 34919
## RSM.quad 13 34942 35027 -17458 34916 2.4909 2 0.2878
anova(RIM, RSM)[1:8] # ns, nested, RIM fit better
## refitting model(s) with ML (instead of REML)
## npar AIC BIC logLik deviance Chisq Df Pr(>Chisq)
## RIM 10 34946 35011 -17463 34926
## RSM 12 34947 35026 -17462 34923 2.4059 2 0.3003
Explore if any RSM fit better than any RIM with quad and int effects
anova(RSM.quad, RIM.quad.int)[1:8] # not supported by BIC, RIM fit better
## refitting model(s) with ML (instead of REML)
## npar AIC BIC logLik deviance Chisq Df Pr(>Chisq)
## RSM.quad 13 34942 35027 -17458 34916
## RIM.quad.int 13 34940 35025 -17457 34914 2.2837 0
anova(RSM, RIM.quad.int)[1:8] # RSM fit better than RIM.quad.int, supported by BIC
## refitting model(s) with ML (instead of REML)
## npar AIC BIC logLik deviance Chisq Df Pr(>Chisq)
## RSM 12 34947 35026 -17462 34923
## RIM.quad.int 13 34940 35025 -17457 34914 9.3831 1 0.00219 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
anova(RSM, RIM.quad.int_urban)[1:8] # not supported by BIC, RIM fit better
## refitting model(s) with ML (instead of REML)
## npar AIC BIC logLik deviance Chisq Df Pr(>Chisq)
## RSM 12 34947 35026 -17462 34923
## RIM.quad.int_urban 12 34940 35019 -17458 34916 7.413 0
anova(RSM, RIM.quad.int_educ)[1:8] # not supported by BIC, RIM fit better
## refitting model(s) with ML (instead of REML)
## npar AIC BIC logLik deviance Chisq Df Pr(>Chisq)
## RSM 12 34947 35026 -17462 34923
## RIM.quad.int_educ 12 34940 35018 -17458 34916 7.7122 0
Explore if RSM fit better than RIM with quad only
anova(RSM, RIM.quad) # RIM.quad fit better than RSM, supported by BIC
## refitting model(s) with ML (instead of REML)
## Data: dat2
## Models:
## RIM.quad: EmoProblem ~ AnySS + SumSS + I(SumSS^2) + MoneyProblem + PerPoverty_bylevels_L2 + ModalRace_bylevels_L2 + Urbanicity_L2 + ModalEducation_bylevels_L2 + (1 | CLUSTERID)
## RSM: EmoProblem ~ AnySS + SumSS + MoneyProblem + PerPoverty_bylevels_L2 + ModalRace_bylevels_L2 + Urbanicity_L2 + ModalEducation_bylevels_L2 + (1 + SumSS | CLUSTERID)
## npar AIC BIC logLik deviance Chisq Df Pr(>Chisq)
## RIM.quad 11 34941 35013 -17459 34919
## RSM 12 34947 35026 -17462 34923 0 1 1