Skip to contents

This function estimates betas (regression coefficients) for fixed and random effects in a matrix dataset using various methods.

Usage

estimate_betas(x, ...)

# S3 method for latent_dataset
estimate_betas(
  x,
  fixed = NULL,
  ran,
  block,
  method = c("mixed", "pls", "pls_global", "ols"),
  basemod = NULL,
  ncomp = 4,
  lambda = 0.01,
  prewhiten = TRUE,
  ...
)

Arguments

x

An object of class matrix_dataset representing the matrix dataset

...

Additional arguments passed to the estimation method

fixed

A formula specifying the fixed regressors that model constant effects (i.e., non-varying over trials)

ran

A formula specifying the random (trialwise) regressors that model single trial effects

block

A formula specifying the block factor

method

The regression method for estimating trialwise betas; one of "mixed", "pls", "pls_global", or "ols" (default: "mixed")

basemod

A baseline_model instance to regress out of data before beta estimation (default: NULL)

ncomp

Number of PLS components for the "pls" and "pls_global" methods (default: 4)

lambda

Lambda parameter (not currently used; default: 0.01)

Value

A list of class "fmri_betas" containing the following components:

  • betas_fixed: Matrix representing the fixed effect betas

  • betas_ran: Matrix representing the random effect betas

  • design_ran: Design matrix for random effects

  • design_fixed: Design matrix for fixed effects

  • design_base: Design matrix for baseline model

See also