test shapiro wilka
This commit is contained in:
parent
f55933d149
commit
804f2a2e14
@ -25,7 +25,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 48,
|
||||
"execution_count": 62,
|
||||
"metadata": {
|
||||
"pycharm": {
|
||||
"name": "#%%\n"
|
||||
@ -36,6 +36,7 @@
|
||||
"import numpy as np\n",
|
||||
"import pandas as pd\n",
|
||||
"from math import sqrt\n",
|
||||
"from scipy import stats\n",
|
||||
"from scipy.stats import sem\n",
|
||||
"from scipy.stats import t\n",
|
||||
"import matplotlib.pyplot as plt\n",
|
||||
@ -135,6 +136,43 @@
|
||||
" return t_stat_list"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## Test Shapiro Wilka\n",
|
||||
"\n",
|
||||
"Wszystkie rodzaje testów są testami parametrycznymi, a co za tym idzie nasze mierzone zmienne ilościowe powinny mieć rozkład normalny."
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 69,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"0.9606528878211975\n",
|
||||
"2.666284970587185e-10\n",
|
||||
"Dane nie mają rozkładu normalnego.\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"# TODO: Test Shapiro Wilka sprawdzający czy nasze dane mają rozkład normalny\n",
|
||||
"x = dataset['Height'].to_numpy()\n",
|
||||
"shapiro_test = stats.shapiro(x)\n",
|
||||
"print(shapiro_test.statistic)\n",
|
||||
"print(shapiro_test.pvalue)\n",
|
||||
"\n",
|
||||
"if shapiro_test.pvalue > shapiro_test.statistic:\n",
|
||||
" print(\"Dane mają rozkład normalny.\")\n",
|
||||
"else:\n",
|
||||
" print(\"Dane nie mają rozkładu normalnego.\")"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
@ -259,6 +297,13 @@
|
||||
"pretty_print_full_stats(t_stat, df, cv, p)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"TODO: Wniosek"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
@ -332,6 +377,13 @@
|
||||
"pretty_print_full_stats(t_stat, df, cv, p)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"TODO: Wniosek"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
@ -408,6 +460,13 @@
|
||||
"pretty_print_full_stats(t_stat, df, cv, p)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"TODO: Wniosek"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
|
Loading…
Reference in New Issue
Block a user