Polycystic Ovarian Syndrome (PCOS) data

Author

Haja Kargbo

library(tidyverse)
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
✔ dplyr     1.1.4     ✔ readr     2.1.5
✔ forcats   1.0.0     ✔ stringr   1.5.1
✔ ggplot2   3.4.4     ✔ tibble    3.2.1
✔ lubridate 1.9.3     ✔ tidyr     1.3.1
✔ purrr     1.0.2     
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag()    masks stats::lag()
ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
library(openintro)
Loading required package: airports
Loading required package: cherryblossom
Loading required package: usdata
library(tidymodels)
── Attaching packages ────────────────────────────────────── tidymodels 1.1.1 ──
✔ broom        1.0.5     ✔ rsample      1.2.0
✔ dials        1.2.0     ✔ tune         1.1.2
✔ infer        1.0.6     ✔ workflows    1.1.3
✔ modeldata    1.3.0     ✔ workflowsets 1.0.1
✔ parsnip      1.2.0     ✔ yardstick    1.3.0
✔ recipes      1.0.9     
── Conflicts ───────────────────────────────────────── tidymodels_conflicts() ──
✖ scales::discard() masks purrr::discard()
✖ dplyr::filter()   masks stats::filter()
✖ recipes::fixed()  masks stringr::fixed()
✖ dplyr::lag()      masks stats::lag()
✖ yardstick::spec() masks readr::spec()
✖ recipes::step()   masks stats::step()
• Use tidymodels_prefer() to resolve common conflicts.
library(kableExtra)

Attaching package: 'kableExtra'

The following object is masked from 'package:dplyr':

    group_rows
library(knitr)
library(rsample)
library(infer)
library(car)
Loading required package: carData

Attaching package: 'car'

The following object is masked from 'package:openintro':

    densityPlot

The following object is masked from 'package:dplyr':

    recode

The following object is masked from 'package:purrr':

    some
#Navigating to my project directory
setwd("/Users/hajakargbo/Desktop/Spring 2024🥳/Biostatistics/Project")

#Importing PCOS data for deep dive analysis
pcos_data <- read_csv("PCOS_data.csv")
Rows: 541 Columns: 44
── Column specification ────────────────────────────────────────────────────────
Delimiter: ","
chr  (2): II    beta-HCG(mIU/mL), AMH(ng/mL)
dbl (42): Sl. No, Patient File No., PCOS (Y/N), Age (yrs), Weight (Kg), Heig...

ℹ Use `spec()` to retrieve the full column specification for this data.
ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.

Polycysitic Ovarian Syndrom (PCOS)

(A Review of Polycystic Ovary Syndrome (PCOS) | Elan Healthcare, n.d.)

Determining whether you have Polycystic Ovary Syndrome can be quite challenging for women in their reproductive years.

Background

Polycystic ovarian syndrome (PCOS) is a complex hormonal condition characterized by excess androgen production, which can lead to noticeable symptoms like facial hair growth, hair loss (alopecia), and acne (Cussen et al., 2022). These androgen-related issues not only affect appearance but also impact reproductive health, often causing irregular menstrual cycles and difficulties with fertility (Cussen et al., 2022; Itriyeva, 2022). Insulin plays a crucial role in regulating androgen levels in the ovaries, and many women with PCOS experience insulin resistance, which is closely linked to cardiovascular health concerns (Wekker et al., 2020). Research has shown that women with PCOS have a higher risk of developing cardiometabolic diseases such as type 2 diabetes and hypertension (Wekker et al., 2020).

Additionally, obesity exacerbates hormonal imbalances associated with PCOS. Higher body mass index (BMI) and fat surrounding the abdomen is said to contribute to elevated androgen levels and irregular menstrual cycles (Itriyeva, 2022). PCOS is also associated with adverse lipid distribution in the blood) and an increased risk of cerebrovascular(brain vessels) events (Wekker et al., 2020), which highlights the systemic impact of PCOS.

History Over time, our understanding of PCOS has changed dramatically. When PCOS was initially identified in the middle of the 18th century, it only focused on a married woman’s inability to conceive (Szydlarska et al., 2017). Research has broadened throughout time to acknowledge the syndrome’s wider metabolic and cardiovascular consequences (Wecker et. al, 2020).

Providers now use ‘The Rotterdam criteria’ (2003) to diagnose PCOS, which requires the identification of at least two of the following: irregular menstrual periods, evidence of androgen excess, and/or polycystic ovaries on ultrasound. This approach differs significantly from the previous method, where a diagnosis was primarily based on a single symptom (infertility).

Technical Terms

#Androgren-male hormones such as testosterone (often elevated with PCOS patients)

#Ovarian cysts: fluid-filled sacs that form on or within ovaries

