Commit ed0990a4 authored by rhaase's avatar rhaase

added another ttost_paired for equivalence testing

parent 16439437
......@@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 2,
"metadata": {},
"outputs": [
{
......@@ -88,7 +88,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 3,
"metadata": {},
"outputs": [
{
......@@ -123,7 +123,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 4,
"metadata": {},
"outputs": [
{
......@@ -174,7 +174,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 5,
"metadata": {},
"outputs": [
{
......@@ -209,7 +209,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 6,
"metadata": {},
"outputs": [],
"source": [
......@@ -234,7 +234,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 7,
"metadata": {},
"outputs": [
{
......@@ -265,7 +265,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 8,
"metadata": {},
"outputs": [
{
......@@ -292,18 +292,37 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 9,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"30.29690691445312\n"
]
}
],
"source": [
"tolerance = np.mean([data1, data2]) * 0.03\n",
"\n",
"print(tolerance)"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"(0.47051036223078757,\n",
" (0.1097795345763236, 0.4565209578658961, 48.0),\n",
" (-0.0743754713943518, 0.47051036223078757, 48.0))"
"(0.3975032254211037,\n",
" (0.2966683852771914, 0.3839998231560852, 48.0),\n",
" (-0.26126432209521966, 0.3975032254211037, 48.0))"
]
},
"execution_count": 8,
"execution_count": 10,
"metadata": {},
"output_type": "execute_result"
}
......@@ -311,14 +330,14 @@
"source": [
"from statsmodels.stats.weightstats import ttost_ind\n",
"\n",
"pval = ttost_ind(measurement_python, measurement_imagej, low=-10, upp=10)\n",
"pval = ttost_ind(measurement_python, measurement_imagej, low=-tolerance, upp=tolerance)\n",
"\n",
"pval"
]
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 11,
"metadata": {},
"outputs": [],
"source": [
......@@ -378,31 +397,29 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": 16,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"(3.0607159809231846e-11,\n",
" (-11.104032129950907, 3.0607159809231846e-11),\n",
" (-12.32257205021279, 3.601584280854005e-12))"
"(6.446758211728755e-26,\n",
" (49.213693923012265, 6.446758211728755e-26),\n",
" (-72.64029810317597, 5.99533086729445e-30))"
]
},
"execution_count": 10,
"execution_count": 16,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"tolerance = 0.1\n",
"\n",
"tost_paired(measurement_python, measurement_imagej, -tolerance, tolerance)\n"
]
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": 17,
"metadata": {},
"outputs": [
{
......@@ -420,7 +437,7 @@
" [72.64029810317597, 1.19906617345889e-29]]"
]
},
"execution_count": 11,
"execution_count": 17,
"metadata": {},
"output_type": "execute_result"
}
......@@ -453,10 +470,35 @@
" [t2, p_value2]\n",
" ]\n",
"\n",
"tolerance = 10\n",
"equivalence_ttest_rel(measurement_python, measurement_imagej, tolerance)\n"
]
},
{
"cell_type": "code",
"execution_count": 19,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"(6.446758211728755e-26,\n",
" (72.64029810317597, 5.99533086729445e-30, 24.0),\n",
" (-49.21369392301226, 6.446758211728755e-26, 24.0))"
]
},
"execution_count": 19,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"from statsmodels.stats import weightstats\n",
"\n",
"pval = weightstats.ttost_paired(measurement_python, measurement_imagej, low=-tolerance, upp=tolerance)\n",
"\n",
"pval"
]
},
{
"cell_type": "code",
"execution_count": null,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment