Blog Archives

Ploting SEMs in R using semPlot

August 10, 2014
By
Ploting SEMs in R using semPlot

This is a short post presenting the great package semPlot developed by Sacha Epskamp (check out his nice website: http://sachaepskamp.com/) to make nice plots from your SEMs. SEMs are a modelling tool that allow the researcher to investiguate complex relationships between the variables, you may find here many links to free tutorials: http://www.structuralequations.org/. Here I

Read more »

Using bootMer to do model comparison in R

July 13, 2014
By
Using bootMer to do model comparison in R

Setting the right random effect part in mixed effect models can be tricky in many applied situation. I will not talk here about choosing wether a grouping variable (sites, individuals …) should be included as a fixed term or as a random term, please see Gelman and Hill (2006) and Zuur et al (2009) for

Read more »

Regular expression and associated functions in R

June 1, 2014
By
Regular expression and associated functions in R

When working with strings regular expressions are an extremely powerful tool to look for specific patterns in the strings. In informatics a string is several characters put together, this can be words, sentences, or DNA code. Regular expression were developed for the language of Perl (http://www.perl.org/) and have been since then implemented in various other

Read more »

Importing 100 years of climate change into R

May 5, 2014
By
Importing 100 years of climate change into R

This is a flashback post, I was working on species distribution shifts over the last 40 years last summer and recently Rémi Genevest contacted me asking me how I managed to import the CRU TS 1.2 dataset into R. As always a more readable version of the code can be found here. At that time I

Read more »

Checking (G)LM model assumptions in R

April 16, 2014
By
Checking (G)LM model assumptions in R

(Generalized) Linear models make some strong assumptions concerning the data structure: Independance of each data points Correct distribution of the residuals Correct specification of the variance structure Linear relationship between the response and the linear predictor For simple lm 2-4) means that the residuals should be normally distributed, the variance should be homogenous across the

Read more »

Interpreting interaction coefficient in R (Part1 lm)

April 8, 2014
By
Interpreting interaction coefficient in R (Part1 lm)

Interaction are the funny interesting part of ecology, the most fun during data analysis is when you try to understand and to derive explanations from the estimated coefficients of your model. However you do need to know what is behind these estimate, there is a mathematical foundation between them that you need to be aware

Read more »

Generalized Linear Mixed Models in Ecology and in R

March 12, 2014
By
Generalized Linear Mixed Models in Ecology and in R

I had a nice workshop two weeks ago in Tübingen (south-germany) concerning Generalized Linear Mixed Models (GLMM) in R. The course was given by two ecologist: Dr. Pius and Fränzi Korner-Nievergelt  that spend now half of their time doing statistical consulting (http://www.oikostat.ch/navigation_engl.htm). Nice reference concerning GLMMs are: the 2009 Bolker paper (paper),  the 2007 book

Read more »

Computing R square for Generalized Linear Mixed Models in R

March 2, 2014
By
Computing R square for Generalized Linear Mixed Models in R

R square is a widely used measure of model fitness, in General Linear Models (GLM) it can be interpreted as the percent of variance in the response variable explained by the model. This measure is unitless which makes it useful to compare model between studies in meta-analysis analysis. Generalized Linear Mixed models (GLMM) are extending

Read more »

Adding color to R plot: a function

February 24, 2014
By
Adding color to R plot: a function

A friend of mine told me that she was spending her day colouring R plot because she never understood how to put color in them. This triggered a nerdy reaction in me that I had to put in a basic function. This was actually a funny exercise for two reasons: forced me to think at

Read more »

Simulating dice throws in R

December 20, 2013
By
Simulating dice throws in R

I am currently following a course on probability theory in coursera (https://www.coursera.org/course/probas) and I’ve seen some graphs concerning the outcome of some dice throws. Being an R-nerd I wrote a little function to do this in R. This is nothing fancy just I find it interesting the process of thoughts going from a real-world problem

Read more »