#Insulin resistance-condition where cells become less responsive to insulin, leading to high blood sugar 

Overarching Question What are the key variables within the PCOS dataset that significantly correlate with the diagnosis of PCOS?

PCOS impacts about 5% to 10% of women in the United States and is characterized by a variety of noticeable symptoms (UpToDate, n.d.). However, diagnosing PCOS is not as straightforward. Not every symptom guarantees an immediate diagnosis. Women may experience a wide range of irregularities without necessarily having PCOS. Further exploration of this topic will involve analyzing the dataset provided by Kaggle (PCOS_data). Author Aya Moheddine performed an observational study, collected data, and compiled it into a csv document. It includes information from women with and without PCOS.

The variables I will focus on are listed below.

Variables from the PCOS Data

#Viewing raw data
head(pcos_data)
# A tibble: 6 × 44
  `Sl. No` `Patient File No.` `PCOS (Y/N)` `Age (yrs)` `Weight (Kg)`
     <dbl>              <dbl>        <dbl>       <dbl>         <dbl>
1        1                  1            0          28          44.6
2        2                  2            0          36          65  
3        3                  3            1          33          68.8
4        4                  4            0          37          65  
5        5                  5            0          25          52  
6        6                  6            0          36          74.1
# ℹ 39 more variables: `Height(Cm)` <dbl>, BMI <dbl>, `Blood Group` <dbl>,
#   `Pulse rate(bpm)` <dbl>, `RR (breaths/min)` <dbl>, `Hb(g/dl)` <dbl>,
#   `Cycle(R/I)` <dbl>, `Cycle length(days)` <dbl>,
#   `Marraige Status (Yrs)` <dbl>, `Pregnant(Y/N)` <dbl>,
#   `No. of abortions` <dbl>, `I   beta-HCG(mIU/mL)` <dbl>,
#   `II    beta-HCG(mIU/mL)` <chr>, `FSH(mIU/mL)` <dbl>, `LH(mIU/mL)` <dbl>,
#   `FSH/LH` <dbl>, `Hip(inch)` <dbl>, `Waist(inch)` <dbl>, …

Histogram–Distribution of PCOS based on age

The population has an evenly skewed distrubition of participants based on age.

pcos_data |>
  ggplot(aes(x = `Age (yrs)`)) +  
  geom_histogram(bins = 20, fill = "pink", color = "black") +
  labs(title = "Distribution of Age",
       x = "Age (years)",
       y = "Frequency") +
  annotate("text", x = 40, y = 100, 
           label = "Histogram showing the distribution of ages in the PCOS dataset.")

Data: Rearranged Created new columns for selected ‘0/1’ variables and assigned yes and no as replacements.

new_df <- pcos_data |>
  mutate(pcos=ifelse(`PCOS (Y/N)`==0,"no","yes")) |>
  mutate(hairloss=ifelse(`Hair loss(Y/N)`==0,"no","yes")) |>
  mutate(pregnant=ifelse(`Pregnant(Y/N)`==0,"no","yes")) |>
  mutate(weightgain=ifelse(`Weight gain(Y/N)`==0,"no","yes")) |>
  mutate(hairgrowth=ifelse(`hair growth(Y/N)`==0,"no","yes")) |>
  mutate(skindarkening=ifelse(`Skin darkening (Y/N)`==0,"no","yes")) |>
  mutate(pimples=ifelse(`Pimples(Y/N)`==0,"no","yes")) 
head(new_df)
# A tibble: 6 × 51
  `Sl. No` `Patient File No.` `PCOS (Y/N)` `Age (yrs)` `Weight (Kg)`
     <dbl>              <dbl>        <dbl>       <dbl>         <dbl>
1        1                  1            0          28          44.6
2        2                  2            0          36          65  
3        3                  3            1          33          68.8
4        4                  4            0          37          65  
5        5                  5            0          25          52  
6        6                  6            0          36          74.1
# ℹ 46 more variables: `Height(Cm)` <dbl>, BMI <dbl>, `Blood Group` <dbl>,
#   `Pulse rate(bpm)` <dbl>, `RR (breaths/min)` <dbl>, `Hb(g/dl)` <dbl>,
#   `Cycle(R/I)` <dbl>, `Cycle length(days)` <dbl>,
#   `Marraige Status (Yrs)` <dbl>, `Pregnant(Y/N)` <dbl>,
#   `No. of abortions` <dbl>, `I   beta-HCG(mIU/mL)` <dbl>,
#   `II    beta-HCG(mIU/mL)` <chr>, `FSH(mIU/mL)` <dbl>, `LH(mIU/mL)` <dbl>,
#   `FSH/LH` <dbl>, `Hip(inch)` <dbl>, `Waist(inch)` <dbl>, …

