Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add notebook with 80% power #2

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
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
139 changes: 139 additions & 0 deletions run_simulation_80power.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"id": "71e121d4",
"metadata": {},
"outputs": [],
"source": [
"import simulation_tools as sim\n",
"import pandas as pd"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "fb17ca19",
"metadata": {},
"outputs": [],
"source": [
"# Path to a .csv file with connectomes in upper triangular form\n",
"path_conn = \"/home/neuromod/ad_sz/data/abide/abide1_2_controls_concat.csv\""
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "8b6c3bf5",
"metadata": {},
"outputs": [],
"source": [
"# Load control connectomes from ABIDE\n",
"conn_df = pd.read_csv(path_conn)"
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "5df7cb69",
"metadata": {},
"outputs": [],
"source": [
"# Create a range of N values\n",
"N_values = range(400, 501, 10)"
]
},
{
"cell_type": "code",
"execution_count": 5,
"id": "3b4565ab",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Simulation ran for N=400.\n",
"Simulation ran for N=410.\n",
"Simulation ran for N=420.\n",
"Simulation ran for N=430.\n",
"Simulation ran for N=440.\n",
"Simulation ran for N=450.\n",
"Simulation ran for N=460.\n",
"Simulation ran for N=470.\n",
"Simulation ran for N=480.\n",
"Simulation ran for N=490.\n",
"Simulation ran for N=500.\n"
]
}
],
"source": [
"result_list = []\n",
"# Loop through the values of N and run simulation with specififed parameters\n",
"for N in N_values:\n",
" result = sim.run_multiple_simulation(conn_df, N=N, pi=0.20, d=0.3, q=0.1, num_sample=100)\n",
" print(f\"Simulation ran for N={N}.\")\n",
" result_list.append(result)"
]
},
{
"cell_type": "code",
"execution_count": 6,
"id": "ebf2916e",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Estimated mean sensitivity to detect d=0.3, with pi=0.2%, q=0.1 and N=400: 0.71, with mean specificity of 0.98.\n",
"Estimated mean sensitivity to detect d=0.3, with pi=0.2%, q=0.1 and N=410: 0.72, with mean specificity of 0.98.\n",
"Estimated mean sensitivity to detect d=0.3, with pi=0.2%, q=0.1 and N=420: 0.75, with mean specificity of 0.99.\n",
"Estimated mean sensitivity to detect d=0.3, with pi=0.2%, q=0.1 and N=430: 0.75, with mean specificity of 0.98.\n",
"Estimated mean sensitivity to detect d=0.3, with pi=0.2%, q=0.1 and N=440: 0.78, with mean specificity of 0.98.\n",
"Estimated mean sensitivity to detect d=0.3, with pi=0.2%, q=0.1 and N=450: 0.79, with mean specificity of 0.98.\n",
"Estimated mean sensitivity to detect d=0.3, with pi=0.2%, q=0.1 and N=460: 0.8, with mean specificity of 0.98.\n",
"Estimated mean sensitivity to detect d=0.3, with pi=0.2%, q=0.1 and N=470: 0.81, with mean specificity of 0.98.\n",
"Estimated mean sensitivity to detect d=0.3, with pi=0.2%, q=0.1 and N=480: 0.81, with mean specificity of 0.98.\n",
"Estimated mean sensitivity to detect d=0.3, with pi=0.2%, q=0.1 and N=490: 0.83, with mean specificity of 0.98.\n",
"Estimated mean sensitivity to detect d=0.3, with pi=0.2%, q=0.1 and N=500: 0.84, with mean specificity of 0.98.\n"
]
}
],
"source": [
"for result in result_list:\n",
" print(result)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "cd6f422f",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.10"
}
},
"nbformat": 4,
"nbformat_minor": 5
}