Description Usage Arguments Details Value Note Author(s) References See Also Examples

Using mixed effects regression models, `exclude.influence`

excludes the influence of a group of cases grouped within a single grouping factor, or a set of grouping factors. The function returns a model in which the influence a grouped set of observations has on both the variance and point-estimate of the (random) intercept.

1 |

`model` |
A mixed effects regression model |

`grouping` |
The grouping factor of which one or more groupings levels are to be 'neutralized' |

`level` |
Vector of character strings, indicating either a single level or a set of grouping levels the influence of which is to be neutralized |

`obs` |
Specifies which individual observation(s) (rather than groups) to be deleted from the data/ |

`gf` |
Indicates from which of the model's grouping factors the influence of the specified grouping factor is to be neutralized. If |

`delete` |
If delete=TRUE (default), the influence is excluded by simply deleting the observations nested within the higher level group. If delete=FALSE, the influence of higher level groups is excluded from the model by setting the intercept-vector for the observations nested within these groups to 0, and by adding a dummy-variable indicating these observations (Langford and Lewis, 1998). This latter option currently does not work with models that include factor variables. |

To apply the basic logic of influential cases to mixed effects models one has to measure the influence of a particular higher level unit on the estimates of a higher level predictor. This means that the mixed effects model has to be adjusted to neutralize the unit's influence on that estimate, while at the same time allowing the unit's lower-level cases to help estimate the effects of the lower-level predictors in the model. This procedure is based on a modification of the intercept and the addition of a dummy variable for the cases that might be influential.

The model that is returned by `exclude.influence`

thus contains a modified intercept, and one or more additional dummy variables. To help identify this model as modified (which is required when in a later stage the influence of additional grouping levels is excluded), the intercept is renamed to 'intercept.alt'. The additional dummy variables, indicating the observations associated with the grouping factor levels of which the influence was neutralized, are labeled starting with 'estex.', combined with the label of the neutralized grouping level.

Mixed effects regression model of class `'mer'`

, with a modified random intercept and dummy variables indicating the estimates of the neutralized influence of selected grouping levels.

Please note that in its present form, the `exclude.influence`

function only works on mixed effects regression models of class `mer`

that have been estimated using the functions in the `lme4`

package.

Also, it is required that the `mer`

model was estimated using a factor variable to indicate group levels. When using something similar to `+ (1 | as.factor(variable))`

, the function is not able of identifying the correct grouping factors, and returns an error.

Rense Nieuwenhuis, Ben Pelzer, Manfred te Grotenhuis

Nieuwenhuis, R., Te Grotenhuis, M., & Pelzer, B. (2012). Influence.ME: tools for detecting influential data in mixed effects models. *R Journal*, 4(2), 38???47.

Belsley, D.A., Kuh, E. & Welsch, R.E. (1980). *Regression Diagnostics. Identifying Influential Data and Source of Collinearity*. Wiley.

Langford, I. H. and Lewis, T. (1998). Outliers in multilevel data. Journal of the Royal Statistical Society: Series A (Statistics in Society), 161:121-160.

Snijders, T.A. & Bosker, R.J. (1999). *Multilevel Analysis, an introduction to basic and advanced multilevel modeling*. Sage.

Van der Meer, T., Te Grotenhuis, M., & Pelzer, B. (2010). *Influential Cases in Multilevel Modeling: A Methodological Comment*. American Sociological Review, 75(1), 173-178.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | ```
## Not run:
data(school23)
model.a <- lmer(math ~ structure + SES + (1 | school.ID), data=school23)
summary(model.a)
model.b <- exclude.influence(model.a, grouping="school.ID", level="7472")
summary(model.b)
model.c <- exclude.influence(model.a, grouping="school.ID", level=c("7472", "62821"))
summary(model.c)
model.d <- exclude.influence(model.a, obs=1:10)
summary(model.d)
data(Penicillin, package="lme4")
model.d <- lmer(diameter ~ (1|plate) + (1|sample), Penicillin)
summary(model.d)
model.e <- exclude.influence(model.d, grouping="sample", level="A", gf="all")
summary(model.e)
## End(Not run)
``` |