Data: Rearranged and renamed Removed all caps, spaces, and parentheses from variables.

names(new_df) <-tolower(names(new_df)) #removed all caps
names(new_df) <- gsub(" ","", names(new_df)) #removed all spaces

names(new_df) <- str_replace_all(names(new_df), "[()]", "") #removed all parentheses from variable names
head(new_df)
# A tibble: 6 × 51
  sl.no patientfileno. `pcosy/n` ageyrs weightkg heightcm   bmi bloodgroup
  <dbl>          <dbl>     <dbl>  <dbl>    <dbl>    <dbl> <dbl>      <dbl>
1     1              1         0     28     44.6     152   19.3         15
2     2              2         0     36     65       162.  24.9         15
3     3              3         1     33     68.8     165   25.3         11
4     4              4         0     37     65       148   29.7         13
5     5              5         0     25     52       161   20.1         11
6     6              6         0     36     74.1     165   27.2         15
# ℹ 43 more variables: pulseratebpm <dbl>, `rrbreaths/min` <dbl>,
#   `hbg/dl` <dbl>, `cycler/i` <dbl>, cyclelengthdays <dbl>,
#   marraigestatusyrs <dbl>, `pregnanty/n` <dbl>, no.ofabortions <dbl>,
#   `ibeta-hcgmiu/ml` <dbl>, `iibeta-hcgmiu/ml` <chr>, `fshmiu/ml` <dbl>,
#   `lhmiu/ml` <dbl>, `fsh/lh` <dbl>, hipinch <dbl>, waistinch <dbl>,
#   `waist:hipratio` <dbl>, `tshmiu/l` <dbl>, `amhng/ml` <chr>,
#   `prlng/ml` <dbl>, `vitd3ng/ml` <dbl>, `prgng/ml` <dbl>, `rbsmg/dl` <dbl>, …

Exploring data: Summary Stats

Proportion table: PCOS vs NonPCOS Created a proportion table to get a general summary of proportions of the groups: PCOS and NonPCOS.

pcos_counts <- table(new_df$`pcos`)
pcos_counts

 no yes 
364 177 
pcos_prop <- prop.table(pcos_counts)
pcos_prop

       no       yes 
0.6728281 0.3271719 

Observing difference of means

diff_mean_obs <- new_df |>
  specify(weightkg ~ pcos) |>           
  calculate(stat = "diff in means", order = c("no", "yes")) 
diff_mean_obs
Response: weightkg (numeric)
Explanatory: pcos (factor)
# A tibble: 1 × 1
   stat
  <dbl>
1 -4.98

Bootstrap

fprops_pcosyes <- new_df |>
  filter() |>
  specify(response = pcos, success = "yes") |>
  # Generate 1000 reps of type bootstrap
  generate(reps = 1000, type = "bootstrap") |> 
  # Calculate the summary stat "prop"
  calculate(stat = "prop")
fprops_pcosyes
Response: pcos (factor)
# A tibble: 1,000 × 2
   replicate  stat
       <int> <dbl>
 1         1 0.307
 2         2 0.335
 3         3 0.349
 4         4 0.318
 5         5 0.333
 6         6 0.357
 7         7 0.327
 8         8 0.335
 9         9 0.331
10        10 0.311
# ℹ 990 more rows

Calculating Confidence Intervals for PCOS population

We are 95% confident that the true proportion of PCOS women in the female population is between 28.8% and 36.6%. However, according to (Xu & Qiao, 2022) only about 10% of the female population are diagnosed with pcos. This low number could be for a multitude of reasons.

# Calculate the intervals, more conveniently
percentile_cipcos <- fprops_pcosyes |> 
  get_confidence_interval(level = 0.95)
percentile_cipcos
# A tibble: 1 × 2
  lower_ci upper_ci
     <dbl>    <dbl>
1    0.290    0.364

Exploring: Numerical data

Boxplot: Weight (kg) comparison between PCOS and Non PCOS groups After observing both box plots, it appears that the mean weight for both groups is relatively close to 60 kg. Additionally, the distributions overlap, suggesting that there may not be significant variance between the groups in terms of weight

ggplot(new_df, aes(pcos, weightkg ,fill=pcos))+
  geom_boxplot()

Boxplot: Cycle Length (Days) In this comparative box plot, both groups have a similar mean value of 5. However, the distribution of the NonPCOS group skews upward towards 6, while the distribution of the PCOS group skews downward towards 2.5, indicating different patterns of variability around the mean within each group.

ggplot(new_df, aes(pcos, cyclelengthdays ,fill=pcos))+
  geom_boxplot()

T-test for cycle length days Confirm distribution around the mean in the box plot We are 95% confident that the mean cyclelength days are between 4.81-5.07.

t.test(new_df$cyclelengthdays, conf.level = .95)

    One Sample t-test

