eelbrain.table.stats¶
-
eelbrain.table.
stats
(y, row, col=None, match=None, sub=None, fmt='%.4g', funcs=(<function mean>, ), ds=None, title=None, caption=None)¶ Make a table with statistics
- Parameters
y (
Var
) – Dependent variable.row (
Union
[Factor
,Interaction
,NestedEffect
,str
]) – Model specifying rowscol (
Union
[Factor
,Interaction
,NestedEffect
,str
,None
]) – Model specifying columns.match (
Union
[Factor
,Interaction
,NestedEffect
,str
,None
]) – Identifier for repeated measures data; aggregate within subject before computing statistics.sub (
Union
[Var
,ndarray
,str
,None
]) – Only use part of the data.fmt (
str
) – How to format values.funcs (
Sequence
[Callable
]) – A list of statistics functions to show (all functions must take an array argument and return a scalar).ds (
Optional
[Dataset
]) – If a Dataset is provided,y
,row
, andcol
can be strings specifying members.title (
Union
[str
,List
[str
],FMTextElement
,FMTextConstant
,None
]) – Table title.caption (str | FMText) – Table caption.
- Returns
table – Table with statistics.
- Return type
Examples
>>> ds = datasets.get_uts() >>> table.stats('Y', 'A', 'B', ds=ds) B ----------------- b0 b1 ---------------------- a0 0.1668 -0.3646 a1 -0.4897 0.8746
>>> table.stats('Y', 'A', ds=ds, funcs=[np.mean, np.std]) Condition Mean Std -------------------------- a0 0.6691 1.37 a1 0.8596 1.192