eelbrain.testnd.LM

class eelbrain.testnd.LM(y, x, sub=None, data=None, coding='dummy', subject=None, samples=10000, pmin=None, tmin=None, tfce=False, tstart=None, tstop=None, force_permutation=False, **criteria)

Fixed effects linear model

Parameters:
  • y (NDVar | str) – Dependent variable.

  • x (Model | Var | Factor | Interaction | NestedEffect | str) – Model to fit.

  • sub (Var | ndarray | str) – Only use part of the data.

  • data (Dataset) – Optional Dataset providing data for y/model.

  • coding (Literal['dummy', 'effect']) – Model parametrization (default is dummy coding). Vars are centered for effect coding (but not for dummy coding).

  • subject (str) – Optional information used by LMGroup; if subject is a column in ds it will be extracted automatically.

  • samples (int) – Number of samples for permutation test (default 10,000).

  • pmin (float) – Threshold for forming clusters: use a t-value equivalent to an uncorrected p-value.

  • tmin (float) – Threshold for forming clusters as t-value.

  • tfce (float | bool) – Use threshold-free cluster enhancement. Use a scalar to specify the step of TFCE levels (for tfce is True, 0.1 is used).

  • tstart (float) – Start of the time window for the permutation test (default is the beginning of y).

  • tstop (float) – Stop of the time window for the permutation test (default is the end of y).

  • force_permutation (bool) – Conduct permutations regardless of whether there are any clusters.

  • mintime (scalar) – Minimum duration for clusters (in seconds).

  • minsource (int) – Minimum number of sources per cluster.

See also

LMGroup

Examples

See Two-stage test example.

Notes

By default, this model generates a permutation distribution to correct for multiple comparisons. This is not needed for a two-stage model, where correction occurs at the group level. When fitting two-stage models, set samples=0 to skip this and save time.

This class stores a shallow copy of y.info (for predicting).

Methods

cluster(cluster_id[, effect])

Retrieve a specific cluster as NDVar

coefficient(term)

NDVar with regression coefficient for a given term (or 'intercept')

compute_probability_map([effect])

Compute a probability map

find_clusters([pmin, maps, effect])

Find significant regions or clusters

find_peaks()

Find peaks in a TFCE distribution

info_list([computation])

List with information about the test

masked_parameter_map([effect, pmin])

Statistical parameter map masked by significance

predict(values[, name])

Predict y based on given values of x

t(term)

NDVar with t-values for a given term (or 'intercept').