data:  new_df$cyclelengthdays
t = 77.024, df = 540, p-value < 2.2e-16
alternative hypothesis: true mean is not equal to 0
95 percent confidence interval:
 4.814842 5.066858
sample estimates:
mean of x 
  4.94085 

Scatter Plot: Weight (kg) Vs. Cycle length (days)

There is a slight correlation between weight and cycle length observed in both groups. This slight positive relationship suggests that increased weight may be associated with longer cycle lengths.

The correlation appears stronger in the NonPCOS group, as indicated by a more inclined slope compared to the PCOS group.

 #Created a scatter plot for Weight vs. Cycle Length; Color coded by PCOS group 
Scatterplot_CL_vs_BMI <- ggplot(new_df, aes(x = weightkg, y = cyclelengthdays, color = `pcos`)) +
  geom_point(size = 1) + 
  geom_smooth(method = "lm", se = FALSE) +
  labs(
    title = "Scatterplot of Weight (kg) vs. Cycle Length",
    x = "Weight",
    y = "Cycle Length (days)",
    color = "pcos"
  ) +
  theme_minimal()
Scatterplot_CL_vs_BMI
`geom_smooth()` using formula = 'y ~ x'

Scatter Plot: BMI Vs Waist Size

This scatter plot illustrates the relationship between waist size and BMI. While there doesn’t appear to be a distinct difference in slope between patients (PCOS/Non PCOS) we see a steeper incline for waist size as BMI increase for PCOS pts. We will conduct additional analyses to examine symptoms and compare them across both groups.

ggplot(new_df, aes(x = bmi, y = `waistinch`, color = factor(`pcos`))) +
  geom_point(size = 1) +
  geom_smooth(method = "lm", se = FALSE) +
  labs(
    title = "Scatterplot of BMI vs. Waist (Inch)",
    x = "BMI",
    y = "Waist (Inch)",
    color = "pcos"
  ) +
  theme_minimal()
`geom_smooth()` using formula = 'y ~ x'

There is opposing correlation between the pcos and nonpcos groups regarding Age and Hip (inch). The hip size of those with PCOS seems to decrease overtime while hip size of nonPCOS women seem to increase overtime. Confounding variables could be weight loss among those in the PCOS group. Many women with PCOS attempt to lose weight to help relieve symptoms. This could potential contribute to the decrease in hip size as they age.

ggplot(new_df, aes(x = ageyrs, y = `hipinch`, color = factor(`pcos`))) +
  geom_point(size = 1) +
  geom_smooth(method = "lm", se = FALSE) +
  labs(
    title = "Scatterplot of Age (Yrs) vs. Hip (Inch)",
    x = "Age (Yrs)",
    y = "Hip (Inch)",
    color = "pcos"
  ) +
  theme_minimal()
`geom_smooth()` using formula = 'y ~ x'

Exploring: Categorical data

Observing symptoms: Hairloss (alopecia), Hairgrowth (hirsuitism), Weightgain, Skin Darkening, and Pimples.

Bargraph: hairloss

ggplot(new_df, aes(hairloss,fill=pcos))+
  geom_bar(position="fill")

Chi^2 test: hairloss

Using chi2 to compare proportions between for one of the pcos symptoms: Hair loss

Chi^2 test: pcos, hairloss Chi squared = 15.437, df = 1, p-value = 8.53e-05 which indicates that there is a significant association between pcos and hairloss variables. Hairloss is one of the effects caused by an increase in andogren (Cussen et al., 2022). Results suggest that we reject the null hypothesis that states there is no relationship between pcos and hairloss. We reject the null. We have enough compelling evidence that show that there is a difference in hairloss between PCOS and NonPCOS women.

chisq.test(new_df$`pcos`, new_df$`hairloss`)

    Pearson's Chi-squared test with Yates' continuity correction

data:  new_df$pcos and new_df$hairloss
X-squared = 15.437, df = 1, p-value = 8.53e-05

Bargraph: hairgrowth

ggplot(new_df, aes(hairgrowth,fill=pcos))+
  geom_bar(position="fill")

Chi^2 test: hairgrowth Using chi2 to compare proportions between for one of the pcos symptoms: Hair growth (Hirsuitism)

Chi^2 test: pcos, hairgrowth Chi^2 is large (114.6). A large chi^2 for x=pcos and y=hairgrowth suggests that there is a correlation. A low p-value (lower than 0.05) suggests strong evidence against the null hypothesis. The null states there is no association between the pcos and hairgrowth (facial hair) variables. The Alternative states there is a relationship between pcos and hairgrowth (facial hair) variables. We reject the null. There is enough compelling evidence to show that there is a difference in facial hair growth between PCOS and NonPCOS women.

