% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/predictInterval_helpers.R
\name{summarise_predictions}
\alias{summarise_predictions}
\title{Summarise prediction simulations into intervals}
\usage{
summarise_predictions(
  yhat_arr,
  level,
  stat.type,
  predict.type,
  N,
  merMod = NULL,
  which.eff = "full",
  pi.comps = NULL,
  is.glmm.with.response = FALSE
)
}
\arguments{
\item{yhat_arr}{matrix of simulated predictions with dimensions (N x n.sims),
or for `which = "all"`, the combined yhat from `combine_components()`.}

\item{level}{numeric confidence level (e.g., 0.8 for 80}

\item{stat.type}{character either "median" or "mean" for the central estimate.}

\item{predict.type}{character either "linear.prediction" or "probability".}

\item{N}{integer number of observations in the original newdata.}

\item{merMod}{merMod object, required when `predict.type = "probability"` to
access the link function.}

\item{which.eff}{character the effect type: "full", "fixed", "random", or "all".}

\item{pi.comps}{list of component prediction matrices (from `combine_components()`
when `which = "all"`), or NULL for other cases.}
}
\value{
data.frame with columns `fit`, `upr`, `lwr`. For `which = "all"`,
  includes additional columns `effect` and `obs`.
}
\description{
Takes the simulated prediction array and computes summary statistics
(fit, lower bound, upper bound) based on the specified statistic type
and confidence level. Handles probability transformation and the
`which = "all"` case with component-wise summaries.
}
\keyword{internal}
