Commit 7ecb8dfe authored by Anuththara18's avatar Anuththara18

means and confidence interval calculations added

parent ade817f3
{
"cells": [
{
"cell_type": "code",
"execution_count": 6,
"id": "d5e80649",
"metadata": {},
"outputs": [],
"source": [
"import numpy as np\n",
"import scipy.stats as st\n",
"import pandas as pd "
]
},
{
"cell_type": "code",
"execution_count": 14,
"id": "1615bff7",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"92.20708099030304\n",
"0 94.736842\n",
"1 100.000000\n",
"2 94.736842\n",
"3 100.000000\n",
"4 100.000000\n",
" ... \n",
"358 80.000000\n",
"359 88.888889\n",
"360 82.142857\n",
"361 100.000000\n",
"362 93.750000\n",
"Name: percentage_no_of_correct_responses, Length: 363, dtype: float64\n"
]
},
{
"data": {
"text/plain": [
"(90.85771338615285, 93.55644859445323)"
]
},
"execution_count": 14,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# ALL\n",
"dataset = pd.read_csv('data.csv') \n",
"\n",
"print(dataset['percentage_no_of_correct_responses'].mean())\n",
"\n",
"df = dataset['percentage_no_of_correct_responses']\n",
"print(df)\n",
"\n",
"st.t.interval(confidence=0.90, df=len(df)-1,\n",
" loc=np.mean(df),\n",
" scale=st.sem(df))"
]
},
{
"cell_type": "code",
"execution_count": 16,
"id": "bc4fe9fd",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"1179.0954773869346\n",
"0 1479\n",
"1 1605\n",
"2 1404\n",
"3 1782\n",
"4 1258\n",
" ... \n",
"358 1045\n",
"359 1159\n",
"360 1257\n",
"361 1044\n",
"362 1083\n",
"Name: mean_reaction_time, Length: 199, dtype: int64\n"
]
},
{
"data": {
"text/plain": [
"(1145.3717741123287, 1212.8191806615405)"
]
},
"execution_count": 16,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"dataset = pd.read_csv('data.csv') \n",
"\n",
"dataset.drop(dataset.index[dataset['game'] == 'Selective'], inplace = True)\n",
"\n",
"print(dataset['mean_reaction_time'].mean())\n",
"\n",
"df = dataset['mean_reaction_time']\n",
"print(df)\n",
"\n",
"st.t.interval(confidence=0.90, df=len(df)-1,\n",
" loc=np.mean(df),\n",
" scale=st.sem(df))"
]
},
{
"cell_type": "code",
"execution_count": 18,
"id": "49f89ab0",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"8.068401103630853\n",
"0 5.263158\n",
"1 0.000000\n",
"2 5.263158\n",
"3 0.000000\n",
"4 0.000000\n",
" ... \n",
"358 20.000000\n",
"359 11.111111\n",
"360 17.857143\n",
"361 0.000000\n",
"362 6.250000\n",
"Name: oer, Length: 363, dtype: float64\n"
]
},
{
"data": {
"text/plain": [
"(6.655985530921529, 9.480816676340176)"
]
},
"execution_count": 18,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"dataset = pd.read_csv('data.csv') \n",
"\n",
"print(dataset['oer'].mean())\n",
"\n",
"df = dataset['oer']\n",
"print(df)\n",
"\n",
"st.t.interval(confidence=0.90, df=len(df)-1,\n",
" loc=np.mean(df),\n",
" scale=st.sem(df))"
]
},
{
"cell_type": "code",
"execution_count": 19,
"id": "55c8d931",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"10.275603274300414\n",
"0 0.000000\n",
"1 0.000000\n",
"2 15.789474\n",
"3 21.052632\n",
"4 31.578947\n",
" ... \n",
"319 0.000000\n",
"320 50.000000\n",
"321 0.000000\n",
"322 0.000000\n",
"323 0.000000\n",
"Name: cer, Length: 243, dtype: float64\n"
]
},
{
"data": {
"text/plain": [
"(8.302712062463279, 12.248494486137547)"
]
},
"execution_count": 19,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"dataset = pd.read_csv('data.csv') \n",
"\n",
"dataset.drop(dataset.index[dataset['game'] == 'Focused'], inplace = True)\n",
"dataset.drop(dataset.index[dataset['game'] == 'Sustained'], inplace = True)\n",
"\n",
"print(dataset['cer'].mean())\n",
"\n",
"df = dataset['cer']\n",
"print(df)\n",
"\n",
"st.t.interval(confidence=0.90, df=len(df)-1,\n",
" loc=np.mean(df),\n",
" scale=st.sem(df))"
]
},
{
"cell_type": "markdown",
"id": "3d734dbe",
"metadata": {},
"source": [
"# Alternating Attention - age,mrt,pcr,oer,cer\n",
"# Divided Attention - age,mrt,pcr,oer,cer\n",
"# Focused Attention - age,mrt,pcr,oer\n",
"# Selective Attention - age,td,pcr,oer,cer\n",
"# Sustained Attention - age,mrt,pcr,oer,td"
]
},
{
"cell_type": "code",
"execution_count": 20,
"id": "74778eb4",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"24162.004926108373\n",
"160 3459\n",
"161 3000\n",
"162 10888\n",
"163 7081\n",
"164 9953\n",
" ... \n",
"358 2192\n",
"359 2125\n",
"360 179629\n",
"361 96133\n",
"362 102242\n",
"Name: total_duration, Length: 203, dtype: int64\n"
]
},
{
"data": {
"text/plain": [
"(20225.357793870175, 28098.652058346568)"
]
},
"execution_count": 20,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"dataset = pd.read_csv('data.csv') \n",
"\n",
"dataset.drop(dataset.index[dataset['game'] == 'Focused'], inplace = True)\n",
"dataset.drop(dataset.index[dataset['game'] == 'Alternating'], inplace = True)\n",
"dataset.drop(dataset.index[dataset['game'] == 'Divided'], inplace = True)\n",
"\n",
"print(dataset['total_duration'].mean())\n",
"\n",
"df = dataset['total_duration']\n",
"print(df)\n",
"\n",
"st.t.interval(confidence=0.90, df=len(df)-1,\n",
" loc=np.mean(df),\n",
" scale=st.sem(df))"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "447a507b",
"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.7"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
This source diff could not be displayed because it is too large. You can view the blob instead.
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