chisq.test(new_df$`pcos`, new_df$`hairgrowth`)

    Pearson's Chi-squared test with Yates' continuity correction

data:  new_df$pcos and new_df$hairgrowth
X-squared = 114.6, df = 1, p-value < 2.2e-16

Bar graph: Weightgain

ggplot(new_df, aes(weightgain,fill=pcos))+
  geom_bar(position="fill")

Chi^2 test: weightgain Using chi2 to compare proportions between both groups for: Weight gain

Chi^2 test: pcos, weightgain Chi^2 is large (103.31). A large chi^2 for x=pcos and y=weightgain suggests correlation. A low p-value (lower than 0.05) suggests strong evidence against the null hypothesis. The null states there is no association between the pcos and weightgain variables. The Alternative states that there is a relationship between pcos and weightgain variables. We reject the null. There is enough compelling evidence to show that there is a difference in weightgain between PCOS and NonPCOS women.

chisq.test(new_df$`pcos`, new_df$`weightgain`)

    Pearson's Chi-squared test with Yates' continuity correction

data:  new_df$pcos and new_df$weightgain
X-squared = 103.31, df = 1, p-value < 2.2e-16

Bar Graph: Skin Darkening

ggplot(new_df, aes(skindarkening,fill=pcos))+
  geom_bar(position="fill")

Chi^2: SkinDarkening Using chi2 to compare proportions between for one of the pcos symptoms: Skin Darkening

Chi^2 test: pcos, skindarkening Chi^2 is large (120.25). A Large chi^2 for x=pcos and y=skindarkening suggests correlation. A low p-value (lower than 0.05) suggests strong evidence against the null hypothesis. The null states no association between the pcos and skindarkening variables. The Alternative states there is a relationship between pcos and skindarkening variables.We reject the null. There is enough compelling evidence to show that there is a difference in skindarkening between PCOS and NonPCOS women.

chisq.test(new_df$`pcos`, new_df$`skindarkening`)

    Pearson's Chi-squared test with Yates' continuity correction

data:  new_df$pcos and new_df$skindarkening
X-squared = 120.25, df = 1, p-value < 2.2e-16

Bar Graph: Pimples

ggplot(new_df, aes(pimples,fill=pcos))+
  geom_bar(position="fill")

Chi^2 test: Pimples

Using chi2 to compare proportions between for one of the pcos symptoms: Pimples

Chi^2 test: pcos, pimples The Chi^2 is large. Large chi^2 for x=pcos and y=Pimples suggests correlation. A low p-value (lower than 0.05) suggests strong evidence against the null hypothesis. The null states no association between the pcos and pimples variables. The Alternative states there is a relationship between pcos and pimples variables. We reject the null. There is enough compelling evidence to show that there is a difference in pimples between PCOS and NonPCOS women.

chisq.test(new_df$`pcos`, new_df$`pimples`)

    Pearson's Chi-squared test with Yates' continuity correction

data:  new_df$pcos and new_df$pimples
X-squared = 43.064, df = 1, p-value = 5.298e-11

Investigating the ‘Pregnant’ Variable

Since infertility is often the initial indication of PCOS, one might naturally consider pregnancy as a significant variable when analyzing statistical data between PCOS and non-PCOS females.

Chi^2 test: pcos, pregnant The Chi^2 is small. Small chi^2 for x=pcos and y=pregnant suggests no correlation. There was also a high p-value. A high p-value (greater than 0.05) suggests weak evidence against the null hypothesis. The null states no association between the pcos and pregnant variables. We fail to reject the null hypothesis. There is no compelling evidence to show a difference in pregnancy between PCOS and NonPCOS women.

chisq.test(new_df$`pcos`, new_df$`pregnant`)

    Pearson's Chi-squared test with Yates' continuity correction

data:  new_df$pcos and new_df$pregnant
X-squared = 0.29897, df = 1, p-value = 0.5845

Logistic Regression Model

1st glm

There are colinearities with weightkg and bmi.

glm_fit <- glm(`pcosy/n` ~ cyclelengthdays + waistinch + weightkg + bmi + hipinch + hairloss + pregnant + hairgrowth + weightgain + skindarkening + pimples + `bp_systolicmmhg` + pulseratebpm + `rrbreaths/min` + `hbg/dl` + ageyrs + `fshmiu/ml` + `lhmiu/ml` + `tshmiu/l`, data = new_df)
summary(glm_fit)

Call:
glm(formula = `pcosy/n` ~ cyclelengthdays + waistinch + weightkg + 
    bmi + hipinch + hairloss + pregnant + hairgrowth + weightgain + 
    skindarkening + pimples + bp_systolicmmhg + pulseratebpm + 
    `rrbreaths/min` + `hbg/dl` + ageyrs + `fshmiu/ml` + `lhmiu/ml` + 
    `tshmiu/l`, data = new_df)

