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:
- Yndarray
Data for which mean is to be estimated. Should have shape[0] == number of subjects.
- sdndarray
Standard deviation (subject specific) of the data for which the mean is to be estimated. Should have shape[0] == number of subjects.
- Returns:
- valuedict
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:
- Ynp.ndarray
Data for which mean is to be estimated. Should have shape[0] == number of subjects.
- sdarray
Standard deviation (subject specific) of the data for which the mean is to be estimated. Should have shape[0] == number of subjects.
- dfint or None, optional
If supplied, these are used as weights when deriving the fixed effects variance. Should have length == number of subjects.
- niterint, optional
Number of EM iterations to perform (default 10)
- Returns:
- valuedict
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’.