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

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

Crossed and Nested hierarchical models with STAN and R

Below I will expand on previous posts on bayesian regression modelling using STAN (see previous instalments here, here, and here). Topic of the day is modelling crossed and nested design in hierarchical models using STAN in R. Crossed design appear when we have more than one grouping variable and when data are recorded for each … Continue reading Crossed and Nested hierarchical models with STAN and R

Hierarchical models with RStan (Part 1)

Real-world data sometime show complex structure that call for the use of special models. When data are organized in more than one level, hierarchical models are the most relevant tool for data analysis. One classic example is when you record student performance from different schools, you might decide to record student-level variables (age, ethnicity, social … Continue reading Hierarchical models with RStan (Part 1)