From 804f2a2e145acbaaac030b855af957ef07fcb467 Mon Sep 17 00:00:00 2001 From: Wirus006 Date: Tue, 17 May 2022 17:58:54 +0200 Subject: [PATCH] test shapiro wilka --- bootstrap-t.ipynb | 61 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 60 insertions(+), 1 deletion(-) diff --git a/bootstrap-t.ipynb b/bootstrap-t.ipynb index 184f9f0..2875b4c 100644 --- a/bootstrap-t.ipynb +++ b/bootstrap-t.ipynb @@ -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": {},