Deviance Residuals: 
     Min        1Q    Median        3Q       Max  
-0.92878  -0.20994  -0.03856   0.18730   1.08493  

Coefficients:
                   Estimate Std. Error t value Pr(>|t|)    
(Intercept)      -4.960e-01  4.586e-01  -1.082 0.279930    
cyclelengthdays  -3.558e-02  1.061e-02  -3.352 0.000862 ***
waistinch        -2.802e-03  9.413e-03  -0.298 0.766101    
weightkg          1.360e-03  3.449e-03   0.394 0.693581    
bmi              -6.132e-03  9.221e-03  -0.665 0.506346    
hipinch           7.653e-03  8.485e-03   0.902 0.367507    
hairlossyes      -7.616e-03  3.349e-02  -0.227 0.820196    
pregnantyes      -2.367e-02  3.273e-02  -0.723 0.469823    
hairgrowthyes     2.747e-01  3.936e-02   6.979 9.08e-12 ***
weightgainyes     2.042e-01  4.037e-02   5.058 5.87e-07 ***
skindarkeningyes  2.699e-01  3.818e-02   7.070 5.01e-12 ***
pimplesyes        1.332e-01  3.363e-02   3.961 8.51e-05 ***
bp_systolicmmhg   1.656e-03  2.140e-03   0.774 0.439268    
pulseratebpm      6.951e-03  3.706e-03   1.875 0.061290 .  
`rrbreaths/min`   4.852e-03  9.730e-03   0.499 0.618197    
`hbg/dl`          7.388e-03  1.839e-02   0.402 0.688104    
ageyrs           -9.564e-03  2.936e-03  -3.258 0.001196 ** 
`fshmiu/ml`      -2.036e-05  7.184e-05  -0.283 0.776997    
`lhmiu/ml`        4.528e-04  1.802e-04   2.513 0.012278 *  
`tshmiu/l`        2.113e-03  4.191e-03   0.504 0.614333    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

(Dispersion parameter for gaussian family taken to be 0.1289632)

    Null deviance: 119.09  on 540  degrees of freedom
Residual deviance:  67.19  on 521  degrees of freedom
AIC: 448.82

Number of Fisher Scoring iterations: 2
vif(glm_fit)
cyclelengthdays       waistinch        weightkg             bmi         hipinch 
       1.050210        4.799686        6.058853        5.854789        4.746525 
       hairloss        pregnant      hairgrowth      weightgain   skindarkening 
       1.165851        1.059477        1.291380        1.605968        1.300406 
        pimples bp_systolicmmhg    pulseratebpm `rrbreaths/min`        `hbg/dl` 
       1.185324        1.045346        1.128994        1.130412        1.064733 
         ageyrs     `fshmiu/ml`      `lhmiu/ml`      `tshmiu/l` 
       1.056715        1.017909        1.021522        1.037065 

Second glm There are no colinearities and the AIC value decreased which is favorable. I will create another model removing variables with higher p-values.

glm_fit1 <- glm(`pcosy/n` ~ cyclelengthdays + hipinch + hairgrowth + weightgain + skindarkening + pimples + pulseratebpm + `hbg/dl` + ageyrs + `lhmiu/ml` , data = new_df)
summary(glm_fit1)

Call:
glm(formula = `pcosy/n` ~ cyclelengthdays + hipinch + hairgrowth + 
    weightgain + skindarkening + pimples + pulseratebpm + `hbg/dl` + 
    ageyrs + `lhmiu/ml`, data = new_df)

Deviance Residuals: 
     Min        1Q    Median        3Q       Max  
-0.92603  -0.20584  -0.03744   0.19655   1.09308  

Coefficients:
                   Estimate Std. Error t value Pr(>|t|)    
(Intercept)      -0.2989985  0.3814629  -0.784 0.433495    
cyclelengthdays  -0.0360485  0.0104510  -3.449 0.000607 ***
hipinch           0.0047672  0.0041540   1.148 0.251646    
hairgrowthyes     0.2720848  0.0384791   7.071 4.88e-12 ***
weightgainyes     0.1945372  0.0374208   5.199 2.87e-07 ***
skindarkeningyes  0.2706506  0.0375334   7.211 1.93e-12 ***
pimplesyes        0.1308806  0.0322419   4.059 5.66e-05 ***
pulseratebpm      0.0070535  0.0034923   2.020 0.043912 *  
`hbg/dl`          0.0092128  0.0181396   0.508 0.611748    
ageyrs           -0.0093590  0.0028637  -3.268 0.001152 ** 
`lhmiu/ml`        0.0004502  0.0001784   2.524 0.011907 *  
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

