Home » lme4 » Recent Articles:

Influence.ME: Simple Analysis

July 16, 2009 Influence.ME No Comments
Influence.ME: Simple Analysis

With the introduction of our new package for influential data influence.ME, I’m currently writing a manual for the package. This manual will address topics for both the experienced, and the inexperienced users.

I will also present much of the content of this manual on my blog. Of course, feel free to comment on it, and readers are encouraged to discuss the content of the manual here. All information will be accessible from the influence.ME website as well. Note that updates to the manual will be made available on that website”, instead of updating this blog post. So, please refer to the influence.ME website for the most up-to-date information.

This is the first section on influence.ME, which deals with a very simply analysis of students nested within 23 schools. Only the effect of a single variable measured at the school level is estimated.

… Continue Reading

Presenting influence.ME at useR!

July 10, 2009 Influence.ME 2 Comments

Logo influence.ME

Today I presented influence.ME at the useR! conference in Rennes. Influence.ME is an R package for detecting influential data in mixed models. I developed this package together with Ben Pelzer and Manfred te Grotenhuis.

More information about influence.ME can be found on another section of my website.

Below, please find the slides of the presentation.
Presentation Influence.ME at Rennes, useR! 2009

Influence.ME: don’t specify the intercept

June 18, 2009 Influence.ME No Comments

Just recently, I was contacted by a researcher who wanted to use influence.ME to obtain model estimates from which iteratively some data was deleted. In his case, observations were nested within an area, but there were very unequal numbers of observations in each area.

Unfortunately, he wasn’t able to use the influence.ME package on his models. He kindly sent me his data, so I could figure out what went wrong, and it showed to be a little problem with influence.ME.

The problem was with how the model was specified: the intercept was explicated, next to several (fixed) variables. It turned out, that such a model specification is not compatible with the internal changes made to the mixed model. Therefore, I advise users of influence.ME not to explicitly specify the intercept in their lme4 regression models.

I reproduced the problem with the school23 data, which is available in influence.ME. Compare the two model specifications below: in the first the intercept is specified, in the second it isn’t. The outcomes of both lmer models are identical. However, the first returns a convergence error when used with the estex() function, while the second doesn’t.

The input:

mod <- lmer(math ~ 1 + structure + (1 | school.ID), data=school23)
estex.mod <- estex(mod, "school.ID")

mod <- lmer(math ~ structure + (1 | school.ID), data=school23)
estex.mod <- estex(mod, "school.ID")

The output:

> mod <- lmer(math ~ 1 + structure + (1 | school.ID), data=school23)
> estex.mod <- estex(mod, "school.ID")
Error in mer_finalize(ans) : Downdated X'X is not positive definite, 3.
>
> mod <- lmer(math ~ structure + (1 | school.ID), data=school23)
> estex.mod <- estex(mod, "school.ID")

I will surely investigate whether this can be resolved in a future update, but for now, simply leave the intercept out of your model specification: lmer will add it for you.


Influence.ME is an R package and provides tools for detecting influential data in mixed effects models. More information can be found here.

useR! 2009 acceptance: presenting influence.ME

Logo influence.ME

The organizing committee of the useR! 2009 conference just informed me, that my submission for presenting my extension package influence.ME, has been accepted! Influence.ME is a new R package that I’m currently developing, with the indispensable help of Ben Pelzer and Manfred te Grotenhuis. Although I did not yet introduce influence.ME on this blog, rest assured that I will do so within just a few weeks. Now is time for celebration!
… Continue Reading

R-Sessions 32: Forward.lmer: Basic stepwise function for mixed effects in R

February 13, 2009 R-Project, R-Sessions 6 Comments

Intended to be a customized solution, it may have grown to be a little more. forward.lmer is an early installment of a full stepwise function for mixed effects regression models in R-Project. I may put in some work to extend it, or I may not. Nevertheless, in a ‘forward sense of stepwise’, I think it can be pretty useful as it is. Also, it has an interesting take on the stepwise concept, I think.

… Continue Reading

R-Sessions 31: Combining lmer output in a single table (UPDATED)

February 5, 2009 R-Project, R-Sessions 1 Comment


There are various ways of getting your output from R to your publication draft. Most of them are highly efficient, but unfortunately I couldn’t find a function that combines the output from several (lmer) models and presents it in a single table. lmer is the mixed effects model function from the lme4 package. So, I wrote a simple function that does exactly that.
… Continue Reading

R-Sessions 19: Extractor Functions

September 5, 2008 R-Project, R-Sessions No Comments


Unlike most statistical software packages, R often stores the results of an analysis in an object. The advantage of this is that while not all output is shown in the screen ad once, it is neither necessary to estimate the statistical model again if different output is required.

This paragraph will show the kind of data that is stored in a multilevel model estimated by R-Project and introduce some functions that make use of this data.
… Continue Reading

R-Sessions 17: Generalized Multilevel {lme4}

September 1, 2008 R-Project, R-Sessions 1 Comment



Although all introductions on regression seem to be based on the assumption of data that is distributed normally, in practice this is not the case. Many other types of distributions exist. To name a few: normal distribution, binomial distribution, poisson, gaussian and so on. The lmer()-function in the lme4-package can easily estimate models based on these distributions. This is done by adding the ‘family’-argument to the command syntax, thereby specifying that not a linear multilevel model needs to be estimated, but a generalized linear model.
… Continue Reading

R-Sessions 16: Multilevel Model Specification (lme4)

August 27, 2008 R-Project, R-Sessions No Comments


Multilevel models, or mixed effects models, can easily be estimated in R. Several packages are available. Here, the lmer() function from the lme4-package is described. The specification of several types of models will be shown, using a fictive example. A detailed description of the specification rules is given. Output of the specified models is given, but not described or interpreted.
Please note that this description is very closely related to the description of the specification of the lme() function of the nlme-package. The results are similar and here exactly the same possibilities are offered.
… Continue Reading

Welcome to Curving Normality

Curving Normality is an academic blog maintained by Rense Nieuwenhuis. He uses this blog to write about the social sciences in general, fascinating journal papers, useful data, interesting books, statistics using R. In addition, his personal academic activities are shared here, as well.