Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 49 additions & 10 deletions your-code/main.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 21,
"metadata": {},
"outputs": [],
"source": [
"# Libraries"
"import pandas as pd\n",
"import numpy as np\n",
"import scipy.stats as st"
]
},
{
Expand All @@ -32,11 +34,28 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 4,
"metadata": {},
"outputs": [],
"outputs": [
{
"data": {
"text/plain": [
"(172.14308590115726, 174.79024743217607)"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# your code here"
"heights = [167, 167, 168, 168, 168, 169, 171, 172, 173, 175, 175, 175, 177, 182, 195]\n",
"\n",
"mean = sum(heights) / len(heights)\n",
"n = 15\n",
"std = 4\n",
"\n",
"st.norm.interval(0.80, loc = mean, scale = std/np.sqrt(n))"
]
},
{
Expand All @@ -51,11 +70,31 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 26,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"80% Confidence Interval: (0.2548114047320704, 0.2594743095536438)\n",
"90% Confidence Interval: (0.2541504703696276, 0.2601352439160866)\n"
]
}
],
"source": [
"# your code here"
"n = 105\n",
"shops_with_losses = 27\n",
"\n",
"proportion = shops_with_losses / n\n",
"\n",
"standard_error = (proportion * (1 - proportion)) / n\n",
"\n",
"interval_80 = stats.norm.interval(0.80, loc=proportion, scale=standard_error)\n",
"interval_90 = stats.norm.interval(0.90, loc=proportion, scale=standard_error)\n",
"\n",
"print(f\"80% Confidence Interval: {interval_80}\")\n",
"print(f\"90% Confidence Interval: {interval_90}\")"
]
},
{
Expand Down Expand Up @@ -131,7 +170,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -145,7 +184,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.3"
"version": "3.10.9"
}
},
"nbformat": 4,
Expand Down