(Dispersion parameter for gaussian family taken to be 0.1273457)

    Null deviance: 119.091  on 540  degrees of freedom
Residual deviance:  67.493  on 530  degrees of freedom
AIC: 433.26

Number of Fisher Scoring iterations: 2
vif(glm_fit1)
cyclelengthdays         hipinch      hairgrowth      weightgain   skindarkening 
       1.031028        1.152040        1.250037        1.397345        1.272897 
        pimples    pulseratebpm        `hbg/dl`          ageyrs      `lhmiu/ml` 
       1.103611        1.015043        1.048595        1.018138        1.013779 

Third glm: final All p-values are relatively low in this model. The AIC decreased from 448.82 in the first model to 430.79 in the last model. Significant variables are: cycle length, hairgrowth (hirsuitism), weightgain, skindarkening, pimples, and age.

glm_fit2 <- glm(`pcosy/n` ~ cyclelengthdays + hairgrowth + weightgain + skindarkening + pimples + pulseratebpm + ageyrs + `lhmiu/ml` , data = new_df)
summary(glm_fit2)

Call:
glm(formula = `pcosy/n` ~ cyclelengthdays + hairgrowth + weightgain + 
    skindarkening + pimples + pulseratebpm + ageyrs + `lhmiu/ml`, 
    data = new_df)

Deviance Residuals: 
     Min        1Q    Median        3Q       Max  
-0.93998  -0.21257  -0.02925   0.19819   1.09898  

Coefficients:
                   Estimate Std. Error t value Pr(>|t|)    
(Intercept)      -0.0269176  0.2708081  -0.099 0.920860    
cyclelengthdays  -0.0351802  0.0104017  -3.382 0.000772 ***
hairgrowthyes     0.2781746  0.0379856   7.323 9.02e-13 ***
weightgainyes     0.2090757  0.0354327   5.901 6.45e-09 ***
skindarkeningyes  0.2684839  0.0374400   7.171 2.51e-12 ***
pimplesyes        0.1263897  0.0319430   3.957 8.63e-05 ***
pulseratebpm      0.0071055  0.0034804   2.042 0.041685 *  
ageyrs           -0.0093742  0.0028622  -3.275 0.001125 ** 
`lhmiu/ml`        0.0004417  0.0001776   2.487 0.013189 *  
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

(Dispersion parameter for gaussian family taken to be 0.1272269)

    Null deviance: 119.091  on 540  degrees of freedom
Residual deviance:  67.685  on 532  degrees of freedom
AIC: 430.79

Number of Fisher Scoring iterations: 2
vif(glm_fit2)
cyclelengthdays      hairgrowth      weightgain   skindarkening         pimples 
       1.022283        1.219318        1.253988        1.267751        1.084249 
   pulseratebpm          ageyrs      `lhmiu/ml` 
       1.009087        1.018040        1.005647 

Conclusion

  • Using the PCOS data collected by Kabbler, we examined several variables to assess their potential for predicting PCOS (Polycystic Ovary Syndrome) within the female population. The sample population was normally distributed across different age groups with about twice as many NonPCOS females (364) to PCOS females (177) in the sample. Though it is said that there is a 10% occurrence of PCOS in the female population. My investigation suggests that the rate is much higher, lying between 28-36%. I noted this after performing the bootstrap and confidence interval techniques.

  • A simple summary statistic confirmed my findings by observing the proportion of PCOS females within my sample population. That number came out to be 32.7 % which aligns with the evidence found within our confidence interval test. I also looked at some numerical data to compare the groups and help gauge which symptoms to target. I observed boxplots of weight and cycle length separately. The mean for weight between both groups were about the same (around 60kg) suggesting that PCOS isn’t a condition that only effects overweight or obese females. In the cycle length box plot, there was an obvious difference between the length of cycles between groups. NonPCOS had longer cycle days (>5days) than the PCOS group. This makes sense since amenorrhea (no menstrual cycle) is a common side effect of PCOS.

  • I then decided to observe weight and cycle length together in a scatterplot. I observed a subtle positive correlation between weight and cycle length in both groups that may suggest an increase in weight slightly lengthens cycle days. I created a scatter plot for BMI and Waist size. There is a positive correlation with BMI and Waist size for both groups, but the PCOS group had a steeper slope indicating that there are more members within this group that are larger and wider at the waist. The third scatterplot incorporates Age and Hip (inch). There is a noticeable difference between the PCOS and nonPCOS groups. The NonPCOS group has a positive correlation: as they age their hip size increases. However, the PCOS group has a negative correlation: as they age the hip size decreases. One possibility could be due to weight loss.

  • Next, I made bar graphs of four categorical variables (hair loss, weightgain, skindarkening, and pimples) to observe the proportions between PCOS and NonPCOS groups. I also added a chi^2 test to observe their association strength. Here is a list of the categorical variables ordered from most to least association strength with PCOS:

