% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/methods.R
\name{wald_univariate}
\alias{wald_univariate}
\title{Univariate Wald Tests and Confidence Intervals for lgspline Coefficients}
\usage{
wald_univariate(object, scale_vcovmat_by = 1, cv, ...)
}
\arguments{
\item{object}{A fitted lgspline object. Must have been fit with
\code{return_varcovmat = TRUE}.}

\item{scale_vcovmat_by}{Numeric; scaling factor for the variance-covariance
matrix. Default 1.}

\item{cv}{Numeric; critical value for confidence intervals. If missing,
defaults to \code{object$critical_value} or \code{qnorm(0.975)}.}

\item{...}{Additional arguments passed to the internal \code{wald_univariate}
method.}
}
\value{
An object of class \code{"wald_lgspline"}, a list with:
\describe{
  \item{coefficients}{Matrix with columns: Estimate, Std. Error,
        t value or z value, Pr(>|t|) or Pr(>|z|), CI LB, CI UB.}
  \item{critical_value}{Critical value used.}
  \item{family}{GLM family from the fitted model.}
  \item{N}{Number of observations.}
  \item{trace_XUGX}{Effective df trace term.}
  \item{statistic_name}{"t value" or "z value".}
  \item{p_value_name}{"Pr(>|t|)" or "Pr(>|z|)".}
  \item{df.residual}{Residual degrees of freedom when supplied by the
        internal Wald method.}
}
Print, summary, and plot methods are available; see
\code{\link{print.wald_lgspline}}, \code{\link{summary.wald_lgspline}},
\code{\link{plot.wald_lgspline}}.
}
\description{
Computes per-coefficient Wald tests and confidence intervals from a fitted
lgspline. For Gaussian identity-link models, t-statistics and t-intervals
are used; otherwise z-statistics.
}
\examples{

set.seed(1234)
t <- runif(1000, -10, 10)
y <- 2*sin(t) + -0.06*t^2 + rnorm(length(t))
model_fit <- lgspline(t, y, return_varcovmat = TRUE)

wald_default <- wald_univariate(model_fit)
print(wald_default)

## t-distribution critical value
eff_df <- model_fit$N - model_fit$trace_XUGX
wald_t <- wald_univariate(model_fit, cv = qt(0.975, eff_df))
print(wald_t)

coef_table <- wald_default$coefficients
plot(wald_default)

}
\seealso{
\code{\link{lgspline}}, \code{\link{confint.lgspline}},
\code{\link{print.wald_lgspline}}, \code{\link{summary.wald_lgspline}},
\code{\link{plot.wald_lgspline}}
}
