Skip to content

← statistics package

TTest

Compute a t-test.

This node supports 1-sample and 2-sample unpaired and paired t-tests. The node requires that the data has an instance axis. In order to use 2-sample t-tests, the instance axis must have a field (e.g., 'Marker' or 'TargetValue') according to which the individual trials can be grouped. For paired t-tests, an additional field in the instance axis is required (e.g., 'Subject') that identifies trials that shall be paired. The node performs multiple mass-univariate t-tests when additional axes are present in the data. The sign of the 2-sample t-test will be the result of element1-element2, where element1 and element2 are the trials to be compared, specified in that order in the 'grouping' parameter (or previously with SelectInstances). In the output packet, the instance axis will be replaced by a feature axis (with the 'statistic_types' custom label), with fields for the t-stat, p-val and Cohen's D values. Returned p-values are 2-sided (2-tailed); the 1-tailed value is half the returned value but is only valid for effects with the hypothesized sign. (Note: For backward compatibility reasons (versions < 1.2.0), legacy_mode is set to True and therefore this node will store the stats in a Feature axis instead of a Statistic axis. Please update your pipelines as needed to assume a Statistic axis and then set legacy_mode to False. This will be deprecated in a future release.) More Info... Version 1.2.1

Ports/Properties

data

A packet containing at least one signal chunk with an instance axis. For two-sample t-tests, the instances must be separated into two groups according to an instance axis data field. For paired t-tests, these two groups must be identical in size and have another instance axis data field to indicate sample pairing.

  • verbose name: Data
  • default value: None
  • port type: DataPort
  • value type: Packet (can be None)
  • data direction: INOUT

comparison_value

For 1-sample t-test, compare mean against this value.

  • verbose name: Comparison Value
  • default value: 0
  • port type: FloatPort
  • value type: float (can be None)

nan_policy

Defines how to handle when input contains nan. ‘propagate’ returns nan, ‘raise’ throws an error, ‘omit’ performs the calculations ignoring nan values. Default is ‘propagate’.

  • verbose name: Nan Policy
  • default value: propagate
  • port type: EnumPort
  • value type: str (can be None)

grouping

A dictionary that describes how the instance axis should be split up to separate instances into two groups for two-sample t-tests. The dict key indicates the instance axis field, and its value is a length-2 list of items to which the instance data are compared to determine grouping. The t-test will be performed on the two items in the order in which they are specified, for example, {'Marker': ['Post', 'Pre']}, will separate instances according to the Marker value, and the t-test will be result of post-pre. Alternatively, this can be left blank if you use SelectInstances to select the trials to test (again listing them in the order in which the operation is to be performed), followed by DescribeStatisticalDesign if grouping determined by a field other than TargetValue or Marker.

  • verbose name: Grouping
  • default value: None
  • port type: DictPort
  • value type: dict (can be None)

equal_var

If True, perform a standard independent 2 sample test that assumes equal population variances. If False (default), perform Welch’s t-test, which does not assume equal population variance. This parameter is used only by 2 independent sample test.

  • verbose name: Equal Var
  • default value: False
  • port type: BoolPort
  • value type: bool (can be None)

pairing_field

The name of the field in the instance axis data that links pairs of instances that have been separated according to the grouping parameter. Providing this parameter indicates that a paired t-test is desired.

  • verbose name: Pairing Field
  • default value: None
  • port type: StringPort
  • value type: str (can be None)

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).

  • verbose name: Trim Proportion
  • default value: [0, 0]
  • port type: ListPort
  • value type: list (can be None)

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.

  • verbose name: Winsorize
  • default value: True
  • port type: BoolPort
  • value type: bool (can be None)

legacy_mode

Store the statistics in a Feature axis instead of a Statistic axis. Included for backward compatibility and will be deprecated.

  • verbose name: Legacy Output Format
  • default value: True
  • port type: BoolPort
  • value type: bool (can be None)

use_caching

Enable caching.

  • verbose name: Use Caching
  • default value: False
  • port type: BoolPort
  • value type: bool (can be None)

set_breakpoint

Set a breakpoint on this node. If this is enabled, your debugger (if one is attached) will trigger a breakpoint.

  • verbose name: Set Breakpoint (Debug Only)
  • default value: False
  • port type: BoolPort
  • value type: bool (can be None)

metadata

User-definable meta-data associated with the node. Usually reserved for technical purposes.

  • verbose name: Metadata
  • default value: {}
  • port type: DictPort
  • value type: dict (can be None)