% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/generic-summaries.R
\name{generic_evaluation}
\alias{generic_evaluation}
\title{Generic evaluation for model fits}
\usage{
generic_evaluation(x)
}
\arguments{
\item{x}{A model fitted in seqwrap.}
}
\value{
A tidy data frame possible to combine using seqwrap_summarise
}
\description{
When no evaluation function is provided to seqwrap (eval_fun), this function
uses DHARMa to simulate residuals and test for uniformity, dispersion and
outliers. These tests could guide troubleshooting and detection of model
misspecification.
}
\examples{
# The generic summary works on model objects
library(seqwrap)

if (requireNamespace("glmmTMB", quietly = TRUE)) {
  library(glmmTMB)

  dat <- simcounts(n_genes = 1000,
                   n_samples = 30,
                   beta_0 = 5,
                   overdispersion_min_max = c(1, 10))

  counts <- dat$data
  metadata <- dat$metadata
  metadata$ln_libsize <- log(colSums(counts[,-1]))

  # Save counts for gene i in the same data frame
  metadata$y <- as.integer(counts[1, -1])

  m <- glmmTMB(y ~ as.factor(x) + offset(ln_libsize),
               data = metadata,
               family = nbinom2)

  generic_summary(m)
  generic_evaluation(m)
}

}
