Fits a general linear model of every haemoglobin channel against
HRF-convolved task regressors: for each condition, a boxcar over its stimulus
blocks convolved with a canonical double-gamma HRF, plus a discrete-cosine
drift basis and optional short-separation nuisance regressors. Returns the
per-channel activation amplitude (beta), standard error and t-statistic for
each condition. Run it separately on the HbO and HbR assays.
Arguments
- x
A
PhysioExperimentof haemoglobin concentration (e.g. theHbOassay frommbll()).- events
A
data.framewith numericonsetandduration(seconds) and aconditioncolumn; ifNULL, the object's events (PhysioExperiment::getEventsonset/duration/value) are used, withvalueas the condition.- assay_name
Assay to model (default
"HbO").- conditions
Optional character vector selecting/ordering conditions.
- basis
"canonical"(HRF only) or"derivative"(HRF + temporal derivative per condition).- drift
Number of discrete-cosine drift terms (default 6).
- nuisance
Optional numeric matrix of extra nuisance regressors (e.g.
shortSeparationDesign()output).- hrf
List of HRF parameters (
peak,undershoot,ratio).- prewhiten
"none"or"ar1"(per-channel AR(1) prewhitening; strongly recommended for fNIRS to avoid inflated t-statistics).
Value
An S3 nirs_activation_glm with coefficients (a channel x
condition data.frame of beta, se, t, df, p), the beta/se
matrices, per-channel sigma2/rho, and the design (for
nirsActivationContrast()).
References
Friston KJ et al. (1994) Statistical parametric maps. Hum Brain Mapp 2:189-210. Huppert TJ et al. (2009) HomER. Appl Opt 48:D280.
Examples
hb <- mbll(intensityToOD(PhysioNIRS:::.nirs_demo_object()))
fit <- nirsActivationGLM(hb, assay_name = "HbO")
fit$coefficients
#> channel condition beta se t df p
#> 1 S1_D1 task 0.03532496 0.1592257 0.2218547 152 0.8247248
#> 2 S2_D2 task 0.13246861 0.5970962 0.2218547 152 0.8247248