4.1 Linear predictor (LP)

library(INLA)
## Loading required package: Matrix
## 
## Attaching package: 'Matrix'
## The following objects are masked from 'package:tidyr':
## 
##     expand, pack, unpack
## Loading required package: foreach
## 
## Attaching package: 'foreach'
## The following objects are masked from 'package:purrr':
## 
##     accumulate, when
## Loading required package: parallel
## This is INLA_22.12.16 built 2022-12-23 13:24:10 UTC.
##  - See www.r-inla.org/contact-us for how to get help.
##  - To enable PARDISO sparse library; see inla.pardiso()
library(ggplot2)
  1. step one: writing linear predictor as an R formula

Responsevariablefixed+randomeffect

Random effect are put inside f() with a name of model arguments (“iid”)

ηi=βo+β1x1+β2x2+ui

uiN(0,σ2u)

y ~ x1 + x2 + f(i, model = "iid")
y ~ 0 = b0 + x1 + x2 + f(i, model = "iid")