fmri.lm {fmri} | R Documentation |
Estimate the parameters and variances in a linear model.
fmri.lm(data, z, actype = "accalc", hmax = 3.52, vtype = "var", step = 0.01, contrast = c(1), vvector = c(1), keep = "essential")
data |
object of class "fmridata" |
z |
designmatrix specifying the expected BOLD response(s) and additional components for trend and other effects. |
actype |
string describing the type of handling autocorrelation of time series. "nonac", "ac", "accalc", "smooth" |
hmax |
bandwidth for smoothing autocorrelation parameter if actype = "smooth" |
vtype |
method of estimating residual variance (only "var" implemented) |
step |
step size for binning autocorrelations (see details) |
contrast |
contrast vector |
vvector |
vector defining the parameters for which the
covariance matrix is returned as well as the corresponding length of
the vector cbeta in each voxel |
keep |
string describing the amount of data returned: "essential", "diagnostic", "all" |
This function performs parameter estimation in the linear model.
It implements a two step procedure. After primary estimation of the
parameters in the first step residuals
are obtained. If actype
%in%
c("ac", "accalc", "smooth")
an AR(1) model is fitted, in each voxel, to
the time series of residuals. The estimated AR-coefficient is corrected for bias.
If actype=="smooth"
the estimated AR-coefficients are spatially smoothed using bandwidth hmax
.
If actype
%in%
c("ac", "smooth")
the linear model is prewithened
using the estimated (smoothed) AR-coefficients. Parameter
and variance estimates are then obtained from the prewithened
data. The argument keep
describes the amount of data which is
returned. If "essential" only the estimated effects
tilde{gamma}_i = C^Ttilde{β}_i
and their
estimated variances are returned. "all" gives the full data, including
residuals, temporal autocorrelation.
If vvector
is given and has length greater than 1, the
covariance matrix for the stimuli given therein are returned
(varm
) and vwghts
contains an estimate for the ratio of
the variances of the parameter for the stimuli indicated in
vvector
. cbeta
then contains the corresponding parameter
estimates and thus is a vector of corresponding length in each voxel.
object with class attributes "fmrispm" and "fmridata"
beta |
estimated parameters |
cbeta |
estimated contrast of parameters |
var |
estimated variance of the contrast of parameters. |
varm |
covariance matrix of the parameters given by vvector |
res |
residuals of the estimated linear model |
arfactor |
estimated autocorrelation parameter |
scorr |
spatial correlation of data |
weights |
ratio of voxel dimensions |
vwghts |
ratio of estimated variances for the stimululi given by
vvector |
rxyz |
array of smoothness from estimated correlation for each voxel in resel space (for analysis without smoothing) |
hrf |
expected BOLD response for contrast |
vvector
is intended to be used for delay of the HRF using
its first derivative. Do not mix with the contrast
argument, since
unexpected side effects may occur. Look out for updates of this package.
Karsten Tabelow tabelow@wias-berlin.de
Worsley, K.J. (2005). Spatial smoothing of autocorrelations to control the degrees of freedom in fMRI analysis. NeuroImage, 26:635-641.
Worsley, K.J., Liao, C., Aston, J., Petre, V., Duncan, G.H., Morales, F., Evans, A.C. (2002). A general statistical analysis for fMRI data. NeuroImage, 15:1-15.
# Example 1 data <- list(ttt=array(rnorm(32*32*32*107),c(32,32,32,107)), mask=array(1,c(32,32,32))) class(data) <- "fmri.data" hrf <- fmri.stimulus(107, c(18, 48, 78), 15, 2) z <- fmri.design(hrf,2) model <- fmri.lm(data,z,keep="all") plot(data$ttt[16,16,16,]) lines(data$ttt[16,16,16,] - model$res[16,16,16,],col=2)