| wald_univariate | R Documentation |
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.
wald_univariate(object, scale_vcovmat_by = 1, cv, ...)
object |
A fitted lgspline object. Must have been fit with
|
scale_vcovmat_by |
Numeric; scaling factor for the variance-covariance matrix. Default 1. |
cv |
Numeric; critical value for confidence intervals. If missing,
defaults to |
... |
Additional arguments passed to the internal |
An object of class "wald_lgspline", a list with:
Matrix with columns: Estimate, Std. Error, t value or z value, Pr(>|t|) or Pr(>|z|), CI LB, CI UB.
Critical value used.
GLM family from the fitted model.
Number of observations.
Effective df trace term.
"t value" or "z value".
"Pr(>|t|)" or "Pr(>|z|)".
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.
lgspline, confint.lgspline,
print.wald_lgspline, summary.wald_lgspline,
plot.wald_lgspline
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.