Spatial regression in R part 1: spaMM vs glmmTMB

Many dataset these days are collected at different locations over space which may generate spatial dependence. Spatial dependence (observation close together are more correlated than those further apart) violate the assumption of independence of the residuals in regression models and require the use of a special class of models to draw valid inference. The first … Continue reading Spatial regression in R part 1: spaMM vs glmmTMB

Interpreting three-way interactions in R

A reader asked in a comment to my post on interpreting two-way interactions if I could also explain interaction between two categorical variables and one continuous variable. Rather than just dwelling on this particular case, here is a full blog post with all possible combination of categorical and continuous variables and how to interprete standard … Continue reading Interpreting three-way interactions in R

Introduction to point pattern analysis for ecologists

Point pattern analysis is a set of techniques to analyze spatial point data. In ecology this type of analysis may arise in several context but make specific assumptions regarding the ways the data were generated, so let's first see what type of ecological data may or may not be relevant for point pattern analysis.  What … Continue reading Introduction to point pattern analysis for ecologists

Adding group-level predictors in GLMM using lme4

Sometime I happen to be wrong, this is one of these instance. The issue: a colleague measured individual plant growth and measured light irradiation received by each individual, the plants where in groups of 10 individuals and he measured soil parameters at the group-level. To analyze the effect of light on plant growth while controlling … Continue reading Adding group-level predictors in GLMM using lme4

Simulating SEMs for piecewiseSEM: part 1 the basics

Structural Equation Models are being used more and more frequently by ecologists due to the appeal of linking variables together in complex web of interactions. There are currently two main libraries in R to fit such models: lavaan and piecewiseSEM. The aim of this post is not to discuss the advantages and drawbacks of these … Continue reading Simulating SEMs for piecewiseSEM: part 1 the basics

How not to control for multiple testing

While reading the method section of a recent article by Solivares et al, I came upon the following paragraph: "The inclusion of many predictors in statistical models increases the chance of type I error (false positives). To account for this we used a Bernoulli process to detect false discovery rates, where the probability (P) of … Continue reading How not to control for multiple testing

Interpreting random effects in linear mixed-effect models

Recently I had more and more trouble to find topics for stats-orientated posts, fortunately a recent question from a reader gave me the idea for this one. In this post I will explain how to interpret the random effects from linear mixed-effect models fitted with lmer (package lme4). For more informations on these models you … Continue reading Interpreting random effects in linear mixed-effect models

Patterns across 50 years of French presidential election

[Une version francaise de cette article est disponible ici] This year (2017) we will have our presidential election between April and May in France. A while ago I discovered the open data website of the French government publishing public data with free access and promoting utilization by anyone. So in this post I will explore … Continue reading Patterns across 50 years of French presidential election