Analysis of count data with covariates in R using LORI - tutorial

Genevieve Robin

2018-11-16

LORI (LOw-Rank Interaction) model for count data with covariates

The LORI model is designed to analyse count data with covariates, using a Poisson log-linear model. In particular, it can be used to assess the effect of temporal and geographical covariates on species abundances.

Let \(Y\in\mathbb{N}^{n\times p}\) be a (incomplete) matrix of counts, and \(L\in\mathbb{R}^{np\times K}\) a matrix of covariates about the rows and columns of \(Y\). For example if \(Y\) counts the abundance of species across sites (rows) and time stamps (columns), \(L\) might contain temporal, spatial, and spatio-temporal information.

library(lori)
library(glmnet)
## Loading required package: Matrix
## Loading required package: foreach
## Loaded glmnet 2.0-16
library(gridExtra)
data("aravo")

Example: Aravo data set

The {Aravo data set} measures the abundance of \(82\) species of alpine plants in \(75\) sites in France. The data consist of a contingency table collecting the abundance of species across sampling sites. Covariates about the environments and species are also available.

##      Aspect Slope Form PhysD ZoogD Snow
## AR07      7     2    1    50    no  140
## AR71      1    35    3    40    no  140
## AR26      5     0    3    20    no  140
## AR54      9    30    3    80    no  140
## AR60      9     5    1    80    no  140
## AR70      1    30    3    40    no  140
##           Height Spread Angle  Area Thick  SLA N_mass Seed
## Agro.rupe      6     10    80  60.0  0.12  8.1 218.70 0.08
## Alop.alpi      5     20    20 190.9  0.20 15.1 203.85 0.21
## Anth.nipp     15      5    50 280.0  0.08 18.0 219.60 0.54
## Heli.sede      0     30    80 600.0  0.20 10.6 233.20 1.72
## Aven.vers     12     30    60 420.0  0.14 12.5 156.25 1.17
## Care.rosa     30     20    80 180.0  0.40  6.5 208.65 1.68
## 
 1 / 100
 2 / 100
 3 / 100
 4 / 100
 5 / 100
 6 / 100
 7 / 100
 8 / 100
 9 / 100
 10 / 100
 11 / 100
 12 / 100
 13 / 100
 14 / 100
 15 / 100
 16 / 100
 17 / 100
 18 / 100
 19 / 100
 20 / 100
 21 / 100
 22 / 100
 23 / 100
 24 / 100
 25 / 100
 26 / 100
 27 / 100
 28 / 100
 29 / 100
 30 / 100
 31 / 100
 32 / 100
 33 / 100
 34 / 100
 35 / 100
 36 / 100
 37 / 100
 38 / 100
 39 / 100
 40 / 100
 41 / 100
 42 / 100
 43 / 100
 44 / 100
 45 / 100
 46 / 100
 47 / 100
 48 / 100
 49 / 100
 50 / 100
 51 / 100
 52 / 100
 53 / 100
 54 / 100
 55 / 100
 56 / 100
 57 / 100
 58 / 100
 59 / 100
 60 / 100
 61 / 100
 62 / 100
 63 / 100
 64 / 100
 65 / 100
 66 / 100
 67 / 100
 68 / 100
 69 / 100
 70 / 100
 71 / 100
 72 / 100
 73 / 100
 74 / 100
 75 / 100
 76 / 100
 77 / 100
 78 / 100
 79 / 100
 80 / 100
 81 / 100
 82 / 100
 83 / 100
 84 / 100
 85 / 100
 86 / 100
 87 / 100
 88 / 100
 89 / 100
 90 / 100
 91 / 100
 92 / 100
 93 / 100
 94 / 100
 95 / 100
 96 / 100
 97 / 100
 98 / 100
 99 / 100
 100 / 100
## [1] "fitting model..."
##      Aspect       Slope       PhysD        Snow      Height      Spread 
##  0.03816249  0.07068903 -0.01885280 -0.07266952  0.09352706 -0.23549973 
##       Angle        Area       Thick         SLA      N_mass        Seed 
## -0.18378894 -0.19442296 -0.10853617 -0.16781372  0.18158564 -0.11689427