• Skin Darkening (chi-squared = 120.25)

• Hair Growth (chi-squared = 114.60)

• Weight Gain (chi-squared = 103.31)

• Pimples (chi-squared = 43.064)

• Hair Loss (chi-squared = 15.47)

Each chi^2 test had low p-values (<0.05), indicating that we reject the null hypothesis. The null hypothesis suggests that there isn’t a noticeable difference between PCOS and NonPCOS groups when it comes the variables listed above.

  • Out of curiosity, I performed a chi ^2 test on the pregnancy variable. I thought this would be an interesting variable to explore because the inability to conceive at some point was the first and only symptom doctors used to use to diagnose PCOS. However, upon observing the pregnancy variable in both the chi-squared test and the logistic regression model, it became apparent that this variable is not significant enough to be suitable as a symptom for PCOS. The chi^2 value was low and the p-value was high. This symptom should be disregarded when trying to form a diagnosis for PCOS. Pregnancy is probably a poor indicator for PCOS because there are various factors influencing a woman’s decision to conceive. Nowadays, women often take longer to conceive by choice, and the use of birth control could be a confounding factor in this context.

  • The logistic model did not highlight pregnancy as a significant variable but it did suggest a strong correlation to PCOS with the following symptoms:

•Cycle length

•Age

•Hair growth (hirsuitism)

•Weight gain

•Skin darkening

•Pimples

  • We’ve come a long way from solidifying one symptom (conception) as the main indicator for a PCOS diagnosis and the research remains ongoing. After conducting my own investigation, we support the notion that PCOS is a condition comprised of more than one symptom. Cycle length, Age, Hair growth (hirsutism), Weight gain, Skin darkening, and Pimples are all significant symptoms to look out for when investigating or forming a diagnosis for PCOS.

  • The variables I was eager to explore but was not included in my dataset were cholesterol levels and androgen levels. I always believed that PCOS involved not only hormonal factors but metabolic aspects. Incorporating cholesterol levels as a variable would serve as a valuable step toward investigating the metabolic aspect of my assumption. While androgen would target the hormonal part.

  • In my research, a recurring theme across all of the articles was androgen. Many of the articles mentioned how elevated levels of androgen contributed to symptoms such as: alopecia (hair loss) and hirsutism (excessive hair growth) in PCOS patients. During my investigation, I expected to see both variables as significant. However, I found that hair loss did not show significant differences between the PCOS and NonPCOS groups, but hair growth did. My concern is that hair growth in PCOS patients could be influenced by factors other than androgen levels. It would have been valuable to identify a correlation between androgen levels and hair growth. Overall, I believe my statistical analysis was comprehensive and thorough.

Bibliography

Cussen, L., McDonnell, T., Bennett, G., Thompson, C. J., Sherlock, M., & O’Reilly, M. W. (2022). Approach to androgen excess in women: Clinical and biochemical insights. Clinical Endocrinology, 97(2). https://doi.org/10.1111/cen.14710

Itriyeva, K. (2022). The effects of obesity on the menstrual cycle. Current Problems in Pediatric and Adolescent Health Care, 52(8), 101241. https://doi.org/10.1016/j.cppeds.2022.101241

A Review of Polycystic Ovary Syndrome (PCOS) | Elan Healthcare. (n.d.). Elanhealthcare.ca. https://elanhealthcare.ca/blogs/health-blog/a-review-of-polycystic-ovarian-syndrome-pcos

Szydlarska, D., Machaj, M., & Jakimiuk, A. (2017). History of discovery of polycystic ovary syndrome. Advances in Clinical and Experimental Medicine, 26(3), 555–558. https://doi.org/10.17219/acem/61987

UpToDate. (n.d.). Www.uptodate.com. https://www.uptodate.com/contents/polycystic-ovary-syndrome-pcos-beyond-the-basics/print#:~:text=Polycystic%20ovary%20syndrome%20(PCOS)%20is

Wekker, V., van Dammen, L., Koning, A., Heida, K. Y., Painter, R. C., Limpens, J., Laven, J. S. E., Roeters van Lennep, J. E., Roseboom, T. J., & Hoek, A. (2020). Long-term cardiometabolic disease risk in women with PCOS: a systematic review and meta-analysis. Human Reproduction Update, 26(6), 942–960. https://doi.org/10.1093/humupd/dmaa029

Xu, Y., & Qiao, J. (2022). Association of Insulin Resistance and Elevated Androgen Levels with Polycystic Ovarian Syndrome (PCOS): A Review of Literature. Journal of Healthcare Engineering, 2022, 1–13. https://doi.org/10.1155/2022/9240569