stsdas.analysis.statistics¶
The statictics package contains statistical analysis tasks.
Notes¶
For questions or comments please see our github page. We encourage and appreciate user feedback.
Contents:
bhkmethod¶
Please review the Notes section above before running any examples in this notebook
The bhkmethod task is used to compute the generalized Kendall’s tau correlation coefficient. We show a short example here taken from the scipy.stats.kendalltau documentation.
# Standard Imports
from scipy import stats
x1 = [12, 2, 1, 12, 2]
x2 = [1, 4, 7, 1, 0]
tau, p_value = stats.kendalltau(x1, x2)
print("tau: {}".format(tau))
print("p_value: {}".format(tau))
tau: -0.471404520791
p_value: -0.471404520791
buckleyjames-kmestimate¶
Please review the Notes section above before running any examples in this notebook
The buckleyjames and kestimate tasks compute linear regression
coefficients and esitmators with the Kaplan-Meier estimator. There is
currently a Python package called lifelines
that have this
fitter.
coxharzard¶
Please review the Notes section above before running any examples in this notebook
The coxhazard task is used to compute the correlation probability by
Cox’s proportional hazard model. The lifelines
package contains
this fitter
here.
kolmov¶
Please review the Notes section above before running any examples in this notebook
The kolmov task uses the Kolmogorov-Smirnov test for goodness of fit.
You can find both the one-sided and two-sided test in scipy
:
spearman¶
Please review the Notes section above before running any examples in this notebook
The spearman task is used to compute regression coefficients by Scmitt’s
method. Scipy
contains a version of this
task.
# Standard Imports
from scipy import stats
rho, pvalue = stats.spearmanr([1,2,3,4,5],[5,6,7,8,7])
print("rho: {}".format(rho))
print("p-value: {}".format(pvalue))
rho: 0.820782681668
p-value: 0.0885870053135
twosampt¶
Please review the Notes section above before running any examples in this notebook
The twosampt task is used to determine if two sets of data are from the same population. It provided the following types of two sample test: geham-permute, gehan-hyper, logrank, peto-peto, and peto-prentice. These tests do not currently have an equivalent in Scipy, but the following two sample tests are availalbe:
Not Replacing¶
- censor - Information about the censoring indicator in survival analysis. Deprecated.
- emmethod - Compute linear regression for censored data by EM method. Deprecated.
- schmittbin - Compute regression coefficients by Schmitt’s method. Deprecated.
- survival - Provide background & overview of survival analysis. Deprecated.