fit_attrib {attrib} | R Documentation |

## Data fit

### Description

Data fit using glmer from lme4 with family poisson to fit the dataset with the given formula.

### Usage

```
fit_attrib(data, response, fixef, ranef, offset = NULL)
```

### Arguments

`data` |
The observed data to be fitted. |

`response` |
The response |

`fixef` |
The fixed effects |

`ranef` |
The random effects |

`offset` |
The offsets. |

### Value

The model fit of the data with additional attributes offset, response and fit_fix. Offset and response are the same as in the input and fit_fix is the linear model of the fix effects.

For more details see the help vignette:
`vignette("intro", package="attrib")`

### Examples

```
response <- "deaths"
fixef <- "pr100_ili_lag_1 + sin(2 * pi * (week - 1) / 52) + cos(2 * pi * (week - 1) / 52)"
ranef <- " (pr100_ili_lag_1| season)"
offset <- "log(pop)"
data <- attrib::data_fake_nation
fit_attrib(data = data, response = response, fixef = fixef, ranef = ranef, offset = offset)
```

[Package

*attrib*version 2021.1.2 Index]