algorithms.statistics.onesample

Module: algorithms.statistics.onesample

Utilities for one sample t-tests

Functions

nipy.algorithms.statistics.onesample.estimate_mean(Y, sd)

Estimate the mean of a sample given information about the standard deviations of each entry.

Parameters:

Y : ndarray

Data for which mean is to be estimated. Should have shape[0] == number of subjects.

sd : ndarray

Standard deviation (subject specific) of the data for which the mean is to be estimated. Should have shape[0] == number of subjects.

Returns:

value : dict

This dictionary has keys [‘effect’, ‘scale’, ‘t’, ‘resid’, ‘sd’]

nipy.algorithms.statistics.onesample.estimate_varatio(Y, sd, df=None, niter=10)

Estimate variance fixed/random effects variance ratio

In a one-sample random effects problem, estimate the ratio between the fixed effects variance and the random effects variance.

Parameters:

Y : np.ndarray

Data for which mean is to be estimated. Should have shape[0] == number of subjects.

sd : array

Standard deviation (subject specific) of the data for which the mean is to be estimated. Should have shape[0] == number of subjects.

df : int or None, optional

If supplied, these are used as weights when deriving the fixed effects variance. Should have length == number of subjects.

niter : int, optional

Number of EM iterations to perform (default 10)

Returns:

value : dict

This dictionary has keys [‘fixed’, ‘ratio’, ‘random’], where ‘fixed’ is the fixed effects variance implied by the input parameter ‘sd’; ‘random’ is the random effects variance and ‘ratio’ is the estimated ratio of variances: ‘random’/’fixed’.