standard_error: Extract Standard Errors from a Model Fit

View source: R/all_generic.R

standard_errorR Documentation

Extract Standard Errors from a Model Fit

Description

Extract standard errors of parameter estimates from a fitted model object. This is part of a family of functions for extracting statistical measures.

Usage

standard_error(x, ...)

Arguments

x

The fitted model object

...

Additional arguments passed to methods. Common arguments include:

type

The type of standard errors to extract (e.g., "estimates" or "contrasts")

Value

A tibble or matrix containing standard errors of parameter estimates

See Also

Other statistical_measures: p_values(), stats()

Examples

# Create example data
event_data <- data.frame(
  condition = factor(c("A", "B", "A", "B")),
  onsets = c(1, 10, 20, 30),
  run = c(1, 1, 1, 1)
)

# Create sampling frame and dataset
sframe <- sampling_frame(blocklens = 50, TR = 2)
dset <- matrix_dataset(
  matrix(rnorm(100 * 2), 100, 2),
  TR = 2,
  run_length = 50,
  event_table = event_data
)

# Fit model
fit <- fmri_lm(
  onsets ~ hrf(condition),
  block = ~run,
  dataset = dset
)

# Extract standard errors
se <- standard_error(fit)

bbuchsbaum/fmrireg documentation built on March 1, 2025, 11:20 a.m.