wald_univariate: Univariate Wald Tests and Confidence Intervals for lgspline...

View source: R/methods.R

wald_univariateR Documentation

Univariate Wald Tests and Confidence Intervals for lgspline Coefficients

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.

Usage

wald_univariate(object, scale_vcovmat_by = 1, cv, ...)

Arguments

object

A fitted lgspline object. Must have been fit with return_varcovmat = TRUE.

scale_vcovmat_by

Numeric; scaling factor for the variance-covariance matrix. Default 1.

cv

Numeric; critical value for confidence intervals. If missing, defaults to object$critical_value or qnorm(0.975).

...

Additional arguments passed to the internal wald_univariate method.

Value

An object of class "wald_lgspline", a list with:

coefficients

Matrix with columns: Estimate, Std. Error, t value or z value, Pr(>|t|) or Pr(>|z|), CI LB, CI UB.

critical_value

Critical value used.

family

GLM family from the fitted model.

N

Number of observations.

trace_XUGX

Effective df trace term.

statistic_name

"t value" or "z value".

p_value_name

"Pr(>|t|)" or "Pr(>|z|)".

df.residual

Residual degrees of freedom when supplied by the internal Wald method.

Print, summary, and plot methods are available; see print.wald_lgspline, summary.wald_lgspline, plot.wald_lgspline.

See Also

lgspline, confint.lgspline, print.wald_lgspline, summary.wald_lgspline, plot.wald_lgspline

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)


lgspline documentation built on May 8, 2026, 5:07 p.m.