Skip to content

README

This analysis explores information pertaining to 1500 patients between 2013 and 2022 that were diagnosed with Obsessive-Compulsion Disorder (OCD). Analysis regarding patient gender, ethnicity, obsession types, and compulsion types as well as a month over month count of new patients can be found below.

Spinner
DataFrameas
df1
variable
-- (1) Count of Females vs Males that have OCD & Average Obsession Score by Gender
SELECT
	Gender,
	COUNT(Patient_ID) AS Count_of_Patients,
	ROUND(AVG(Y_BOCS_Score_Obsessions),2) AS AVG_Obsession_Score
FROM
	ocd_patient_dataset.csv
GROUP BY
	Gender
ORDER BY
	Count_of_Patients;
Spinner
DataFrameas
df2
variable
-- (2) Count & Average Obsession Score by Ethnicities that have OCD
SELECT
	Ethnicity,
	COUNT(Patient_ID) AS Count_of_Patients,
	ROUND(AVG(Y_BOCS_Score_Obsessions),2) AS AVG_Obsession_Score
FROM
	ocd_patient_dataset.csv
GROUP BY
	Ethnicity
ORDER BY
	Count_of_Patients;
Spinner
DataFrameas
df3
variable
-- (3) Number of people diagnosed Month over Month
SELECT
	COUNT(Patient_ID) AS Count_of_Patients,
	DATE_TRUNC('month', OCD_Diagnosis_Date) as Month_Year
FROM
	ocd_patient_dataset.csv
GROUP BY
	DATE_TRUNC('month', OCD_Diagnosis_Date)
ORDER BY Month_Year
Spinner
DataFrameas
df4
variable
-- (4) Most common Obsession Type & its respective Average Obsession Score
SELECT
	Obsession_Type,
	COUNT(Patient_ID) AS Count_of_Patients,
	ROUND(AVG(Y_BOCS_Score_Obsessions),2) AS AVG_Obsession_Score
FROM
	ocd_patient_dataset.csv
GROUP BY
	Obsession_Type
ORDER BY
	Count_of_Patients DESC;
Spinner
DataFrameas
df5
variable
-- (5) Most common Compulsion Type & its respective Average Obsession Score
SELECT
	Compulsion_Type,
	COUNT(Patient_ID) AS Count_of_Patients,
	ROUND(AVG(Y_BOCS_Score_Compulsions),2) AS AVG_Compulsion_Score
FROM
	ocd_patient_dataset.csv
GROUP BY
	Compulsion_Type
ORDER BY
	Count_of_Patients DESC;