GroupedMean¶
Group instances (trials) and calculate the mean, and optionally the error, for each group.
Instances refers to items along an Instance axis; typically these equate to "trials" that were segmented using Segmentation based on event markers specified as targets in AssignTargets. The Instance axis has a data array which itself can contain any number of fields, so that each instance/trial can have a set of fields associated with it (i.e., Marker, TargetValue, are most common, the latter is where AssignTargets stores its class values; the statistics nodes create others; you can add your own). In statistics these are typically used to represent factors. By default, if the "group-by fields" are not specified, this node will create a group for each unique combination of values in all fields marked as a category field, so typically this would be one group per class in TargetValue. Therefore, a typical use case for this node is to compute ERPs by assigning target values to event markers using AssignTargets, segmenting the data into instances (trials) using Segmentation, computing spectrum, process, etc., and then calculate the mean and error for each class using this node with its defaults (i.e., no group-by fields specified).
Version 1.1.1
Ports/Properties¶
data¶
Data to process.
group_cols¶
Optionally specify the names of instance data table fields that will be used to determine grouping. e.g. ['Marker'] or ['Subject', 'Marker']
mean_type¶
Type of mean estimate to compute. Note that the Huber mean is not a mass-univariate but a multivariate mean, which may not be what you expect.
trim_proportion¶
Proportion of data instances to trim (per variable) on the lower and upper tails of the data. If only a single number is provided then it is used for both lower and upper. If no non-zero numbers are provided then no trimming is performed (default).
winsorize¶
If trim_proportion has a non-zero value, then setting winsorize to True (default) will cause winsorization to be used instead of standard trimming.
error_type¶
Add 'grouped_mean' StatisticAxis to the chunk, containing param_types=[stats.P arameterType.ESTIMATE, stats.ParameterType.ERROR]. std: standard deviation; sem: standard error of the mean; var: variance; mad: median absolute difference; CI: upper confidence interval - mean. See ci_range parameter.
fill_cols¶
If True, instance columns that are not used for grouping will be filled with reasonable default values. If False, instance columns that are not used for grouping will be masked out in the output instance axis data.
grouping_type¶
If levels (default), then means (and optionally errors) are calculated per unique level of each factor and interaction. If unpaired-diffs, then differences of means are calculated for each pair of levels. Use this option to calculate differences in means and difference error analogous to a two independent sample t-test assuming equal variances. When error_type is not none, a common variance is calculated instead of using the group-variances. If global, then only a single mean (and error) is calculated for all instances.
equal_var¶
If grouping_type is 'unpaired-diffs', set this to True to assume equal population variance among groups. If False (default), unequal population variance among groups is assumed.
ddof¶
Passed to numpy.s td. In standard statistical practice, ddof=1 provides an unbiased estimator of the variance of the infinite population. ddof=0 provides a maximum likelihood estimate of the variance for normally distributed variables.
sort_order¶
If alphabetical (default), instance axis elements are returned in alphabetical order, otherwise they are returned in order of first appearance.
ci_range¶
Range for confidence interval if CI selected as error_type.
allow_markers¶
If true, marker streams with an instance axis will be processed; otherwise they will be ignored.
use_caching¶
Enable caching.
set_breakpoint¶
Set a breakpoint on this node. If this is enabled, your debugger (if one is attached) will trigger a breakpoint.
metadata¶
User-definable meta-data associated with the node. Usually reserved for technical purposes.