```
Loading required package: lme4
Loading required package: Matrix
Attaching package: 'influence.ME'
The following object is masked from 'package:stats':
influence
Linear mixed model fit by REML ['lmerMod']
Formula: math ~ structure + SES + (1 | school.ID)
Data: school23
REML criterion at convergence: 3742.7
Scaled residuals:
Min 1Q Median 3Q Max
-2.61242 -0.74965 -0.04848 0.75153 2.60331
Random effects:
Groups Name Variance Std.Dev.
school.ID (Intercept) 12.25 3.500
Residual 75.33 8.679
Number of obs: 519, groups: school.ID, 23
Fixed effects:
Estimate Std. Error t value
(Intercept) 56.4753 4.4275 12.756
structure -1.3410 1.1053 -1.213
SES 4.2533 0.5701 7.461
Correlation of Fixed Effects:
(Intr) strctr
structure -0.982
SES -0.113 0.129
Linear mixed model fit by REML ['lmerMod']
Formula: math ~ structure + SES + (1 | school.ID)
Data: data.update
REML criterion at convergence: 3579.6
Scaled residuals:
Min 1Q Median 3Q Max
-2.59221 -0.75252 -0.05763 0.75636 2.59688
Random effects:
Groups Name Variance Std.Dev.
school.ID (Intercept) 10.05 3.170
Residual 76.37 8.739
Number of obs: 496, groups: school.ID, 22
Fixed effects:
Estimate Std. Error t value
(Intercept) 62.5148 5.0745 12.319
structure -2.7733 1.2464 -2.225
SES 4.1291 0.5827 7.086
Correlation of Fixed Effects:
(Intr) strctr
structure -0.987
SES -0.197 0.209
Linear mixed model fit by REML ['lmerMod']
Formula: math ~ structure + SES + (1 | school.ID)
Data: data.update
REML criterion at convergence: 3127
Scaled residuals:
Min 1Q Median 3Q Max
-2.44965 -0.75949 -0.08235 0.75520 2.47281
Random effects:
Groups Name Variance Std.Dev.
school.ID (Intercept) 8.47 2.910
Residual 82.67 9.092
Number of obs: 429, groups: school.ID, 21
Fixed effects:
Estimate Std. Error t value
(Intercept) 58.9230 5.2533 11.216
structure -1.9542 1.2740 -1.534
SES 4.3848 0.6249 7.017
Correlation of Fixed Effects:
(Intr) strctr
structure -0.989
SES -0.145 0.164
Linear mixed model fit by REML ['lmerMod']
Formula: math ~ structure + SES + (1 | school.ID)
Data: data.update
REML criterion at convergence: 3666.8
Scaled residuals:
Min 1Q Median 3Q Max
-2.63068 -0.73942 -0.03125 0.75379 2.61908
Random effects:
Groups Name Variance Std.Dev.
school.ID (Intercept) 12.62 3.553
Residual 74.64 8.640
Number of obs: 509, groups: school.ID, 23
Fixed effects:
Estimate Std. Error t value
(Intercept) 57.0278 4.4828 12.721
structure -1.4627 1.1186 -1.308
SES 4.2311 0.5735 7.378
Correlation of Fixed Effects:
(Intr) strctr
structure -0.982
SES -0.111 0.127
Linear mixed model fit by REML ['lmerMod']
Formula: diameter ~ (1 | plate) + (1 | sample)
Data: Penicillin
REML criterion at convergence: 330.9
Scaled residuals:
Min 1Q Median 3Q Max
-2.07922 -0.67139 0.06292 0.58377 2.97957
Random effects:
Groups Name Variance Std.Dev.
plate (Intercept) 0.7169 0.8467
sample (Intercept) 3.7311 1.9316
Residual 0.3024 0.5499
Number of obs: 144, groups: plate, 24; sample, 6
Fixed effects:
Estimate Std. Error t value
(Intercept) 22.9722 0.8086 28.41
Linear mixed model fit by REML ['lmerMod']
Formula: diameter ~ (1 | plate) + (1 | sample)
Data: data.update
REML criterion at convergence: 283
Scaled residuals:
Min 1Q Median 3Q Max
-2.1768 -0.7624 0.1001 0.7220 2.7698
Random effects:
Groups Name Variance Std.Dev.
plate (Intercept) 0.7304 0.8547
sample (Intercept) 3.2215 1.7949
Residual 0.3072 0.5543
Number of obs: 120, groups: plate, 24; sample, 5
Fixed effects:
Estimate Std. Error t value
(Intercept) 22.533 0.823 27.38
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.