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

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)

Simulating local community dynamics under ecological drift

In 2001 the book by Stephen Hubbell on the neutral theory of biodiversity was a major shift from classical community ecology. Before this book the niche-assembly framework was dominating the study of community dynamics. Very briefly under this framework local species composition is the result of the resource available at a particular site and species … Continue reading Simulating local community dynamics under ecological drift

Exploring the diversity of Life using Rvest and the Catalog of Life

I am writing the general introduction for my thesis and wanted to have a nice illustration of the diversity of Arthropods compared to other phyla (my work focus on Arthropods so this is a nice motivation). As the literature I have had access so far use pie charts to graphically represent these diversities and knowing … Continue reading Exploring the diversity of Life using Rvest and the Catalog of Life