BSAN54000

Srinadh Yarlagadda
Lewis University


Objective: Studying PCOS Risk with Health and Lifestyle Information

By Exploring the dataset, the answering following research questions(At least 3-4).

###1) Which lifestyle habits and body health measures are most strongly linked to PCOS?
###2) How do these habits and health factors behave when we group them into categories?
###3) Can we build a good prediction model for PCOS using easy-to-measure lifestyle and medical information?
###4) How do BMI, fasting blood sugar, and hormone levels (like androgens) differ between people with PCOS and those without it?
###5) Are signs like irregular periods, cycle length changes, LH/FSH ratio, and follicle count dependable for finding PCOS?

# Install/load the required libraries

#install.packages("tidyverse")
#install.packages("gvlma")
#install.packages("effects")
#install.packages("readr")
#install.packages("car")
#install.packages("ISLR")
library(tidyverse)
library(gvlma)
library(effects)
library(readr)
library(car) 
library(ISLR)
#install.packages("readxl")
library(readxl)
library(pROC)
library(caret)
library(dplyr)
library(class)
set.seed(1) #this is to get consistent results between different users; 
getwd()
## [1] "C:/Users/srina/Downloads/Capstone_Project"
datafp <- read_excel("PCOS_data_without_infertility.xlsx", sheet = "Full_new")
## New names:
## • `` -> `...45`

Learning about the data

nrow(datafp)
## [1] 541
ncol(datafp)
## [1] 45
dim(datafp)
## [1] 541  45
str(datafp)
## tibble [541 × 45] (S3: tbl_df/tbl/data.frame)
##  $ Sl. No                : num [1:541] 1 2 3 4 5 6 7 8 9 10 ...
##  $ Patient File No.      : num [1:541] 1 2 3 4 5 6 7 8 9 10 ...
##  $ PCOS (Y/N)            : num [1:541] 0 0 1 0 0 0 0 0 0 0 ...
##  $ Age (yrs)             : num [1:541] 28 36 33 37 25 36 34 33 32 36 ...
##  $ Weight (Kg)           : num [1:541] 44.6 65 68.8 65 52 74.1 64 58.5 40 52 ...
##  $ Height(Cm)            : num [1:541] 152 162 165 148 161 ...
##  $ BMI                   : num [1:541] 19.3 25.3 29.7 20.1 27.2 ...
##  $ Blood Group           : num [1:541] 15 15 11 13 11 15 11 13 11 15 ...
##  $ Pulse rate(bpm)       : num [1:541] 78 74 72 72 72 78 72 72 72 80 ...
##  $ RR (breaths/min)      : num [1:541] 22 20 18 20 18 28 18 20 18 20 ...
##  $ Hb(g/dl)              : num [1:541] 10.5 11.7 11.8 12 10 ...
##  $ Cycle(R/I)            : num [1:541] 2 2 2 2 2 2 2 2 2 4 ...
##  $ Cycle length(days)    : num [1:541] 5 5 5 5 5 5 5 5 5 2 ...
##  $ Marraige Status (Yrs) : num [1:541] 7 11 10 4 1 8 2 13 8 4 ...
##  $ Pregnant(Y/N)         : num [1:541] 0 1 1 0 1 1 0 1 0 0 ...
##  $ No. of aborptions     : num [1:541] 0 0 0 0 0 0 0 2 1 0 ...
##  $ I   beta-HCG(mIU/mL)  : num [1:541] 1.99 60.8 494.08 1.99 801.45 ...
##  $ II    beta-HCG(mIU/mL): chr [1:541] "1.99" "1.99" "494.08" "1.99" ...
##  $ FSH(mIU/mL)           : num [1:541] 7.95 6.73 5.54 8.06 3.98 3.24 2.85 4.86 3.76 2.8 ...
##  $ LH(mIU/mL)            : num [1:541] 3.68 1.09 0.88 2.36 0.9 1.07 0.31 3.07 3.02 1.51 ...
##  $ FSH/LH                : num [1:541] NA NA NA NA NA NA NA NA NA NA ...
##  $ Hip(inch)             : num [1:541] 36 38 40 42 37 44 39 44 39 40 ...
##  $ Waist(inch)           : num [1:541] 30 32 36 36 30 38 33 38 35 38 ...
##  $ Waist:Hip Ratio       : num [1:541] NA NA NA NA NA NA NA NA NA NA ...
##  $ TSH (mIU/L)           : num [1:541] 0.68 3.16 2.54 16.41 3.57 ...
##  $ AMH(ng/mL)            : chr [1:541] "2.0699999999999998" "1.53" "6.63" "1.22" ...
##  $ PRL(ng/mL)            : num [1:541] 45.2 20.1 10.5 36.9 30.1 ...
##  $ Vit D3 (ng/mL)        : num [1:541] 17.1 61.3 49.7 33.4 43.8 52.4 42.7 38 21.8 27.7 ...
##  $ PRG(ng/mL)            : num [1:541] 0.57 0.97 0.36 0.36 0.38 0.3 0.46 0.26 0.3 0.25 ...
##  $ RBS(mg/dl)            : num [1:541] 92 92 84 76 84 76 93 91 116 125 ...
##  $ Weight gain(Y/N)      : num [1:541] 0 0 0 0 0 1 0 1 0 0 ...
##  $ hair growth(Y/N)      : num [1:541] 0 0 0 0 0 0 0 0 0 0 ...
##  $ Skin darkening (Y/N)  : num [1:541] 0 0 0 0 0 0 0 0 0 0 ...
##  $ Hair loss(Y/N)        : num [1:541] 0 0 1 0 1 1 0 0 0 0 ...
##  $ Pimples(Y/N)          : num [1:541] 0 0 1 0 0 0 0 0 0 0 ...
##  $ Fast food (Y/N)       : num [1:541] 1 0 1 0 0 0 0 0 0 0 ...
##  $ Reg.Exercise(Y/N)     : num [1:541] 0 0 0 0 0 0 0 0 0 0 ...
##  $ BP _Systolic (mmHg)   : num [1:541] 110 120 120 120 120 110 120 120 120 110 ...
##  $ BP _Diastolic (mmHg)  : num [1:541] 80 70 80 70 80 70 80 80 80 80 ...
##  $ Follicle No. (L)      : num [1:541] 3 3 13 2 3 9 6 7 5 1 ...
##  $ Follicle No. (R)      : num [1:541] 3 5 15 2 4 6 6 6 7 1 ...
##  $ Avg. F size (L) (mm)  : num [1:541] 18 15 18 15 16 16 15 15 17 14 ...
##  $ Avg. F size (R) (mm)  : num [1:541] 18 14 20 14 14 20 16 18 17 17 ...
##  $ Endometrium (mm)      : num [1:541] 8.5 3.7 10 7.5 7 8 6.8 7.1 4.2 2.5 ...
##  $ ...45                 : chr [1:541] NA NA NA NA ...

First, get rid of spaces in column names:

names(datafp) <- make.names(names(datafp))

view(datafp)
summary(datafp)
##      Sl..No    Patient.File.No.   PCOS..Y.N.       Age..yrs.    
##  Min.   :  1   Min.   :  1      Min.   :0.0000   Min.   :20.00  
##  1st Qu.:136   1st Qu.:136      1st Qu.:0.0000   1st Qu.:28.00  
##  Median :271   Median :271      Median :0.0000   Median :31.00  
##  Mean   :271   Mean   :271      Mean   :0.3272   Mean   :31.43  
##  3rd Qu.:406   3rd Qu.:406      3rd Qu.:1.0000   3rd Qu.:35.00  
##  Max.   :541   Max.   :541      Max.   :1.0000   Max.   :48.00  
##                                                                 
##   Weight..Kg.       Height.Cm.         BMI         Blood.Group  
##  Min.   : 31.00   Min.   :137.0   Min.   :12.42   Min.   :11.0  
##  1st Qu.: 52.00   1st Qu.:152.0   1st Qu.:21.64   1st Qu.:13.0  
##  Median : 59.00   Median :156.0   Median :24.22   Median :14.0  
##  Mean   : 59.64   Mean   :156.5   Mean   :24.30   Mean   :13.8  
##  3rd Qu.: 65.00   3rd Qu.:160.0   3rd Qu.:26.63   3rd Qu.:15.0  
##  Max.   :108.00   Max.   :180.0   Max.   :38.90   Max.   :18.0  
##                                                                 
##  Pulse.rate.bpm. RR..breaths.min.    Hb.g.dl.       Cycle.R.I.  
##  Min.   :13.00   Min.   :16.00    Min.   : 8.50   Min.   :2.00  
##  1st Qu.:72.00   1st Qu.:18.00    1st Qu.:10.50   1st Qu.:2.00  
##  Median :72.00   Median :18.00    Median :11.00   Median :2.00  
##  Mean   :73.25   Mean   :19.24    Mean   :11.16   Mean   :2.56  
##  3rd Qu.:74.00   3rd Qu.:20.00    3rd Qu.:11.70   3rd Qu.:4.00  
##  Max.   :82.00   Max.   :28.00    Max.   :14.80   Max.   :5.00  
##                                                                 
##  Cycle.length.days. Marraige.Status..Yrs. Pregnant.Y.N.    No..of.aborptions
##  Min.   : 0.000     Min.   : 0.000        Min.   :0.0000   Min.   :0.0000   
##  1st Qu.: 4.000     1st Qu.: 4.000        1st Qu.:0.0000   1st Qu.:0.0000   
##  Median : 5.000     Median : 7.000        Median :0.0000   Median :0.0000   
##  Mean   : 4.941     Mean   : 7.681        Mean   :0.3808   Mean   :0.2884   
##  3rd Qu.: 5.000     3rd Qu.:10.000        3rd Qu.:1.0000   3rd Qu.:0.0000   
##  Max.   :12.000     Max.   :30.000        Max.   :1.0000   Max.   :5.0000   
##                     NA's   :1                                               
##  I...beta.HCG.mIU.mL. II....beta.HCG.mIU.mL.  FSH.mIU.mL.     
##  Min.   :    1.30     Length:541             Min.   :   0.21  
##  1st Qu.:    1.99     Class :character       1st Qu.:   3.30  
##  Median :   20.00     Mode  :character       Median :   4.85  
##  Mean   :  664.55                            Mean   :  14.60  
##  3rd Qu.:  297.21                            3rd Qu.:   6.41  
##  Max.   :32460.97                            Max.   :5052.00  
##                                                               
##    LH.mIU.mL.          FSH.LH        Hip.inch.      Waist.inch.   
##  Min.   :   0.02   Min.   :0.513   Min.   :26.00   Min.   :24.00  
##  1st Qu.:   1.02   1st Qu.:1.286   1st Qu.:36.00   1st Qu.:32.00  
##  Median :   2.30   Median :1.673   Median :38.00   Median :34.00  
##  Mean   :   6.47   Mean   :3.043   Mean   :37.99   Mean   :33.84  
##  3rd Qu.:   3.68   3rd Qu.:4.433   3rd Qu.:40.00   3rd Qu.:36.00  
##  Max.   :2018.00   Max.   :7.250   Max.   :48.00   Max.   :47.00  
##                    NA's   :532                                    
##  Waist.Hip.Ratio  TSH..mIU.L.      AMH.ng.mL.          PRL.ng.mL.    
##  Min.   :0.777   Min.   : 0.040   Length:541         Min.   :  0.40  
##  1st Qu.:0.795   1st Qu.: 1.480   Class :character   1st Qu.: 14.52  
##  Median :0.842   Median : 2.260   Mode  :character   Median : 21.92  
##  Mean   :0.849   Mean   : 2.981                      Mean   : 24.32  
##  3rd Qu.:0.875   3rd Qu.: 3.570                      3rd Qu.: 29.89  
##  Max.   :0.941   Max.   :65.000                      Max.   :128.24  
##  NA's   :532                                                         
##  Vit.D3..ng.mL.      PRG.ng.mL.        RBS.mg.dl.     Weight.gain.Y.N.
##  Min.   :   0.00   Min.   : 0.0470   Min.   : 60.00   Min.   :0.0000  
##  1st Qu.:  20.80   1st Qu.: 0.2500   1st Qu.: 92.00   1st Qu.:0.0000  
##  Median :  25.90   Median : 0.3200   Median :100.00   Median :0.0000  
##  Mean   :  49.92   Mean   : 0.6109   Mean   : 99.84   Mean   :0.3771  
##  3rd Qu.:  34.50   3rd Qu.: 0.4500   3rd Qu.:107.00   3rd Qu.:1.0000  
##  Max.   :6014.66   Max.   :85.0000   Max.   :350.00   Max.   :1.0000  
##                                                                       
##  hair.growth.Y.N. Skin.darkening..Y.N. Hair.loss.Y.N.    Pimples.Y.N.   
##  Min.   :0.0000   Min.   :0.0000       Min.   :0.0000   Min.   :0.0000  
##  1st Qu.:0.0000   1st Qu.:0.0000       1st Qu.:0.0000   1st Qu.:0.0000  
##  Median :0.0000   Median :0.0000       Median :0.0000   Median :0.0000  
##  Mean   :0.2736   Mean   :0.3068       Mean   :0.4529   Mean   :0.4898  
##  3rd Qu.:1.0000   3rd Qu.:1.0000       3rd Qu.:1.0000   3rd Qu.:1.0000  
##  Max.   :1.0000   Max.   :1.0000       Max.   :1.0000   Max.   :1.0000  
##                                                                         
##  Fast.food..Y.N.  Reg.Exercise.Y.N. BP._Systolic..mmHg. BP._Diastolic..mmHg.
##  Min.   :0.0000   Min.   :0.0000    Min.   : 12.0       Min.   :  8.00      
##  1st Qu.:0.0000   1st Qu.:0.0000    1st Qu.:110.0       1st Qu.: 70.00      
##  Median :1.0000   Median :0.0000    Median :110.0       Median : 80.00      
##  Mean   :0.5148   Mean   :0.2477    Mean   :114.7       Mean   : 76.93      
##  3rd Qu.:1.0000   3rd Qu.:0.0000    3rd Qu.:120.0       3rd Qu.: 80.00      
##  Max.   :1.0000   Max.   :1.0000    Max.   :140.0       Max.   :100.00      
##  NA's   :1                                                                  
##  Follicle.No...L. Follicle.No...R. Avg..F.size..L...mm. Avg..F.size..R...mm.
##  Min.   : 0.000   Min.   : 0.000   Min.   : 0.00        Min.   : 0.00       
##  1st Qu.: 3.000   1st Qu.: 3.000   1st Qu.:13.00        1st Qu.:13.00       
##  Median : 5.000   Median : 6.000   Median :15.00        Median :16.00       
##  Mean   : 6.129   Mean   : 6.641   Mean   :15.02        Mean   :15.45       
##  3rd Qu.: 9.000   3rd Qu.:10.000   3rd Qu.:18.00        3rd Qu.:18.00       
##  Max.   :22.000   Max.   :20.000   Max.   :24.00        Max.   :24.00       
##                                                                             
##  Endometrium..mm.    ...45          
##  Min.   : 0.000   Length:541        
##  1st Qu.: 7.000   Class :character  
##  Median : 8.500   Mode  :character  
##  Mean   : 8.476                     
##  3rd Qu.: 9.800                     
##  Max.   :18.000                     
## 

Data cleaning & preparing for analysis

datafpc <- datafp[, -c(1, 2, 45)]


#library(dplyr)

#datafpc <- datafpc %>% 
#  mutate(across(
#    all_of(c(
#      "PCOS..Y.N.",
#      "Pregnant.Y.N.",
#      "Weight.gain.Y.N.",
#      "hair.growth.Y.N.",
#      "Skin.darkening..Y.N.",
#      "Hair.loss.Y.N.",
#      "Pimples.Y.N.",
#      "Fast.food..Y.N.",
#      "Reg.Exercise.Y.N."
#    )),
#    as.factor
#  ))

view(datafpc)

str(datafpc)
## tibble [541 × 42] (S3: tbl_df/tbl/data.frame)
##  $ PCOS..Y.N.            : num [1:541] 0 0 1 0 0 0 0 0 0 0 ...
##  $ Age..yrs.             : num [1:541] 28 36 33 37 25 36 34 33 32 36 ...
##  $ Weight..Kg.           : num [1:541] 44.6 65 68.8 65 52 74.1 64 58.5 40 52 ...
##  $ Height.Cm.            : num [1:541] 152 162 165 148 161 ...
##  $ BMI                   : num [1:541] 19.3 25.3 29.7 20.1 27.2 ...
##  $ Blood.Group           : num [1:541] 15 15 11 13 11 15 11 13 11 15 ...
##  $ Pulse.rate.bpm.       : num [1:541] 78 74 72 72 72 78 72 72 72 80 ...
##  $ RR..breaths.min.      : num [1:541] 22 20 18 20 18 28 18 20 18 20 ...
##  $ Hb.g.dl.              : num [1:541] 10.5 11.7 11.8 12 10 ...
##  $ Cycle.R.I.            : num [1:541] 2 2 2 2 2 2 2 2 2 4 ...
##  $ Cycle.length.days.    : num [1:541] 5 5 5 5 5 5 5 5 5 2 ...
##  $ Marraige.Status..Yrs. : num [1:541] 7 11 10 4 1 8 2 13 8 4 ...
##  $ Pregnant.Y.N.         : num [1:541] 0 1 1 0 1 1 0 1 0 0 ...
##  $ No..of.aborptions     : num [1:541] 0 0 0 0 0 0 0 2 1 0 ...
##  $ I...beta.HCG.mIU.mL.  : num [1:541] 1.99 60.8 494.08 1.99 801.45 ...
##  $ II....beta.HCG.mIU.mL.: chr [1:541] "1.99" "1.99" "494.08" "1.99" ...
##  $ FSH.mIU.mL.           : num [1:541] 7.95 6.73 5.54 8.06 3.98 3.24 2.85 4.86 3.76 2.8 ...
##  $ LH.mIU.mL.            : num [1:541] 3.68 1.09 0.88 2.36 0.9 1.07 0.31 3.07 3.02 1.51 ...
##  $ FSH.LH                : num [1:541] NA NA NA NA NA NA NA NA NA NA ...
##  $ Hip.inch.             : num [1:541] 36 38 40 42 37 44 39 44 39 40 ...
##  $ Waist.inch.           : num [1:541] 30 32 36 36 30 38 33 38 35 38 ...
##  $ Waist.Hip.Ratio       : num [1:541] NA NA NA NA NA NA NA NA NA NA ...
##  $ TSH..mIU.L.           : num [1:541] 0.68 3.16 2.54 16.41 3.57 ...
##  $ AMH.ng.mL.            : chr [1:541] "2.0699999999999998" "1.53" "6.63" "1.22" ...
##  $ PRL.ng.mL.            : num [1:541] 45.2 20.1 10.5 36.9 30.1 ...
##  $ Vit.D3..ng.mL.        : num [1:541] 17.1 61.3 49.7 33.4 43.8 52.4 42.7 38 21.8 27.7 ...
##  $ PRG.ng.mL.            : num [1:541] 0.57 0.97 0.36 0.36 0.38 0.3 0.46 0.26 0.3 0.25 ...
##  $ RBS.mg.dl.            : num [1:541] 92 92 84 76 84 76 93 91 116 125 ...
##  $ Weight.gain.Y.N.      : num [1:541] 0 0 0 0 0 1 0 1 0 0 ...
##  $ hair.growth.Y.N.      : num [1:541] 0 0 0 0 0 0 0 0 0 0 ...
##  $ Skin.darkening..Y.N.  : num [1:541] 0 0 0 0 0 0 0 0 0 0 ...
##  $ Hair.loss.Y.N.        : num [1:541] 0 0 1 0 1 1 0 0 0 0 ...
##  $ Pimples.Y.N.          : num [1:541] 0 0 1 0 0 0 0 0 0 0 ...
##  $ Fast.food..Y.N.       : num [1:541] 1 0 1 0 0 0 0 0 0 0 ...
##  $ Reg.Exercise.Y.N.     : num [1:541] 0 0 0 0 0 0 0 0 0 0 ...
##  $ BP._Systolic..mmHg.   : num [1:541] 110 120 120 120 120 110 120 120 120 110 ...
##  $ BP._Diastolic..mmHg.  : num [1:541] 80 70 80 70 80 70 80 80 80 80 ...
##  $ Follicle.No...L.      : num [1:541] 3 3 13 2 3 9 6 7 5 1 ...
##  $ Follicle.No...R.      : num [1:541] 3 5 15 2 4 6 6 6 7 1 ...
##  $ Avg..F.size..L...mm.  : num [1:541] 18 15 18 15 16 16 15 15 17 14 ...
##  $ Avg..F.size..R...mm.  : num [1:541] 18 14 20 14 14 20 16 18 17 17 ...
##  $ Endometrium..mm.      : num [1:541] 8.5 3.7 10 7.5 7 8 6.8 7.1 4.2 2.5 ...

Converting into numerical variables - II….beta.HCG.mIU.mL., AMH.ng.mL.

datafpc$II....beta.HCG.mIU.mL. <- as.numeric(as.character(datafpc$II....beta.HCG.mIU.mL.))
## Warning: NAs introduced by coercion
datafpc$AMH.ng.mL. <- as.numeric(as.character(datafpc$AMH.ng.mL.))
## Warning: NAs introduced by coercion
str(datafpc)
## tibble [541 × 42] (S3: tbl_df/tbl/data.frame)
##  $ PCOS..Y.N.            : num [1:541] 0 0 1 0 0 0 0 0 0 0 ...
##  $ Age..yrs.             : num [1:541] 28 36 33 37 25 36 34 33 32 36 ...
##  $ Weight..Kg.           : num [1:541] 44.6 65 68.8 65 52 74.1 64 58.5 40 52 ...
##  $ Height.Cm.            : num [1:541] 152 162 165 148 161 ...
##  $ BMI                   : num [1:541] 19.3 25.3 29.7 20.1 27.2 ...
##  $ Blood.Group           : num [1:541] 15 15 11 13 11 15 11 13 11 15 ...
##  $ Pulse.rate.bpm.       : num [1:541] 78 74 72 72 72 78 72 72 72 80 ...
##  $ RR..breaths.min.      : num [1:541] 22 20 18 20 18 28 18 20 18 20 ...
##  $ Hb.g.dl.              : num [1:541] 10.5 11.7 11.8 12 10 ...
##  $ Cycle.R.I.            : num [1:541] 2 2 2 2 2 2 2 2 2 4 ...
##  $ Cycle.length.days.    : num [1:541] 5 5 5 5 5 5 5 5 5 2 ...
##  $ Marraige.Status..Yrs. : num [1:541] 7 11 10 4 1 8 2 13 8 4 ...
##  $ Pregnant.Y.N.         : num [1:541] 0 1 1 0 1 1 0 1 0 0 ...
##  $ No..of.aborptions     : num [1:541] 0 0 0 0 0 0 0 2 1 0 ...
##  $ I...beta.HCG.mIU.mL.  : num [1:541] 1.99 60.8 494.08 1.99 801.45 ...
##  $ II....beta.HCG.mIU.mL.: num [1:541] 1.99 1.99 494.08 1.99 801.45 ...
##  $ FSH.mIU.mL.           : num [1:541] 7.95 6.73 5.54 8.06 3.98 3.24 2.85 4.86 3.76 2.8 ...
##  $ LH.mIU.mL.            : num [1:541] 3.68 1.09 0.88 2.36 0.9 1.07 0.31 3.07 3.02 1.51 ...
##  $ FSH.LH                : num [1:541] NA NA NA NA NA NA NA NA NA NA ...
##  $ Hip.inch.             : num [1:541] 36 38 40 42 37 44 39 44 39 40 ...
##  $ Waist.inch.           : num [1:541] 30 32 36 36 30 38 33 38 35 38 ...
##  $ Waist.Hip.Ratio       : num [1:541] NA NA NA NA NA NA NA NA NA NA ...
##  $ TSH..mIU.L.           : num [1:541] 0.68 3.16 2.54 16.41 3.57 ...
##  $ AMH.ng.mL.            : num [1:541] 2.07 1.53 6.63 1.22 2.26 6.74 3.05 1.54 1 1.61 ...
##  $ PRL.ng.mL.            : num [1:541] 45.2 20.1 10.5 36.9 30.1 ...
##  $ Vit.D3..ng.mL.        : num [1:541] 17.1 61.3 49.7 33.4 43.8 52.4 42.7 38 21.8 27.7 ...
##  $ PRG.ng.mL.            : num [1:541] 0.57 0.97 0.36 0.36 0.38 0.3 0.46 0.26 0.3 0.25 ...
##  $ RBS.mg.dl.            : num [1:541] 92 92 84 76 84 76 93 91 116 125 ...
##  $ Weight.gain.Y.N.      : num [1:541] 0 0 0 0 0 1 0 1 0 0 ...
##  $ hair.growth.Y.N.      : num [1:541] 0 0 0 0 0 0 0 0 0 0 ...
##  $ Skin.darkening..Y.N.  : num [1:541] 0 0 0 0 0 0 0 0 0 0 ...
##  $ Hair.loss.Y.N.        : num [1:541] 0 0 1 0 1 1 0 0 0 0 ...
##  $ Pimples.Y.N.          : num [1:541] 0 0 1 0 0 0 0 0 0 0 ...
##  $ Fast.food..Y.N.       : num [1:541] 1 0 1 0 0 0 0 0 0 0 ...
##  $ Reg.Exercise.Y.N.     : num [1:541] 0 0 0 0 0 0 0 0 0 0 ...
##  $ BP._Systolic..mmHg.   : num [1:541] 110 120 120 120 120 110 120 120 120 110 ...
##  $ BP._Diastolic..mmHg.  : num [1:541] 80 70 80 70 80 70 80 80 80 80 ...
##  $ Follicle.No...L.      : num [1:541] 3 3 13 2 3 9 6 7 5 1 ...
##  $ Follicle.No...R.      : num [1:541] 3 5 15 2 4 6 6 6 7 1 ...
##  $ Avg..F.size..L...mm.  : num [1:541] 18 15 18 15 16 16 15 15 17 14 ...
##  $ Avg..F.size..R...mm.  : num [1:541] 18 14 20 14 14 20 16 18 17 17 ...
##  $ Endometrium..mm.      : num [1:541] 8.5 3.7 10 7.5 7 8 6.8 7.1 4.2 2.5 ...

Checking missing values

colSums(is.na(datafpc))
##             PCOS..Y.N.              Age..yrs.            Weight..Kg. 
##                      0                      0                      0 
##             Height.Cm.                    BMI            Blood.Group 
##                      0                      0                      0 
##        Pulse.rate.bpm.       RR..breaths.min.               Hb.g.dl. 
##                      0                      0                      0 
##             Cycle.R.I.     Cycle.length.days.  Marraige.Status..Yrs. 
##                      0                      0                      1 
##          Pregnant.Y.N.      No..of.aborptions   I...beta.HCG.mIU.mL. 
##                      0                      0                      0 
## II....beta.HCG.mIU.mL.            FSH.mIU.mL.             LH.mIU.mL. 
##                      1                      0                      0 
##                 FSH.LH              Hip.inch.            Waist.inch. 
##                    532                      0                      0 
##        Waist.Hip.Ratio            TSH..mIU.L.             AMH.ng.mL. 
##                    532                      0                      1 
##             PRL.ng.mL.         Vit.D3..ng.mL.             PRG.ng.mL. 
##                      0                      0                      0 
##             RBS.mg.dl.       Weight.gain.Y.N.       hair.growth.Y.N. 
##                      0                      0                      0 
##   Skin.darkening..Y.N.         Hair.loss.Y.N.           Pimples.Y.N. 
##                      0                      0                      0 
##        Fast.food..Y.N.      Reg.Exercise.Y.N.    BP._Systolic..mmHg. 
##                      1                      0                      0 
##   BP._Diastolic..mmHg.       Follicle.No...L.       Follicle.No...R. 
##                      0                      0                      0 
##   Avg..F.size..L...mm.   Avg..F.size..R...mm.       Endometrium..mm. 
##                      0                      0                      0

FSH.LH, Waist.Hip.Ratio has a very large number of missing values (over 500), which made the model unstable and unreliable. Including it would have removed most of the dataset, leaving almost no usable cases. To avoid losing too many observations and to maintain model stability, the variable was eliminated from the analysis so the remaining predictors with minimal missing values can be used effectively.

# Remove FSH.LH and Waist.Hip.Ratio, eliminate missing values from datafpc
datafpc1 <- datafpc %>%
  dplyr::select(-FSH.LH, -Waist.Hip.Ratio) %>%
  tidyr::drop_na()

# Verify removal
colnames(datafpc1)
##  [1] "PCOS..Y.N."             "Age..yrs."              "Weight..Kg."           
##  [4] "Height.Cm."             "BMI"                    "Blood.Group"           
##  [7] "Pulse.rate.bpm."        "RR..breaths.min."       "Hb.g.dl."              
## [10] "Cycle.R.I."             "Cycle.length.days."     "Marraige.Status..Yrs." 
## [13] "Pregnant.Y.N."          "No..of.aborptions"      "I...beta.HCG.mIU.mL."  
## [16] "II....beta.HCG.mIU.mL." "FSH.mIU.mL."            "LH.mIU.mL."            
## [19] "Hip.inch."              "Waist.inch."            "TSH..mIU.L."           
## [22] "AMH.ng.mL."             "PRL.ng.mL."             "Vit.D3..ng.mL."        
## [25] "PRG.ng.mL."             "RBS.mg.dl."             "Weight.gain.Y.N."      
## [28] "hair.growth.Y.N."       "Skin.darkening..Y.N."   "Hair.loss.Y.N."        
## [31] "Pimples.Y.N."           "Fast.food..Y.N."        "Reg.Exercise.Y.N."     
## [34] "BP._Systolic..mmHg."    "BP._Diastolic..mmHg."   "Follicle.No...L."      
## [37] "Follicle.No...R."       "Avg..F.size..L...mm."   "Avg..F.size..R...mm."  
## [40] "Endometrium..mm."
colSums(is.na(datafpc1))
##             PCOS..Y.N.              Age..yrs.            Weight..Kg. 
##                      0                      0                      0 
##             Height.Cm.                    BMI            Blood.Group 
##                      0                      0                      0 
##        Pulse.rate.bpm.       RR..breaths.min.               Hb.g.dl. 
##                      0                      0                      0 
##             Cycle.R.I.     Cycle.length.days.  Marraige.Status..Yrs. 
##                      0                      0                      0 
##          Pregnant.Y.N.      No..of.aborptions   I...beta.HCG.mIU.mL. 
##                      0                      0                      0 
## II....beta.HCG.mIU.mL.            FSH.mIU.mL.             LH.mIU.mL. 
##                      0                      0                      0 
##              Hip.inch.            Waist.inch.            TSH..mIU.L. 
##                      0                      0                      0 
##             AMH.ng.mL.             PRL.ng.mL.         Vit.D3..ng.mL. 
##                      0                      0                      0 
##             PRG.ng.mL.             RBS.mg.dl.       Weight.gain.Y.N. 
##                      0                      0                      0 
##       hair.growth.Y.N.   Skin.darkening..Y.N.         Hair.loss.Y.N. 
##                      0                      0                      0 
##           Pimples.Y.N.        Fast.food..Y.N.      Reg.Exercise.Y.N. 
##                      0                      0                      0 
##    BP._Systolic..mmHg.   BP._Diastolic..mmHg.       Follicle.No...L. 
##                      0                      0                      0 
##       Follicle.No...R.   Avg..F.size..L...mm.   Avg..F.size..R...mm. 
##                      0                      0                      0 
##       Endometrium..mm. 
##                      0

Exploring variable categories

# ---- Categorization of Variables ----

clinical_vars <- c("Cycle.R.I.", "Cycle.length.days.", "Marraige.Status..Yrs.",
                   "Pregnant.Y.N.", "No..of.aborptions", "Pimples.Y.N.",
                   "Skin.darkening..Y.N.", "hair.growth.Y.N.", "Hair.loss.Y.N.",
                   "Weight.gain.Y.N.", "Follicle.No...L.", "Follicle.No...R.",
                   "Avg..F.size..L...mm.", "Avg..F.size..R...mm.", "Endometrium..mm.")

hormonal_vars <- c("FSH.mIU.mL.", "LH.mIU.mL.", "TSH..mIU.L.",
                   "AMH.ng.mL.", "PRL.ng.mL.", "PRG.ng.mL.", "Vit.D3..ng.mL.")

lifestyle_vars <- c("Fast.food..Y.N.", "Reg.Exercise.Y.N.")

physical_vars <- c("Age..yrs.", "Weight..Kg.", "Height.Cm.", "BMI",
                   "Hip.inch.", "Waist.inch.")

# Compare group behavior (PCOS vs Non-PCOS)

aggregate(datafpc1[, clinical_vars], by = list(datafpc1$PCOS..Y.N.), mean, na.rm = TRUE)
##   Group.1 Cycle.R.I. Cycle.length.days. Marraige.Status..Yrs. Pregnant.Y.N.
## 1       0   2.303867           5.129834              8.063536     0.3922652
## 2       1   3.080000           4.542857              6.929714     0.3657143
##   No..of.aborptions Pimples.Y.N. Skin.darkening..Y.N. hair.growth.Y.N.
## 1         0.3176796    0.3895028            0.1519337        0.1298343
## 2         0.2342857    0.7028571            0.6228571        0.5714286
##   Hair.loss.Y.N. Weight.gain.Y.N. Follicle.No...L. Follicle.No...R.
## 1      0.3922652        0.2292818         4.350829         4.629834
## 2      0.5771429        0.6857143         9.760000        10.782857
##   Avg..F.size..L...mm. Avg..F.size..R...mm. Endometrium..mm.
## 1             14.69144             15.22983         8.315110
## 2             15.66571             15.89240         8.790286
aggregate(datafpc1[, hormonal_vars], by = list(datafpc1$PCOS..Y.N.), mean, na.rm = TRUE)
##   Group.1 FSH.mIU.mL. LH.mIU.mL. TSH..mIU.L. AMH.ng.mL. PRL.ng.mL. PRG.ng.mL.
## 1       0   19.275381   2.624514    2.974622   4.539483   24.37602  0.7294558
## 2       1    5.195789  14.536526    2.939886   7.783429   24.48114  0.3692457
##   Vit.D3..ng.mL.
## 1       29.28034
## 2       93.12461
aggregate(datafpc1[, lifestyle_vars], by = list(datafpc1$PCOS..Y.N.), mean, na.rm = TRUE)
##   Group.1 Fast.food..Y.N. Reg.Exercise.Y.N.
## 1       0       0.3839779         0.2237569
## 2       1       0.7885714         0.2857143
aggregate(datafpc1[, physical_vars], by = list(datafpc1$PCOS..Y.N.), mean, na.rm = TRUE)
##   Group.1 Age..yrs. Weight..Kg. Height.Cm.      BMI Hip.inch. Waist.inch.
## 1       0  32.06630    58.02762   156.2046 24.02336  37.55249    33.43370
## 2       1  30.13143    63.10000   157.0871 24.85373  38.87429    34.65714

As we know our objective is Studying PCOS Risk with Health and Lifestyle Information. It makes “PCOS..Y.N.” as dependent variable. Lets find correlation b/w variables

# Compare correlations within each category

cor(datafpc1[, clinical_vars], datafpc1$PCOS..Y.N., use = "complete.obs")
##                              [,1]
## Cycle.R.I.             0.40440672
## Cycle.length.days.    -0.18427454
## Marraige.Status..Yrs. -0.11060391
## Pregnant.Y.N.         -0.02559205
## No..of.aborptions     -0.05631673
## Pimples.Y.N.           0.29378241
## Skin.darkening..Y.N.   0.47923362
## hair.growth.Y.N.       0.46420073
## Hair.loss.Y.N.         0.17409286
## Weight.gain.Y.N.       0.44119302
## Follicle.No...L.       0.60037587
## Follicle.No...R.       0.64959146
## Avg..F.size..L...mm.   0.12808887
## Avg..F.size..R...mm.   0.09347825
## Endometrium..mm.       0.10320262
cor(datafpc1[, hormonal_vars], datafpc1$PCOS..Y.N., use = "complete.obs")
##                        [,1]
## FSH.mIU.mL.    -0.030323547
## LH.mIU.mL.      0.064238503
## TSH..mIU.L.    -0.004373199
## AMH.ng.mL.      0.259441628
## PRL.ng.mL.      0.003293912
## PRG.ng.mL.     -0.044204025
## Vit.D3..ng.mL.  0.086195295
cor(datafpc1[, lifestyle_vars], datafpc1$PCOS..Y.N., use = "complete.obs")
##                         [,1]
## Fast.food..Y.N.   0.37945972
## Reg.Exercise.Y.N. 0.06761884
cor(datafpc1[, physical_vars], datafpc1$PCOS..Y.N., use = "complete.obs")
##                    [,1]
## Age..yrs.   -0.16789225
## Weight..Kg.  0.21577019
## Height.Cm.   0.06853639
## BMI          0.09593202
## Hip.inch.    0.15639366
## Waist.inch.  0.15933945

find overall correlations

num_vars <- datafpc1[, sapply(datafpc1, is.numeric)]

# Compute correlations

corr_matrix  <- cor(num_vars, use = "pairwise.complete.obs")

corr_values  <- corr_matrix["PCOS..Y.N.", ]

corr_values
##             PCOS..Y.N.              Age..yrs.            Weight..Kg. 
##            1.000000000           -0.167892254            0.215770187 
##             Height.Cm.                    BMI            Blood.Group 
##            0.068536394            0.095932022            0.032040713 
##        Pulse.rate.bpm.       RR..breaths.min.               Hb.g.dl. 
##            0.092428293            0.040696271            0.089103429 
##             Cycle.R.I.     Cycle.length.days.  Marraige.Status..Yrs. 
##            0.404406716           -0.184274536           -0.110603911 
##          Pregnant.Y.N.      No..of.aborptions   I...beta.HCG.mIU.mL. 
##           -0.025592050           -0.056316729           -0.027598462 
## II....beta.HCG.mIU.mL.            FSH.mIU.mL.             LH.mIU.mL. 
##            0.013228336           -0.030323547            0.064238503 
##              Hip.inch.            Waist.inch.            TSH..mIU.L. 
##            0.156393662            0.159339451           -0.004373199 
##             AMH.ng.mL.             PRL.ng.mL.         Vit.D3..ng.mL. 
##            0.259441628            0.003293912            0.086195295 
##             PRG.ng.mL.             RBS.mg.dl.       Weight.gain.Y.N. 
##           -0.044204025            0.050687814            0.441193022 
##       hair.growth.Y.N.   Skin.darkening..Y.N.         Hair.loss.Y.N. 
##            0.464200725            0.479233621            0.174092857 
##           Pimples.Y.N.        Fast.food..Y.N.      Reg.Exercise.Y.N. 
##            0.293782412            0.379459721            0.067618835 
##    BP._Systolic..mmHg.   BP._Diastolic..mmHg.       Follicle.No...L. 
##            0.013286334            0.037020193            0.600375866 
##       Follicle.No...R.   Avg..F.size..L...mm.   Avg..F.size..R...mm. 
##            0.649591460            0.128088867            0.093478246 
##       Endometrium..mm. 
##            0.103202617
# Build table
corr_table <- data.frame(
  Variable    = names(corr_values),
  Correlation = as.numeric(corr_values),
  row.names   = NULL
)


view(corr_table)

corr_table <- corr_table[-1,]

Looking at the correlations, PCOS is most strongly associated with higher follicle counts on both ovaries, followed by symptoms like skin darkening, excess hair growth, weight gain, and irregular menstrual cycles. Lifestyle factors such as fast-food intake and acne also show moderate relationships. Hormonal imbalance (FSH/LH) and body weight contribute slightly. Negative correlations appear for cycle length, age, and marriage duration. Overall, clinical symptoms, hormonal markers, and lifestyle habits together show meaningful links to PCOS risk.

# quick pair plot for these variables - considering correlation is >0.1 & <-0.1

cols <- ifelse(datafpc$PCOS..Y.N. == 1, "red", "green")

# Pair plots for strongly correlated variables by category(like clinical, hormonal, lifestyle, physical)

# Clinical variables behavior with PCOS
datafpc1 %>%
  dplyr::select(PCOS..Y.N., Follicle.No...R., Follicle.No...L., Cycle.R.I., Cycle.length.days., Avg..F.size..L...mm., Avg..F.size..R...mm.,) %>%
  pairs(col = cols, pch = 19)

datafpc1 %>%
  dplyr::select(PCOS..Y.N., Follicle.No...R., Follicle.No...L., Avg..F.size..L...mm., Avg..F.size..R...mm.,) %>%
  pairs(col = cols, pch = 19)

datafpc1 %>%
  dplyr::select(PCOS..Y.N., Skin.darkening..Y.N., hair.growth.Y.N., Weight.gain.Y.N., Pimples.Y.N.) %>%
  pairs(col = cols, pch = 19)

# Hormonal variables behavior with PCOS
datafpc1 %>%
  dplyr::select(PCOS..Y.N.,  AMH.ng.mL., Endometrium..mm., Pulse.rate.bpm.) %>%
  pairs(col = cols, pch = 19)

# Lifestyle variables behavior with PCOS
datafpc %>%
  dplyr::select(PCOS..Y.N., Fast.food..Y.N.) %>%
  pairs(col = cols, pch = 19)

# Physical variables behavior with PCOS
datafpc %>%
  dplyr::select(PCOS..Y.N., Weight..Kg., Waist.inch., BMI) %>%
  pairs(col = cols, pch = 19)

From the pair plots, the strongest visual patterns appear in the follicle count variables — both left and right ovaries show clear separation between PCOS and non-PCOS groups, with PCOS cases forming distinct clusters at higher follicle numbers. Symptom-based variables such as skin darkening, hair growth, weight gain, and pimples also show visible differences between groups, confirming their strong correlation. Meanwhile, variables like cycle length, age, BMI, and endometrium thickness show more overlap, indicating weaker relationships with PCOS.


Linear regression model


Out of curiosity, lets do for fit for all variables

full.fit <- lm(PCOS..Y.N. ~ ., data = datafpc)
summary(full.fit)
## 
## Call:
## lm(formula = PCOS..Y.N. ~ ., data = datafpc)
## 
## Residuals:
## ALL 8 residuals are 0: no residual degrees of freedom!
## 
## Coefficients: (34 not defined because of singularities)
##                         Estimate Std. Error t value Pr(>|t|)
## (Intercept)            -16.69484        NaN     NaN      NaN
## Age..yrs.                0.09951        NaN     NaN      NaN
## Weight..Kg.              0.06982        NaN     NaN      NaN
## Height.Cm.               0.04971        NaN     NaN      NaN
## BMI                     -0.09451        NaN     NaN      NaN
## Blood.Group             -0.20527        NaN     NaN      NaN
## Pulse.rate.bpm.          0.07388        NaN     NaN      NaN
## RR..breaths.min.         0.12723        NaN     NaN      NaN
## Hb.g.dl.                      NA         NA      NA       NA
## Cycle.R.I.                    NA         NA      NA       NA
## Cycle.length.days.            NA         NA      NA       NA
## Marraige.Status..Yrs.         NA         NA      NA       NA
## Pregnant.Y.N.                 NA         NA      NA       NA
## No..of.aborptions             NA         NA      NA       NA
## I...beta.HCG.mIU.mL.          NA         NA      NA       NA
## II....beta.HCG.mIU.mL.        NA         NA      NA       NA
## FSH.mIU.mL.                   NA         NA      NA       NA
## LH.mIU.mL.                    NA         NA      NA       NA
## FSH.LH                        NA         NA      NA       NA
## Hip.inch.                     NA         NA      NA       NA
## Waist.inch.                   NA         NA      NA       NA
## Waist.Hip.Ratio               NA         NA      NA       NA
## TSH..mIU.L.                   NA         NA      NA       NA
## AMH.ng.mL.                    NA         NA      NA       NA
## PRL.ng.mL.                    NA         NA      NA       NA
## Vit.D3..ng.mL.                NA         NA      NA       NA
## PRG.ng.mL.                    NA         NA      NA       NA
## RBS.mg.dl.                    NA         NA      NA       NA
## Weight.gain.Y.N.              NA         NA      NA       NA
## hair.growth.Y.N.              NA         NA      NA       NA
## Skin.darkening..Y.N.          NA         NA      NA       NA
## Hair.loss.Y.N.                NA         NA      NA       NA
## Pimples.Y.N.                  NA         NA      NA       NA
## Fast.food..Y.N.               NA         NA      NA       NA
## Reg.Exercise.Y.N.             NA         NA      NA       NA
## BP._Systolic..mmHg.           NA         NA      NA       NA
## BP._Diastolic..mmHg.          NA         NA      NA       NA
## Follicle.No...L.              NA         NA      NA       NA
## Follicle.No...R.              NA         NA      NA       NA
## Avg..F.size..L...mm.          NA         NA      NA       NA
## Avg..F.size..R...mm.          NA         NA      NA       NA
## Endometrium..mm.              NA         NA      NA       NA
## 
## Residual standard error: NaN on 0 degrees of freedom
##   (533 observations deleted due to missingness)
## Multiple R-squared:      1,  Adjusted R-squared:    NaN 
## F-statistic:   NaN on 7 and 0 DF,  p-value: NA

Experiment with full model failed. The variable FSH.LH had a very large number of missing values (over 500), which made the model unstable and unreliable. Including it would have removed most of the dataset, leaving almost no usable cases. To avoid losing too many observations and to maintain model stability, the variable was eliminated from the analysis so the remaining predictors with minimal missing values can be used effectively.

lmdata1 <- datafpc1 %>% dplyr::select(
  PCOS..Y.N.,
  Follicle.No...R.,
  Follicle.No...L.,
  Skin.darkening..Y.N.,
  hair.growth.Y.N.,
  Weight.gain.Y.N.,
  Cycle.R.I.,
  Fast.food..Y.N.,
  Pimples.Y.N.,
  Weight..Kg.,
  Cycle.length.days.,
  Age..yrs.,
  Marraige.Status..Yrs.,
  Hair.loss.Y.N.,
  Waist.inch.,
  Hip.inch.,
  Avg..F.size..L...mm.,
  Endometrium..mm.,
  BMI
)

str(lmdata1)
## tibble [537 × 19] (S3: tbl_df/tbl/data.frame)
##  $ PCOS..Y.N.           : num [1:537] 0 0 1 0 0 0 0 0 0 0 ...
##  $ Follicle.No...R.     : num [1:537] 3 5 15 2 4 6 6 6 7 1 ...
##  $ Follicle.No...L.     : num [1:537] 3 3 13 2 3 9 6 7 5 1 ...
##  $ Skin.darkening..Y.N. : num [1:537] 0 0 0 0 0 0 0 0 0 0 ...
##  $ hair.growth.Y.N.     : num [1:537] 0 0 0 0 0 0 0 0 0 0 ...
##  $ Weight.gain.Y.N.     : num [1:537] 0 0 0 0 0 1 0 1 0 0 ...
##  $ Cycle.R.I.           : num [1:537] 2 2 2 2 2 2 2 2 2 4 ...
##  $ Fast.food..Y.N.      : num [1:537] 1 0 1 0 0 0 0 0 0 0 ...
##  $ Pimples.Y.N.         : num [1:537] 0 0 1 0 0 0 0 0 0 0 ...
##  $ Weight..Kg.          : num [1:537] 44.6 65 68.8 65 52 74.1 64 58.5 40 52 ...
##  $ Cycle.length.days.   : num [1:537] 5 5 5 5 5 5 5 5 5 2 ...
##  $ Age..yrs.            : num [1:537] 28 36 33 37 25 36 34 33 32 36 ...
##  $ Marraige.Status..Yrs.: num [1:537] 7 11 10 4 1 8 2 13 8 4 ...
##  $ Hair.loss.Y.N.       : num [1:537] 0 0 1 0 1 1 0 0 0 0 ...
##  $ Waist.inch.          : num [1:537] 30 32 36 36 30 38 33 38 35 38 ...
##  $ Hip.inch.            : num [1:537] 36 38 40 42 37 44 39 44 39 40 ...
##  $ Avg..F.size..L...mm. : num [1:537] 18 15 18 15 16 16 15 15 17 14 ...
##  $ Endometrium..mm.     : num [1:537] 8.5 3.7 10 7.5 7 8 6.8 7.1 4.2 2.5 ...
##  $ BMI                  : num [1:537] 19.3 25.3 29.7 20.1 27.2 ...
colSums(is.na(lmdata1))
##            PCOS..Y.N.      Follicle.No...R.      Follicle.No...L. 
##                     0                     0                     0 
##  Skin.darkening..Y.N.      hair.growth.Y.N.      Weight.gain.Y.N. 
##                     0                     0                     0 
##            Cycle.R.I.       Fast.food..Y.N.          Pimples.Y.N. 
##                     0                     0                     0 
##           Weight..Kg.    Cycle.length.days.             Age..yrs. 
##                     0                     0                     0 
## Marraige.Status..Yrs.        Hair.loss.Y.N.           Waist.inch. 
##                     0                     0                     0 
##             Hip.inch.  Avg..F.size..L...mm.      Endometrium..mm. 
##                     0                     0                     0 
##                   BMI 
##                     0

Lets refine the fit - with correlated variables

fitlm1 <- lm(PCOS..Y.N. ~ Follicle.No...R.+ Follicle.No...L.+ Skin.darkening..Y.N.+ hair.growth.Y.N.+ Weight.gain.Y.N.+ Cycle.R.I. + Fast.food..Y.N.+ Pimples.Y.N.+ Weight..Kg.+ Cycle.length.days.+ Age..yrs.+ Marraige.Status..Yrs.+ Hair.loss.Y.N.+ Waist.inch.+ Hip.inch.+ Avg..F.size..L...mm.+ Endometrium..mm.+ BMI, data = lmdata1)

summary(fitlm1)
## 
## Call:
## lm(formula = PCOS..Y.N. ~ Follicle.No...R. + Follicle.No...L. + 
##     Skin.darkening..Y.N. + hair.growth.Y.N. + Weight.gain.Y.N. + 
##     Cycle.R.I. + Fast.food..Y.N. + Pimples.Y.N. + Weight..Kg. + 
##     Cycle.length.days. + Age..yrs. + Marraige.Status..Yrs. + 
##     Hair.loss.Y.N. + Waist.inch. + Hip.inch. + Avg..F.size..L...mm. + 
##     Endometrium..mm. + BMI, data = lmdata1)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -0.90697 -0.19053 -0.01844  0.15617  1.11520 
## 
## Coefficients:
##                         Estimate Std. Error t value Pr(>|t|)    
## (Intercept)           -0.3103827  0.1906762  -1.628  0.10418    
## Follicle.No...R.       0.0390748  0.0049742   7.855 2.31e-14 ***
## Follicle.No...L.       0.0092374  0.0053498   1.727  0.08482 .  
## Skin.darkening..Y.N.   0.1548003  0.0323102   4.791 2.17e-06 ***
## hair.growth.Y.N.       0.1759079  0.0327024   5.379 1.14e-07 ***
## Weight.gain.Y.N.       0.1386346  0.0332616   4.168 3.60e-05 ***
## Cycle.R.I.             0.0678276  0.0156591   4.332 1.78e-05 ***
## Fast.food..Y.N.        0.0562879  0.0296444   1.899  0.05815 .  
## Pimples.Y.N.           0.0743631  0.0278442   2.671  0.00781 ** 
## Weight..Kg.           -0.0007074  0.0016355  -0.433  0.66554    
## Cycle.length.days.    -0.0137321  0.0089626  -1.532  0.12610    
## Age..yrs.             -0.0017169  0.0032431  -0.529  0.59674    
## Marraige.Status..Yrs. -0.0043357  0.0036420  -1.190  0.23441    
## Hair.loss.Y.N.         0.0095042  0.0280264   0.339  0.73466    
## Waist.inch.           -0.0060406  0.0078165  -0.773  0.43999    
## Hip.inch.              0.0079887  0.0071468   1.118  0.26417    
## Avg..F.size..L...mm.   0.0035281  0.0038083   0.926  0.35466    
## Endometrium..mm.       0.0034157  0.0060103   0.568  0.57007    
## BMI                   -0.0022312  0.0034793  -0.641  0.52163    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.2927 on 518 degrees of freedom
## Multiple R-squared:  0.6238, Adjusted R-squared:  0.6107 
## F-statistic: 47.72 on 18 and 518 DF,  p-value: < 2.2e-16

The regression results show that several variables are significantly associated with PCOS status. Follicle count (both right and left), skin darkening, hair growth, weight gain, cycle regularity, and pimples have strong positive effects and are statistically significant predictors. Lifestyle factors like fast-food intake show weaker influence, while age, BMI, waist and hip measurements, and endometrium thickness are not significant. Overall, the model explains about 63% of the variation in PCOS, indicating reasonably strong predictive power.The regression results show that several variables are significantly associated with PCOS status. Follicle count (both right and left), skin darkening, hair growth, weight gain, cycle regularity, and pimples have strong positive effects and are statistically significant predictors. Lifestyle factors like fast-food intake show weaker influence, while age, BMI, waist and hip measurements, and endometrium thickness are not significant. Overall, the model explains about ~62%(Multiple R-squared: 0.6256, Adjusted R-squared: 0.6126 ) of the variation in PCOS, indicating reasonably strong predictive power.

fitlm2 <- lm(PCOS..Y.N. ~ Follicle.No...R.+ Skin.darkening..Y.N.+ hair.growth.Y.N.+ Weight.gain.Y.N.+ Cycle.R.I. + Pimples.Y.N., data = lmdata1)

summary(fitlm2)
## 
## Call:
## lm(formula = PCOS..Y.N. ~ Follicle.No...R. + Skin.darkening..Y.N. + 
##     hair.growth.Y.N. + Weight.gain.Y.N. + Cycle.R.I. + Pimples.Y.N., 
##     data = lmdata1)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -0.88850 -0.18731 -0.01133  0.14140  1.18629 
## 
## Coefficients:
##                       Estimate Std. Error t value Pr(>|t|)    
## (Intercept)          -0.389975   0.040485  -9.633  < 2e-16 ***
## Follicle.No...R.      0.047912   0.003147  15.223  < 2e-16 ***
## Skin.darkening..Y.N.  0.168703   0.031603   5.338 1.39e-07 ***
## hair.growth.Y.N.      0.187405   0.032100   5.838 9.21e-09 ***
## Weight.gain.Y.N.      0.149708   0.029497   5.075 5.36e-07 ***
## Cycle.R.I.            0.077887   0.015235   5.112 4.45e-07 ***
## Pimples.Y.N.          0.080149   0.026650   3.007  0.00276 ** 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.2943 on 530 degrees of freedom
## Multiple R-squared:  0.6109, Adjusted R-squared:  0.6065 
## F-statistic: 138.7 on 6 and 530 DF,  p-value: < 2.2e-16

The reduced regression model(considered as Model1) shows that follicle counts, skin darkening, hair growth, weight gain, cycle regularity, and pimples are strong and significant predictors of PCOS. These symptoms and ovarian measurements consistently contribute to increased PCOS likelihood. The model explains about ~61%(Multiple R-squared: 0.6148, Adjusted R-squared: 0.6097) of the variation, indicating solid predictive strength with fewer variables.

fitlm2_poly<- lm( PCOS..Y.N. ~  poly(Follicle.No...R., 2) + poly(Cycle.R.I., 2) + Skin.darkening..Y.N. + hair.growth.Y.N. +                                  Weight.gain.Y.N. + Pimples.Y.N., data = lmdata1)

summary(fitlm2_poly)
## 
## Call:
## lm(formula = PCOS..Y.N. ~ poly(Follicle.No...R., 2) + poly(Cycle.R.I., 
##     2) + Skin.darkening..Y.N. + hair.growth.Y.N. + Weight.gain.Y.N. + 
##     Pimples.Y.N., data = lmdata1)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -0.89926 -0.18610 -0.02057  0.13155  1.17347 
## 
## Coefficients:
##                            Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                 0.12573    0.02112   5.954 4.78e-09 ***
## poly(Follicle.No...R., 2)1  4.92459    0.32415  15.192  < 2e-16 ***
## poly(Follicle.No...R., 2)2  0.24631    0.29634   0.831  0.40625    
## poly(Cycle.R.I., 2)1        1.62450    0.31788   5.110 4.50e-07 ***
## poly(Cycle.R.I., 2)2        0.17978    0.29678   0.606  0.54493    
## Skin.darkening..Y.N.        0.16735    0.03168   5.283 1.86e-07 ***
## hair.growth.Y.N.            0.18576    0.03218   5.773 1.33e-08 ***
## Weight.gain.Y.N.            0.15212    0.02964   5.132 4.04e-07 ***
## Pimples.Y.N.                0.08277    0.02680   3.088  0.00212 ** 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.2946 on 528 degrees of freedom
## Multiple R-squared:  0.6117, Adjusted R-squared:  0.6058 
## F-statistic:   104 on 8 and 528 DF,  p-value: < 2.2e-16

The polynomial model with degree-2(considered as Model2) terms for follicle count and cycle ratio performs well, showing strong significance for key predictors such as skin darkening, hair growth, weight gain, and pimples. With an R² of 0.613 (Multiple R-squared: 0.6133, Adjusted R-squared: 0.6075) and low residual error, the model captures meaningful nonlinear effects and improves prediction accuracy compared to the linear version.

fitlm2_poly1<- lm( PCOS..Y.N. ~ poly(Follicle.No...R., 3) + Cycle.R.I. + Skin.darkening..Y.N. + hair.growth.Y.N. +                                              Weight.gain.Y.N. + Pimples.Y.N., data = lmdata1)

summary(fitlm2_poly1)
## 
## Call:
## lm(formula = PCOS..Y.N. ~ poly(Follicle.No...R., 3) + Cycle.R.I. + 
##     Skin.darkening..Y.N. + hair.growth.Y.N. + Weight.gain.Y.N. + 
##     Pimples.Y.N., data = lmdata1)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -0.95318 -0.15781 -0.02568  0.11930  1.09499 
## 
## Coefficients:
##                            Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                -0.06243    0.03971  -1.572 0.116519    
## poly(Follicle.No...R., 3)1  4.99249    0.31530  15.834  < 2e-16 ***
## poly(Follicle.No...R., 3)2  0.24778    0.28776   0.861 0.389598    
## poly(Follicle.No...R., 3)3 -1.62044    0.28994  -5.589 3.67e-08 ***
## Cycle.R.I.                  0.07427    0.01484   5.005 7.60e-07 ***
## Skin.darkening..Y.N.        0.15070    0.03091   4.875 1.44e-06 ***
## hair.growth.Y.N.            0.18535    0.03125   5.932 5.42e-09 ***
## Weight.gain.Y.N.            0.14538    0.02874   5.059 5.84e-07 ***
## Pimples.Y.N.                0.09501    0.02612   3.638 0.000302 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.2863 on 528 degrees of freedom
## Multiple R-squared:  0.6331, Adjusted R-squared:  0.6275 
## F-statistic: 113.9 on 8 and 528 DF,  p-value: < 2.2e-16

The degree-3 polynomial model(considered as Model3) improves predictive strength, achieving an R² of 0.634(Multiple R-squared: 0.6348, Adjusted R-squared: 0.6293) with strong significance for follicle count, cycle ratio, skin darkening, hair growth, weight gain, and pimples. The cubic follicle term captures meaningful non-linear effects, lowering residual error and offering a more flexible, accurate representation of PCOS-related patterns.

lmmodel_compare <- data.frame(
  Model = c("Linear Model", "Poly Model (deg 2)", "Poly Model (deg 3)"),
  R2 = c(summary(fitlm2)$r.squared,
         summary(fitlm2_poly)$r.squared,
         summary(fitlm2_poly1)$r.squared),
  Adj_R2 = c(summary(fitlm2)$adj.r.squared,
             summary(fitlm2_poly)$adj.r.squared,
             summary(fitlm2_poly1)$adj.r.squared),
  AIC = c(AIC(fitlm2), AIC(fitlm2_poly), AIC(fitlm2_poly1)),
  BIC = c(BIC(fitlm2), BIC(fitlm2_poly), BIC(fitlm2_poly1)),
  RMSE = c( sigma(fitlm2), sigma(fitlm2_poly), sigma(fitlm2_poly1))
)

print(lmmodel_compare)
##                Model        R2    Adj_R2      AIC      BIC      RMSE
## 1       Linear Model 0.6109056 0.6065007 219.1889 253.4769 0.2942902
## 2 Poly Model (deg 2) 0.6116521 0.6057680 222.1576 265.0176 0.2945640
## 3 Poly Model (deg 3) 0.6330875 0.6275282 191.6677 234.5277 0.2863192
View(lmmodel_compare)
par(mfrow = c(2,2))
plot(fitlm2, main="Linear Model Diagnostics")

par(mfrow = c(2,2))
plot(fitlm2_poly, main="Poly Model (deg 2) Diagnostics")

par(mfrow = c(2,2))
plot(fitlm2_poly1, main="Poly Model (deg 3) Diagnostics")

par(mfrow=c(1,1))


#Assessing Linearity
crPlots(fitlm2)

crPlots(fitlm2_poly)

crPlots(fitlm2_poly1)

## Assessing homoscedasticity

ncvTest(fitlm2) #Non-constant Variance Score Test
## Non-constant Variance Score Test 
## Variance formula: ~ fitted.values 
## Chisquare = 17.53861, Df = 1, p = 2.8153e-05
par(mfrow=c(1,1))
spreadLevelPlot(fitlm2)

## 
## Suggested power transformation:  0.2525859
ncvTest(fitlm2_poly) #Non-constant Variance Score Test
## Non-constant Variance Score Test 
## Variance formula: ~ fitted.values 
## Chisquare = 21.04492, Df = 1, p = 4.4864e-06
par(mfrow=c(1,1))
spreadLevelPlot(fitlm2_poly)

## 
## Suggested power transformation:  0.4262552
ncvTest(fitlm2_poly1) #Non-constant Variance Score Test
## Non-constant Variance Score Test 
## Variance formula: ~ fitted.values 
## Chisquare = 23.03867, Df = 1, p = 1.5878e-06
par(mfrow=c(1,1))
spreadLevelPlot(fitlm2_poly1)

## 
## Suggested power transformation:  0.28719
# Global test of linear model assumptions

gvmodel <- gvlma(fitlm2) #Global Validation of Linear Models Assumptions
summary(gvmodel)
## 
## Call:
## lm(formula = PCOS..Y.N. ~ Follicle.No...R. + Skin.darkening..Y.N. + 
##     hair.growth.Y.N. + Weight.gain.Y.N. + Cycle.R.I. + Pimples.Y.N., 
##     data = lmdata1)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -0.88850 -0.18731 -0.01133  0.14140  1.18629 
## 
## Coefficients:
##                       Estimate Std. Error t value Pr(>|t|)    
## (Intercept)          -0.389975   0.040485  -9.633  < 2e-16 ***
## Follicle.No...R.      0.047912   0.003147  15.223  < 2e-16 ***
## Skin.darkening..Y.N.  0.168703   0.031603   5.338 1.39e-07 ***
## hair.growth.Y.N.      0.187405   0.032100   5.838 9.21e-09 ***
## Weight.gain.Y.N.      0.149708   0.029497   5.075 5.36e-07 ***
## Cycle.R.I.            0.077887   0.015235   5.112 4.45e-07 ***
## Pimples.Y.N.          0.080149   0.026650   3.007  0.00276 ** 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.2943 on 530 degrees of freedom
## Multiple R-squared:  0.6109, Adjusted R-squared:  0.6065 
## F-statistic: 138.7 on 6 and 530 DF,  p-value: < 2.2e-16
## 
## 
## ASSESSMENT OF THE LINEAR MODEL ASSUMPTIONS
## USING THE GLOBAL TEST ON 4 DEGREES-OF-FREEDOM:
## Level of Significance =  0.05 
## 
## Call:
##  gvlma(x = fitlm2) 
## 
##                     Value   p-value                   Decision
## Global Stat        38.211 1.013e-07 Assumptions NOT satisfied!
## Skewness           18.989 1.315e-05 Assumptions NOT satisfied!
## Kurtosis           11.182 8.260e-04 Assumptions NOT satisfied!
## Link Function       1.483 2.233e-01    Assumptions acceptable.
## Heteroscedasticity  6.558 1.044e-02 Assumptions NOT satisfied!
gvmodel1 <- gvlma(fitlm2_poly) #Global Validation of Linear Models Assumptions
summary(gvmodel1)
## 
## Call:
## lm(formula = PCOS..Y.N. ~ poly(Follicle.No...R., 2) + poly(Cycle.R.I., 
##     2) + Skin.darkening..Y.N. + hair.growth.Y.N. + Weight.gain.Y.N. + 
##     Pimples.Y.N., data = lmdata1)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -0.89926 -0.18610 -0.02057  0.13155  1.17347 
## 
## Coefficients:
##                            Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                 0.12573    0.02112   5.954 4.78e-09 ***
## poly(Follicle.No...R., 2)1  4.92459    0.32415  15.192  < 2e-16 ***
## poly(Follicle.No...R., 2)2  0.24631    0.29634   0.831  0.40625    
## poly(Cycle.R.I., 2)1        1.62450    0.31788   5.110 4.50e-07 ***
## poly(Cycle.R.I., 2)2        0.17978    0.29678   0.606  0.54493    
## Skin.darkening..Y.N.        0.16735    0.03168   5.283 1.86e-07 ***
## hair.growth.Y.N.            0.18576    0.03218   5.773 1.33e-08 ***
## Weight.gain.Y.N.            0.15212    0.02964   5.132 4.04e-07 ***
## Pimples.Y.N.                0.08277    0.02680   3.088  0.00212 ** 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.2946 on 528 degrees of freedom
## Multiple R-squared:  0.6117, Adjusted R-squared:  0.6058 
## F-statistic:   104 on 8 and 528 DF,  p-value: < 2.2e-16
## 
## 
## ASSESSMENT OF THE LINEAR MODEL ASSUMPTIONS
## USING THE GLOBAL TEST ON 4 DEGREES-OF-FREEDOM:
## Level of Significance =  0.05 
## 
## Call:
##  gvlma(x = fitlm2_poly) 
## 
##                       Value   p-value                   Decision
## Global Stat        37.14416 1.682e-07 Assumptions NOT satisfied!
## Skewness           20.26029 6.759e-06 Assumptions NOT satisfied!
## Kurtosis           10.91785 9.524e-04 Assumptions NOT satisfied!
## Link Function       0.05843 8.090e-01    Assumptions acceptable.
## Heteroscedasticity  5.90759 1.508e-02 Assumptions NOT satisfied!
gvmodel2 <- gvlma(fitlm2_poly1) #Global Validation of Linear Models Assumptions
summary(gvmodel2)
## 
## Call:
## lm(formula = PCOS..Y.N. ~ poly(Follicle.No...R., 3) + Cycle.R.I. + 
##     Skin.darkening..Y.N. + hair.growth.Y.N. + Weight.gain.Y.N. + 
##     Pimples.Y.N., data = lmdata1)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -0.95318 -0.15781 -0.02568  0.11930  1.09499 
## 
## Coefficients:
##                            Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                -0.06243    0.03971  -1.572 0.116519    
## poly(Follicle.No...R., 3)1  4.99249    0.31530  15.834  < 2e-16 ***
## poly(Follicle.No...R., 3)2  0.24778    0.28776   0.861 0.389598    
## poly(Follicle.No...R., 3)3 -1.62044    0.28994  -5.589 3.67e-08 ***
## Cycle.R.I.                  0.07427    0.01484   5.005 7.60e-07 ***
## Skin.darkening..Y.N.        0.15070    0.03091   4.875 1.44e-06 ***
## hair.growth.Y.N.            0.18535    0.03125   5.932 5.42e-09 ***
## Weight.gain.Y.N.            0.14538    0.02874   5.059 5.84e-07 ***
## Pimples.Y.N.                0.09501    0.02612   3.638 0.000302 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.2863 on 528 degrees of freedom
## Multiple R-squared:  0.6331, Adjusted R-squared:  0.6275 
## F-statistic: 113.9 on 8 and 528 DF,  p-value: < 2.2e-16
## 
## 
## ASSESSMENT OF THE LINEAR MODEL ASSUMPTIONS
## USING THE GLOBAL TEST ON 4 DEGREES-OF-FREEDOM:
## Level of Significance =  0.05 
## 
## Call:
##  gvlma(x = fitlm2_poly1) 
## 
##                        Value   p-value                   Decision
## Global Stat        44.459963 5.149e-09 Assumptions NOT satisfied!
## Skewness           19.139275 1.215e-05 Assumptions NOT satisfied!
## Kurtosis           21.500547 3.537e-06 Assumptions NOT satisfied!
## Link Function       0.006779 9.344e-01    Assumptions acceptable.
## Heteroscedasticity  3.813361 5.085e-02    Assumptions acceptable.
# Evaluating multi-collinearity

vif(fitlm2) #Variance Inflation Factor
##     Follicle.No...R. Skin.darkening..Y.N.     hair.growth.Y.N. 
##             1.210653             1.313646             1.270204 
##     Weight.gain.Y.N.           Cycle.R.I.         Pimples.Y.N. 
##             1.268476             1.164521             1.100645
sqrt(vif(fitlm2)) > 2
##     Follicle.No...R. Skin.darkening..Y.N.     hair.growth.Y.N. 
##                FALSE                FALSE                FALSE 
##     Weight.gain.Y.N.           Cycle.R.I.         Pimples.Y.N. 
##                FALSE                FALSE                FALSE
vif(fitlm2_poly) #Variance Inflation Factor
##                               GVIF Df GVIF^(1/(2*Df))
## poly(Follicle.No...R., 2) 1.225286  2        1.052106
## poly(Cycle.R.I., 2)       1.182163  2        1.042724
## Skin.darkening..Y.N.      1.317577  1        1.147857
## hair.growth.Y.N.          1.273844  1        1.128647
## Weight.gain.Y.N.          1.278761  1        1.130823
## Pimples.Y.N.              1.111113  1        1.054094
sqrt(vif(fitlm2_poly)) > 2
##                            GVIF    Df GVIF^(1/(2*Df))
## poly(Follicle.No...R., 2) FALSE FALSE           FALSE
## poly(Cycle.R.I., 2)       FALSE FALSE           FALSE
## Skin.darkening..Y.N.      FALSE FALSE           FALSE
## hair.growth.Y.N.          FALSE FALSE           FALSE
## Weight.gain.Y.N.          FALSE FALSE           FALSE
## Pimples.Y.N.              FALSE FALSE           FALSE
vif(fitlm2_poly1) #Variance Inflation Factor
##                               GVIF Df GVIF^(1/(2*Df))
## poly(Follicle.No...R., 3) 1.254005  3        1.038444
## Cycle.R.I.                1.166844  1        1.080206
## Skin.darkening..Y.N.      1.327766  1        1.152287
## hair.growth.Y.N.          1.271429  1        1.127577
## Weight.gain.Y.N.          1.272048  1        1.127851
## Pimples.Y.N.              1.116738  1        1.056758
sqrt(vif(fitlm2_poly1)) > 2
##                            GVIF    Df GVIF^(1/(2*Df))
## poly(Follicle.No...R., 3) FALSE FALSE           FALSE
## Cycle.R.I.                FALSE FALSE           FALSE
## Skin.darkening..Y.N.      FALSE FALSE           FALSE
## hair.growth.Y.N.          FALSE FALSE           FALSE
## Weight.gain.Y.N.          FALSE FALSE           FALSE
## Pimples.Y.N.              FALSE FALSE           FALSE

All three models show similar diagnostic patterns. Residuals are roughly linear but display curved spread, suggesting some non-linearity remains. Q-Q plots show mild deviation at the tails. Leverage plots reveal a few influential points. Polynomial models reduce curvature slightly, but no major improvement appears, indicating limited added benefit from higher-degree terms.

plot_data <- lmmodel_compare[, c("Model", "R2", "Adj_R2", "RMSE")]

plot_data_long <- plot_data %>%
  pivot_longer(cols = c("R2", "Adj_R2", "RMSE"), names_to = "Metric", values_to = "Value")

ggplot(plot_data_long, aes(x = Model, y = Value, fill = Metric)) +
  geom_bar(stat = "identity", position = "dodge") +
  labs(title = "Model Performance Comparison",
       x = "Model",
       y = "Value",
       fill = "Metric")

Among the three models, the polynomial models outperform the simple linear model. Both polynomial models (degree 2 and degree 3) achieve slightly higher R² and adjusted R² values, indicating better explanatory power. The degree-3 polynomial model performs the best overall, with the highest R² and the lowest RMSE, suggesting it predicts PCOS outcomes more accurately while maintaining model stability.

the maximum explained variation is around 63%, achieved by the polynomial degree-3 model.

Partition data for linear regression validation

set.seed(2)
train.index <- sample(c(1:dim(lmdata1)[1]), dim(lmdata1)[1]*0.7)  
train.df <- lmdata1[train.index, ]
valid.df <- lmdata1[-train.index, ]

Linear regression model - training and validation datasets


# Fit the model on training set - using the existing best model (Polynomial degree-3)

fitlm2_poly1 <- lm(
  PCOS..Y.N. ~ poly(Follicle.No...R., 3) +
    Cycle.R.I. +
    Skin.darkening..Y.N. +
    hair.growth.Y.N. +
    Weight.gain.Y.N. +
    Pimples.Y.N.,
  data = train.df
)

summary(fitlm2_poly1)
## 
## Call:
## lm(formula = PCOS..Y.N. ~ poly(Follicle.No...R., 3) + Cycle.R.I. + 
##     Skin.darkening..Y.N. + hair.growth.Y.N. + Weight.gain.Y.N. + 
##     Pimples.Y.N., data = train.df)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -0.91249 -0.16750 -0.01761  0.11767  0.98953 
## 
## Coefficients:
##                            Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                -0.06742    0.04764  -1.415  0.15789    
## poly(Follicle.No...R., 3)1  3.91027    0.32124  12.172  < 2e-16 ***
## poly(Follicle.No...R., 3)2  0.22866    0.29033   0.788  0.43143    
## poly(Follicle.No...R., 3)3 -1.43971    0.29136  -4.941 1.18e-06 ***
## Cycle.R.I.                  0.07310    0.01802   4.056 6.10e-05 ***
## Skin.darkening..Y.N.        0.15048    0.03719   4.047 6.34e-05 ***
## hair.growth.Y.N.            0.20183    0.03740   5.397 1.22e-07 ***
## Weight.gain.Y.N.            0.16739    0.03495   4.789 2.44e-06 ***
## Pimples.Y.N.                0.09623    0.03175   3.031  0.00261 ** 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.2878 on 366 degrees of freedom
## Multiple R-squared:  0.6347, Adjusted R-squared:  0.6267 
## F-statistic:  79.5 on 8 and 366 DF,  p-value: < 2.2e-16
# Predict on validation set

valid.df$Predicted <- predict(fitlm2_poly1, newdata = valid.df)


# Create Actual vs Predicted Table

results <- data.frame(
  Actual = valid.df$PCOS..Y.N.,
  Predicted = valid.df$Predicted
)

head(results)
##   Actual   Predicted
## 1      0 -0.07492476
## 2      0 -0.10887739
## 3      0  0.06043091
## 4      0  0.01047302
## 5      0  0.04313710
## 6      0 -0.11766885
# RMSE
RMSE <- sqrt(mean((results$Actual - results$Predicted)^2))

# MAE
MAE <- mean(abs(results$Actual - results$Predicted))

# R-squared (manual)
SSE <- sum((results$Actual - results$Predicted)^2)
SST <- sum((results$Actual - mean(results$Actual))^2)
R2_valid <- 1 - SSE/SST

RMSE; MAE; R2_valid
## [1] 0.2856368
## [1] 0.2080706
## [1] 0.6217618
# Convert predicted values to 0/1 using threshold = 0.5
valid.df$Pred_Class <- ifelse(valid.df$Predicted >= 0.5, 1, 0)

# Confusion Matrix
table(Predicted = valid.df$Pred_Class, Actual = valid.df$PCOS..Y.N.)
##          Actual
## Predicted   0   1
##         0 106  13
##         1   5  38
confusionMatrix(
  factor(valid.df$Pred_Class),
  factor(valid.df$PCOS..Y.N.),
  positive = "1"
)
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction   0   1
##          0 106  13
##          1   5  38
##                                           
##                Accuracy : 0.8889          
##                  95% CI : (0.8301, 0.9328)
##     No Information Rate : 0.6852          
##     P-Value [Acc > NIR] : 9.859e-10       
##                                           
##                   Kappa : 0.731           
##                                           
##  Mcnemar's Test P-Value : 0.09896         
##                                           
##             Sensitivity : 0.7451          
##             Specificity : 0.9550          
##          Pos Pred Value : 0.8837          
##          Neg Pred Value : 0.8908          
##              Prevalence : 0.3148          
##          Detection Rate : 0.2346          
##    Detection Prevalence : 0.2654          
##       Balanced Accuracy : 0.8500          
##                                           
##        'Positive' Class : 1               
## 
roc_obj <- roc(valid.df$PCOS..Y.N., valid.df$Predicted)
## Setting levels: control = 0, case = 1
## Setting direction: controls < cases
# Plot ROC Curve
plot(roc_obj, col = "blue", main = "ROC Curve for Polynomial Model (deg 3)")

auc_value <- auc(roc_obj)
auc_value
## Area under the curve: 0.9559

Partition data for linear regression validation

set.seed(3)
train.index <- sample(c(1:dim(datafpc1)[1]), dim(datafpc1)[1]*0.7)  
train.df1 <- datafpc1[train.index, ]
valid.df1 <- datafpc1[-train.index, ]

Logistic regression model


set.seed(31)
# Logistic regression with the same predictors as your poly linear model
logit.pcosfull <- glm( PCOS..Y.N. ~ . , data   = train.df1, family = "binomial" )
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
summary(logit.pcosfull)
## 
## Call:
## glm(formula = PCOS..Y.N. ~ ., family = "binomial", data = train.df1)
## 
## Coefficients:
##                          Estimate Std. Error z value Pr(>|z|)    
## (Intercept)            -3.065e+01  1.993e+01  -1.538 0.124115    
## Age..yrs.               4.157e-02  8.537e-02   0.487 0.626254    
## Weight..Kg.            -5.987e-03  5.866e-02  -0.102 0.918704    
## Height.Cm.             -3.187e-02  7.097e-02  -0.449 0.653357    
## BMI                    -5.641e-02  9.677e-02  -0.583 0.559929    
## Blood.Group             2.230e-01  2.136e-01   1.044 0.296422    
## Pulse.rate.bpm.         3.112e-01  1.579e-01   1.971 0.048686 *  
## RR..breaths.min.       -1.715e-01  2.449e-01  -0.700 0.483797    
## Hb.g.dl.                3.369e-01  5.014e-01   0.672 0.501640    
## Cycle.R.I.              5.506e-01  4.057e-01   1.357 0.174754    
## Cycle.length.days.      4.025e-02  2.156e-01   0.187 0.851908    
## Marraige.Status..Yrs.  -1.885e-01  1.110e-01  -1.698 0.089552 .  
## Pregnant.Y.N.          -7.242e-01  6.904e-01  -1.049 0.294188    
## No..of.aborptions      -9.436e-01  6.475e-01  -1.457 0.145080    
## I...beta.HCG.mIU.mL.    1.091e-04  7.333e-05   1.488 0.136665    
## II....beta.HCG.mIU.mL. -2.405e-05  1.437e-04  -0.167 0.867104    
## FSH.mIU.mL.            -7.718e-02  1.932e-01  -0.400 0.689523    
## LH.mIU.mL.              3.835e-01  1.657e-01   2.314 0.020656 *  
## Hip.inch.              -6.557e-02  2.545e-01  -0.258 0.796641    
## Waist.inch.             1.237e-01  2.544e-01   0.486 0.626934    
## TSH..mIU.L.             1.829e-01  1.040e-01   1.759 0.078614 .  
## AMH.ng.mL.              3.898e-02  5.040e-02   0.773 0.439243    
## PRL.ng.mL.              3.203e-02  2.691e-02   1.190 0.233911    
## Vit.D3..ng.mL.          7.831e-04  2.988e-03   0.262 0.793242    
## PRG.ng.mL.             -3.174e-01  7.940e-01  -0.400 0.689359    
## RBS.mg.dl.              4.926e-02  2.524e-02   1.951 0.051007 .  
## Weight.gain.Y.N.        3.901e+00  1.009e+00   3.867 0.000110 ***
## hair.growth.Y.N.        2.975e+00  8.620e-01   3.452 0.000557 ***
## Skin.darkening..Y.N.    1.454e+00  7.300e-01   1.992 0.046342 *  
## Hair.loss.Y.N.          9.407e-01  7.819e-01   1.203 0.228964    
## Pimples.Y.N.            1.582e+00  7.539e-01   2.098 0.035886 *  
## Fast.food..Y.N.         9.153e-01  7.137e-01   1.282 0.199671    
## Reg.Exercise.Y.N.       8.420e-01  8.993e-01   0.936 0.349105    
## BP._Systolic..mmHg.    -7.871e-02  6.050e-02  -1.301 0.193302    
## BP._Diastolic..mmHg.   -9.153e-02  7.511e-02  -1.219 0.222946    
## Follicle.No...L.        1.434e-01  1.425e-01   1.007 0.314038    
## Follicle.No...R.        9.557e-01  1.992e-01   4.799  1.6e-06 ***
## Avg..F.size..L...mm.    1.225e-01  1.481e-01   0.827 0.408208    
## Avg..F.size..R...mm.   -6.275e-02  1.518e-01  -0.413 0.679401    
## Endometrium..mm.        1.173e-01  1.469e-01   0.798 0.424820    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 463.925  on 374  degrees of freedom
## Residual deviance:  92.783  on 335  degrees of freedom
## AIC: 172.78
## 
## Number of Fisher Scoring iterations: 10

logistic regression failed because i tried to include too many variables at once, and many of them are highly correlated or have many repeated levels. This caused the model to break, resulting in warnings like “did not converge” and “coefficients not defined.”

In simple words, the model became confused because the predictors overlapped too much or perfectly separated the PCOS groups.

To fix this, i have to address unnecessary variables, avoid using hormone columns with too many categories, and find the right selection to choose only the meaningful predictors. This will make the model stable and able to run normally.

may i should use stepwise logistic regression (both directions: forward + backward) to automatically choose the best predictors without breaking the model.

library(MASS)
## 
## Attaching package: 'MASS'
## The following object is masked from 'package:dplyr':
## 
##     select
logit.step <- stepAIC(
  logit.pcosfull,
  direction = "both",
  trace = TRUE
)
## Start:  AIC=172.78
## PCOS..Y.N. ~ Age..yrs. + Weight..Kg. + Height.Cm. + BMI + Blood.Group + 
##     Pulse.rate.bpm. + RR..breaths.min. + Hb.g.dl. + Cycle.R.I. + 
##     Cycle.length.days. + Marraige.Status..Yrs. + Pregnant.Y.N. + 
##     No..of.aborptions + I...beta.HCG.mIU.mL. + II....beta.HCG.mIU.mL. + 
##     FSH.mIU.mL. + LH.mIU.mL. + Hip.inch. + Waist.inch. + TSH..mIU.L. + 
##     AMH.ng.mL. + PRL.ng.mL. + Vit.D3..ng.mL. + PRG.ng.mL. + RBS.mg.dl. + 
##     Weight.gain.Y.N. + hair.growth.Y.N. + Skin.darkening..Y.N. + 
##     Hair.loss.Y.N. + Pimples.Y.N. + Fast.food..Y.N. + Reg.Exercise.Y.N. + 
##     BP._Systolic..mmHg. + BP._Diastolic..mmHg. + Follicle.No...L. + 
##     Follicle.No...R. + Avg..F.size..L...mm. + Avg..F.size..R...mm. + 
##     Endometrium..mm.
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
##                          Df Deviance    AIC
## - Weight..Kg.             1   92.794 170.79
## - II....beta.HCG.mIU.mL.  1   92.811 170.81
## - Cycle.length.days.      1   92.818 170.82
## - Hip.inch.               1   92.850 170.85
## - Avg..F.size..R...mm.    1   92.957 170.96
## - FSH.mIU.mL.             1   92.965 170.97
## - Height.Cm.              1   92.985 170.99
## - Vit.D3..ng.mL.          1   93.005 171.00
## - Age..yrs.               1   93.021 171.02
## - Waist.inch.             1   93.025 171.03
## - BMI                     1   93.130 171.13
## - Hb.g.dl.                1   93.227 171.23
## - RR..breaths.min.        1   93.311 171.31
## - Endometrium..mm.        1   93.422 171.42
## - Avg..F.size..L...mm.    1   93.492 171.49
## - AMH.ng.mL.              1   93.517 171.52
## - Reg.Exercise.Y.N.       1   93.671 171.67
## - Follicle.No...L.        1   93.823 171.82
## - Pregnant.Y.N.           1   93.912 171.91
## - Blood.Group             1   93.916 171.92
## - PRL.ng.mL.              1   94.205 172.21
## - BP._Diastolic..mmHg.    1   94.292 172.29
## - Hair.loss.Y.N.          1   94.310 172.31
## - Fast.food..Y.N.         1   94.470 172.47
## - PRG.ng.mL.              1   94.567 172.57
## - BP._Systolic..mmHg.     1   94.590 172.59
## - Cycle.R.I.              1   94.725 172.72
## <none>                        92.783 172.78
## - I...beta.HCG.mIU.mL.    1   94.846 172.85
## - TSH..mIU.L.             1   95.406 173.41
## - No..of.aborptions       1   95.649 173.65
## - Marraige.Status..Yrs.   1   95.886 173.89
## - RBS.mg.dl.              1   96.903 174.90
## - Skin.darkening..Y.N.    1   96.916 174.92
## - Pulse.rate.bpm.         1   97.012 175.01
## - Pimples.Y.N.            1   97.823 175.82
## - LH.mIU.mL.              1  106.876 184.88
## - hair.growth.Y.N.        1  107.757 185.76
## - Weight.gain.Y.N.        1  115.799 193.80
## - Follicle.No...R.        1  159.300 237.30
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## 
## Step:  AIC=170.79
## PCOS..Y.N. ~ Age..yrs. + Height.Cm. + BMI + Blood.Group + Pulse.rate.bpm. + 
##     RR..breaths.min. + Hb.g.dl. + Cycle.R.I. + Cycle.length.days. + 
##     Marraige.Status..Yrs. + Pregnant.Y.N. + No..of.aborptions + 
##     I...beta.HCG.mIU.mL. + II....beta.HCG.mIU.mL. + FSH.mIU.mL. + 
##     LH.mIU.mL. + Hip.inch. + Waist.inch. + TSH..mIU.L. + AMH.ng.mL. + 
##     PRL.ng.mL. + Vit.D3..ng.mL. + PRG.ng.mL. + RBS.mg.dl. + Weight.gain.Y.N. + 
##     hair.growth.Y.N. + Skin.darkening..Y.N. + Hair.loss.Y.N. + 
##     Pimples.Y.N. + Fast.food..Y.N. + Reg.Exercise.Y.N. + BP._Systolic..mmHg. + 
##     BP._Diastolic..mmHg. + Follicle.No...L. + Follicle.No...R. + 
##     Avg..F.size..L...mm. + Avg..F.size..R...mm. + Endometrium..mm.
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
##                          Df Deviance    AIC
## - II....beta.HCG.mIU.mL.  1   92.822 168.82
## - Cycle.length.days.      1   92.832 168.83
## - Hip.inch.               1   92.891 168.89
## - Avg..F.size..R...mm.    1   92.964 168.96
## - FSH.mIU.mL.             1   92.975 168.97
## - Vit.D3..ng.mL.          1   93.016 169.02
## - Waist.inch.             1   93.040 169.04
## - Age..yrs.               1   93.043 169.04
## - Height.Cm.              1   93.168 169.17
## - Hb.g.dl.                1   93.231 169.23
## - BMI                     1   93.237 169.24
## - RR..breaths.min.        1   93.314 169.31
## - Endometrium..mm.        1   93.422 169.42
## - Avg..F.size..L...mm.    1   93.495 169.50
## - AMH.ng.mL.              1   93.517 169.52
## - Reg.Exercise.Y.N.       1   93.696 169.70
## - Follicle.No...L.        1   93.866 169.87
## - Pregnant.Y.N.           1   93.913 169.91
## - Blood.Group             1   93.917 169.92
## - PRL.ng.mL.              1   94.243 170.24
## - Hair.loss.Y.N.          1   94.354 170.35
## - BP._Diastolic..mmHg.    1   94.391 170.39
## - Fast.food..Y.N.         1   94.472 170.47
## - BP._Systolic..mmHg.     1   94.602 170.60
## - PRG.ng.mL.              1   94.603 170.60
## - Cycle.R.I.              1   94.730 170.73
## <none>                        92.794 170.79
## - I...beta.HCG.mIU.mL.    1   94.854 170.85
## - TSH..mIU.L.             1   95.419 171.42
## - No..of.aborptions       1   95.720 171.72
## - Marraige.Status..Yrs.   1   95.923 171.92
## + Weight..Kg.             1   92.783 172.78
## - RBS.mg.dl.              1   96.912 172.91
## - Pulse.rate.bpm.         1   97.013 173.01
## - Skin.darkening..Y.N.    1   97.121 173.12
## - Pimples.Y.N.            1   97.890 173.89
## - LH.mIU.mL.              1  106.954 182.95
## - hair.growth.Y.N.        1  107.844 183.84
## - Weight.gain.Y.N.        1  116.102 192.10
## - Follicle.No...R.        1  160.079 236.08
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## 
## Step:  AIC=168.82
## PCOS..Y.N. ~ Age..yrs. + Height.Cm. + BMI + Blood.Group + Pulse.rate.bpm. + 
##     RR..breaths.min. + Hb.g.dl. + Cycle.R.I. + Cycle.length.days. + 
##     Marraige.Status..Yrs. + Pregnant.Y.N. + No..of.aborptions + 
##     I...beta.HCG.mIU.mL. + FSH.mIU.mL. + LH.mIU.mL. + Hip.inch. + 
##     Waist.inch. + TSH..mIU.L. + AMH.ng.mL. + PRL.ng.mL. + Vit.D3..ng.mL. + 
##     PRG.ng.mL. + RBS.mg.dl. + Weight.gain.Y.N. + hair.growth.Y.N. + 
##     Skin.darkening..Y.N. + Hair.loss.Y.N. + Pimples.Y.N. + Fast.food..Y.N. + 
##     Reg.Exercise.Y.N. + BP._Systolic..mmHg. + BP._Diastolic..mmHg. + 
##     Follicle.No...L. + Follicle.No...R. + Avg..F.size..L...mm. + 
##     Avg..F.size..R...mm. + Endometrium..mm.
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
##                          Df Deviance    AIC
## - Cycle.length.days.      1   92.862 166.86
## - Hip.inch.               1   92.915 166.91
## - FSH.mIU.mL.             1   92.995 167.00
## - Avg..F.size..R...mm.    1   92.996 167.00
## - Vit.D3..ng.mL.          1   93.033 167.03
## - Age..yrs.               1   93.056 167.06
## - Waist.inch.             1   93.060 167.06
## - Height.Cm.              1   93.203 167.20
## - BMI                     1   93.240 167.24
## - Hb.g.dl.                1   93.357 167.36
## - RR..breaths.min.        1   93.362 167.36
## - Endometrium..mm.        1   93.435 167.44
## - AMH.ng.mL.              1   93.538 167.54
## - Avg..F.size..L...mm.    1   93.591 167.59
## - Reg.Exercise.Y.N.       1   93.824 167.82
## - Follicle.No...L.        1   93.872 167.87
## - Pregnant.Y.N.           1   93.965 167.97
## - Blood.Group             1   94.016 168.02
## - PRL.ng.mL.              1   94.244 168.24
## - Hair.loss.Y.N.          1   94.363 168.36
## - BP._Diastolic..mmHg.    1   94.438 168.44
## - Fast.food..Y.N.         1   94.526 168.53
## - PRG.ng.mL.              1   94.609 168.61
## - BP._Systolic..mmHg.     1   94.679 168.68
## <none>                        92.822 168.82
## - Cycle.R.I.              1   94.846 168.85
## - I...beta.HCG.mIU.mL.    1   94.938 168.94
## - TSH..mIU.L.             1   95.474 169.47
## - No..of.aborptions       1   95.771 169.77
## - Marraige.Status..Yrs.   1   95.927 169.93
## + II....beta.HCG.mIU.mL.  1   92.794 170.79
## + Weight..Kg.             1   92.811 170.81
## - RBS.mg.dl.              1   96.912 170.91
## - Pulse.rate.bpm.         1   97.112 171.11
## - Skin.darkening..Y.N.    1   97.171 171.17
## - Pimples.Y.N.            1   98.137 172.14
## - LH.mIU.mL.              1  107.080 181.08
## - hair.growth.Y.N.        1  107.907 181.91
## - Weight.gain.Y.N.        1  116.102 190.10
## - Follicle.No...R.        1  160.079 234.08
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## 
## Step:  AIC=166.86
## PCOS..Y.N. ~ Age..yrs. + Height.Cm. + BMI + Blood.Group + Pulse.rate.bpm. + 
##     RR..breaths.min. + Hb.g.dl. + Cycle.R.I. + Marraige.Status..Yrs. + 
##     Pregnant.Y.N. + No..of.aborptions + I...beta.HCG.mIU.mL. + 
##     FSH.mIU.mL. + LH.mIU.mL. + Hip.inch. + Waist.inch. + TSH..mIU.L. + 
##     AMH.ng.mL. + PRL.ng.mL. + Vit.D3..ng.mL. + PRG.ng.mL. + RBS.mg.dl. + 
##     Weight.gain.Y.N. + hair.growth.Y.N. + Skin.darkening..Y.N. + 
##     Hair.loss.Y.N. + Pimples.Y.N. + Fast.food..Y.N. + Reg.Exercise.Y.N. + 
##     BP._Systolic..mmHg. + BP._Diastolic..mmHg. + Follicle.No...L. + 
##     Follicle.No...R. + Avg..F.size..L...mm. + Avg..F.size..R...mm. + 
##     Endometrium..mm.
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
##                          Df Deviance    AIC
## - Hip.inch.               1   92.937 164.94
## - Avg..F.size..R...mm.    1   93.005 165.00
## - FSH.mIU.mL.             1   93.042 165.04
## - Waist.inch.             1   93.077 165.08
## - Vit.D3..ng.mL.          1   93.083 165.08
## - Age..yrs.               1   93.090 165.09
## - Height.Cm.              1   93.244 165.24
## - BMI                     1   93.287 165.29
## - Hb.g.dl.                1   93.357 165.36
## - RR..breaths.min.        1   93.467 165.47
## - Endometrium..mm.        1   93.508 165.51
## - AMH.ng.mL.              1   93.598 165.60
## - Avg..F.size..L...mm.    1   93.629 165.63
## - Reg.Exercise.Y.N.       1   93.834 165.83
## - Follicle.No...L.        1   93.895 165.90
## - Pregnant.Y.N.           1   93.987 165.99
## - Blood.Group             1   94.040 166.04
## - PRL.ng.mL.              1   94.309 166.31
## - Hair.loss.Y.N.          1   94.373 166.37
## - BP._Diastolic..mmHg.    1   94.458 166.46
## - Fast.food..Y.N.         1   94.551 166.55
## - PRG.ng.mL.              1   94.615 166.62
## - BP._Systolic..mmHg.     1   94.687 166.69
## <none>                        92.862 166.86
## - Cycle.R.I.              1   94.869 166.87
## - I...beta.HCG.mIU.mL.    1   94.939 166.94
## - TSH..mIU.L.             1   95.503 167.50
## - No..of.aborptions       1   95.829 167.83
## - Marraige.Status..Yrs.   1   95.975 167.97
## + Cycle.length.days.      1   92.822 168.82
## + II....beta.HCG.mIU.mL.  1   92.832 168.83
## + Weight..Kg.             1   92.847 168.85
## - RBS.mg.dl.              1   96.940 168.94
## - Pulse.rate.bpm.         1   97.118 169.12
## - Skin.darkening..Y.N.    1   97.342 169.34
## - Pimples.Y.N.            1   98.294 170.29
## - LH.mIU.mL.              1  107.868 179.87
## - hair.growth.Y.N.        1  107.984 179.98
## - Weight.gain.Y.N.        1  116.141 188.14
## - Follicle.No...R.        1  162.517 234.52
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## 
## Step:  AIC=164.94
## PCOS..Y.N. ~ Age..yrs. + Height.Cm. + BMI + Blood.Group + Pulse.rate.bpm. + 
##     RR..breaths.min. + Hb.g.dl. + Cycle.R.I. + Marraige.Status..Yrs. + 
##     Pregnant.Y.N. + No..of.aborptions + I...beta.HCG.mIU.mL. + 
##     FSH.mIU.mL. + LH.mIU.mL. + Waist.inch. + TSH..mIU.L. + AMH.ng.mL. + 
##     PRL.ng.mL. + Vit.D3..ng.mL. + PRG.ng.mL. + RBS.mg.dl. + Weight.gain.Y.N. + 
##     hair.growth.Y.N. + Skin.darkening..Y.N. + Hair.loss.Y.N. + 
##     Pimples.Y.N. + Fast.food..Y.N. + Reg.Exercise.Y.N. + BP._Systolic..mmHg. + 
##     BP._Diastolic..mmHg. + Follicle.No...L. + Follicle.No...R. + 
##     Avg..F.size..L...mm. + Avg..F.size..R...mm. + Endometrium..mm.
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
##                          Df Deviance    AIC
## - Avg..F.size..R...mm.    1   93.047 163.05
## - FSH.mIU.mL.             1   93.119 163.12
## - Age..yrs.               1   93.155 163.16
## - Vit.D3..ng.mL.          1   93.179 163.18
## - Waist.inch.             1   93.233 163.23
## - Height.Cm.              1   93.321 163.32
## - BMI                     1   93.339 163.34
## - Hb.g.dl.                1   93.424 163.42
## - RR..breaths.min.        1   93.711 163.71
## - Endometrium..mm.        1   93.719 163.72
## - AMH.ng.mL.              1   93.789 163.79
## - Avg..F.size..L...mm.    1   93.815 163.81
## - Reg.Exercise.Y.N.       1   93.847 163.85
## - Follicle.No...L.        1   93.919 163.92
## - Pregnant.Y.N.           1   94.132 164.13
## - Blood.Group             1   94.170 164.17
## - Hair.loss.Y.N.          1   94.389 164.39
## - BP._Diastolic..mmHg.    1   94.524 164.52
## - PRG.ng.mL.              1   94.643 164.64
## - PRL.ng.mL.              1   94.699 164.70
## - Fast.food..Y.N.         1   94.718 164.72
## - BP._Systolic..mmHg.     1   94.806 164.81
## - Cycle.R.I.              1   94.888 164.89
## <none>                        92.937 164.94
## - I...beta.HCG.mIU.mL.    1   94.954 164.95
## - TSH..mIU.L.             1   95.639 165.64
## - No..of.aborptions       1   95.874 165.87
## - Marraige.Status..Yrs.   1   96.012 166.01
## + Hip.inch.               1   92.862 166.86
## + Weight..Kg.             1   92.894 166.89
## + II....beta.HCG.mIU.mL.  1   92.911 166.91
## + Cycle.length.days.      1   92.915 166.91
## - RBS.mg.dl.              1   97.296 167.30
## - Skin.darkening..Y.N.    1   97.345 167.34
## - Pulse.rate.bpm.         1   97.657 167.66
## - Pimples.Y.N.            1   99.071 169.07
## - LH.mIU.mL.              1  107.966 177.97
## - hair.growth.Y.N.        1  108.270 178.27
## - Weight.gain.Y.N.        1  116.163 186.16
## - Follicle.No...R.        1  162.821 232.82
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## 
## Step:  AIC=163.05
## PCOS..Y.N. ~ Age..yrs. + Height.Cm. + BMI + Blood.Group + Pulse.rate.bpm. + 
##     RR..breaths.min. + Hb.g.dl. + Cycle.R.I. + Marraige.Status..Yrs. + 
##     Pregnant.Y.N. + No..of.aborptions + I...beta.HCG.mIU.mL. + 
##     FSH.mIU.mL. + LH.mIU.mL. + Waist.inch. + TSH..mIU.L. + AMH.ng.mL. + 
##     PRL.ng.mL. + Vit.D3..ng.mL. + PRG.ng.mL. + RBS.mg.dl. + Weight.gain.Y.N. + 
##     hair.growth.Y.N. + Skin.darkening..Y.N. + Hair.loss.Y.N. + 
##     Pimples.Y.N. + Fast.food..Y.N. + Reg.Exercise.Y.N. + BP._Systolic..mmHg. + 
##     BP._Diastolic..mmHg. + Follicle.No...L. + Follicle.No...R. + 
##     Avg..F.size..L...mm. + Endometrium..mm.
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
##                          Df Deviance    AIC
## - Age..yrs.               1   93.257 161.26
## - FSH.mIU.mL.             1   93.299 161.30
## - Vit.D3..ng.mL.          1   93.347 161.35
## - Waist.inch.             1   93.361 161.36
## - BMI                     1   93.514 161.51
## - Height.Cm.              1   93.564 161.56
## - Hb.g.dl.                1   93.571 161.57
## - Endometrium..mm.        1   93.778 161.78
## - AMH.ng.mL.              1   93.854 161.85
## - Avg..F.size..L...mm.    1   93.899 161.90
## - RR..breaths.min.        1   93.989 161.99
## - Reg.Exercise.Y.N.       1   94.114 162.11
## - Pregnant.Y.N.           1   94.231 162.23
## - Blood.Group             1   94.242 162.24
## - Follicle.No...L.        1   94.252 162.25
## - Hair.loss.Y.N.          1   94.439 162.44
## - BP._Diastolic..mmHg.    1   94.573 162.57
## - PRG.ng.mL.              1   94.780 162.78
## - PRL.ng.mL.              1   94.822 162.82
## - BP._Systolic..mmHg.     1   94.854 162.85
## - Fast.food..Y.N.         1   94.937 162.94
## - I...beta.HCG.mIU.mL.    1   94.956 162.96
## - Cycle.R.I.              1   94.970 162.97
## <none>                        93.047 163.05
## - TSH..mIU.L.             1   95.762 163.76
## - No..of.aborptions       1   96.001 164.00
## - Marraige.Status..Yrs.   1   96.122 164.12
## + Avg..F.size..R...mm.    1   92.937 164.94
## + Hip.inch.               1   93.005 165.00
## + II....beta.HCG.mIU.mL.  1   93.019 165.02
## + Weight..Kg.             1   93.022 165.02
## + Cycle.length.days.      1   93.042 165.04
## - RBS.mg.dl.              1   97.463 165.46
## - Skin.darkening..Y.N.    1   97.533 165.53
## - Pulse.rate.bpm.         1   97.799 165.80
## - Pimples.Y.N.            1   99.355 167.35
## - LH.mIU.mL.              1  107.991 175.99
## - hair.growth.Y.N.        1  108.405 176.41
## - Weight.gain.Y.N.        1  116.292 184.29
## - Follicle.No...R.        1  165.945 233.94
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## 
## Step:  AIC=161.26
## PCOS..Y.N. ~ Height.Cm. + BMI + Blood.Group + Pulse.rate.bpm. + 
##     RR..breaths.min. + Hb.g.dl. + Cycle.R.I. + Marraige.Status..Yrs. + 
##     Pregnant.Y.N. + No..of.aborptions + I...beta.HCG.mIU.mL. + 
##     FSH.mIU.mL. + LH.mIU.mL. + Waist.inch. + TSH..mIU.L. + AMH.ng.mL. + 
##     PRL.ng.mL. + Vit.D3..ng.mL. + PRG.ng.mL. + RBS.mg.dl. + Weight.gain.Y.N. + 
##     hair.growth.Y.N. + Skin.darkening..Y.N. + Hair.loss.Y.N. + 
##     Pimples.Y.N. + Fast.food..Y.N. + Reg.Exercise.Y.N. + BP._Systolic..mmHg. + 
##     BP._Diastolic..mmHg. + Follicle.No...L. + Follicle.No...R. + 
##     Avg..F.size..L...mm. + Endometrium..mm.
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
##                          Df Deviance    AIC
## - FSH.mIU.mL.             1   93.439 159.44
## - Vit.D3..ng.mL.          1   93.498 159.50
## - Waist.inch.             1   93.560 159.56
## - BMI                     1   93.651 159.65
## - Hb.g.dl.                1   93.871 159.87
## - Height.Cm.              1   93.928 159.93
## - Endometrium..mm.        1   93.975 159.97
## - AMH.ng.mL.              1   94.045 160.04
## - Avg..F.size..L...mm.    1   94.145 160.15
## - Pregnant.Y.N.           1   94.356 160.36
## - Reg.Exercise.Y.N.       1   94.415 160.41
## - Follicle.No...L.        1   94.458 160.46
## - RR..breaths.min.        1   94.469 160.47
## - Hair.loss.Y.N.          1   94.477 160.48
## - Blood.Group             1   94.500 160.50
## - BP._Diastolic..mmHg.    1   94.755 160.75
## - PRL.ng.mL.              1   94.823 160.82
## - PRG.ng.mL.              1   94.896 160.90
## - I...beta.HCG.mIU.mL.    1   95.052 161.05
## - BP._Systolic..mmHg.     1   95.203 161.20
## - Cycle.R.I.              1   95.224 161.22
## <none>                        93.257 161.26
## - Fast.food..Y.N.         1   95.340 161.34
## - TSH..mIU.L.             1   95.986 161.99
## - No..of.aborptions       1   96.391 162.39
## + Age..yrs.               1   93.047 163.05
## + Avg..F.size..R...mm.    1   93.155 163.16
## + Weight..Kg.             1   93.220 163.22
## + Hip.inch.               1   93.221 163.22
## + II....beta.HCG.mIU.mL.  1   93.242 163.24
## + Cycle.length.days.      1   93.254 163.25
## - Marraige.Status..Yrs.   1   97.326 163.33
## - Skin.darkening..Y.N.    1   97.839 163.84
## - RBS.mg.dl.              1   98.040 164.04
## - Pulse.rate.bpm.         1   98.170 164.17
## - Pimples.Y.N.            1   99.848 165.85
## - LH.mIU.mL.              1  108.016 174.02
## - hair.growth.Y.N.        1  108.563 174.56
## - Weight.gain.Y.N.        1  116.830 182.83
## - Follicle.No...R.        1  166.892 232.89
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## 
## Step:  AIC=159.44
## PCOS..Y.N. ~ Height.Cm. + BMI + Blood.Group + Pulse.rate.bpm. + 
##     RR..breaths.min. + Hb.g.dl. + Cycle.R.I. + Marraige.Status..Yrs. + 
##     Pregnant.Y.N. + No..of.aborptions + I...beta.HCG.mIU.mL. + 
##     LH.mIU.mL. + Waist.inch. + TSH..mIU.L. + AMH.ng.mL. + PRL.ng.mL. + 
##     Vit.D3..ng.mL. + PRG.ng.mL. + RBS.mg.dl. + Weight.gain.Y.N. + 
##     hair.growth.Y.N. + Skin.darkening..Y.N. + Hair.loss.Y.N. + 
##     Pimples.Y.N. + Fast.food..Y.N. + Reg.Exercise.Y.N. + BP._Systolic..mmHg. + 
##     BP._Diastolic..mmHg. + Follicle.No...L. + Follicle.No...R. + 
##     Avg..F.size..L...mm. + Endometrium..mm.
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
##                          Df Deviance    AIC
## - Vit.D3..ng.mL.          1   93.546 157.55
## - Waist.inch.             1   93.717 157.72
## - BMI                     1   93.834 157.83
## - Hb.g.dl.                1   94.042 158.04
## - Height.Cm.              1   94.061 158.06
## - Endometrium..mm.        1   94.091 158.09
## - Avg..F.size..L...mm.    1   94.218 158.22
## - AMH.ng.mL.              1   94.336 158.34
## - Reg.Exercise.Y.N.       1   94.485 158.49
## - Pregnant.Y.N.           1   94.522 158.52
## - Hair.loss.Y.N.          1   94.641 158.64
## - RR..breaths.min.        1   94.757 158.76
## - Follicle.No...L.        1   94.846 158.85
## - PRG.ng.mL.              1   94.982 158.98
## - PRL.ng.mL.              1   95.008 159.01
## - BP._Diastolic..mmHg.    1   95.017 159.02
## - Blood.Group             1   95.068 159.07
## - I...beta.HCG.mIU.mL.    1   95.301 159.30
## - BP._Systolic..mmHg.     1   95.404 159.40
## <none>                        93.439 159.44
## - Cycle.R.I.              1   95.575 159.57
## - Fast.food..Y.N.         1   95.577 159.58
## - TSH..mIU.L.             1   96.196 160.20
## - No..of.aborptions       1   96.515 160.51
## + FSH.mIU.mL.             1   93.257 161.26
## + Avg..F.size..R...mm.    1   93.280 161.28
## + Age..yrs.               1   93.299 161.30
## + Hip.inch.               1   93.407 161.41
## + Weight..Kg.             1   93.407 161.41
## + II....beta.HCG.mIU.mL.  1   93.429 161.43
## + Cycle.length.days.      1   93.436 161.44
## - Marraige.Status..Yrs.   1   97.446 161.45
## - Skin.darkening..Y.N.    1   98.114 162.11
## - RBS.mg.dl.              1   98.325 162.32
## - Pulse.rate.bpm.         1   98.572 162.57
## - Pimples.Y.N.            1   99.915 163.91
## - LH.mIU.mL.              1  108.038 172.04
## - hair.growth.Y.N.        1  108.651 172.65
## - Weight.gain.Y.N.        1  118.126 182.13
## - Follicle.No...R.        1  166.901 230.90
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## 
## Step:  AIC=157.55
## PCOS..Y.N. ~ Height.Cm. + BMI + Blood.Group + Pulse.rate.bpm. + 
##     RR..breaths.min. + Hb.g.dl. + Cycle.R.I. + Marraige.Status..Yrs. + 
##     Pregnant.Y.N. + No..of.aborptions + I...beta.HCG.mIU.mL. + 
##     LH.mIU.mL. + Waist.inch. + TSH..mIU.L. + AMH.ng.mL. + PRL.ng.mL. + 
##     PRG.ng.mL. + RBS.mg.dl. + Weight.gain.Y.N. + hair.growth.Y.N. + 
##     Skin.darkening..Y.N. + Hair.loss.Y.N. + Pimples.Y.N. + Fast.food..Y.N. + 
##     Reg.Exercise.Y.N. + BP._Systolic..mmHg. + BP._Diastolic..mmHg. + 
##     Follicle.No...L. + Follicle.No...R. + Avg..F.size..L...mm. + 
##     Endometrium..mm.
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
##                          Df Deviance    AIC
## - Waist.inch.             1   93.842 155.84
## - BMI                     1   93.948 155.95
## - Endometrium..mm.        1   94.154 156.15
## - Height.Cm.              1   94.187 156.19
## - Hb.g.dl.                1   94.283 156.28
## - Avg..F.size..L...mm.    1   94.295 156.29
## - AMH.ng.mL.              1   94.445 156.44
## - Reg.Exercise.Y.N.       1   94.563 156.56
## - Pregnant.Y.N.           1   94.645 156.65
## - Hair.loss.Y.N.          1   94.802 156.80
## - RR..breaths.min.        1   94.807 156.81
## - Follicle.No...L.        1   94.980 156.98
## - PRG.ng.mL.              1   95.084 157.08
## - PRL.ng.mL.              1   95.092 157.09
## - Blood.Group             1   95.135 157.13
## - BP._Diastolic..mmHg.    1   95.142 157.14
## - I...beta.HCG.mIU.mL.    1   95.412 157.41
## - BP._Systolic..mmHg.     1   95.488 157.49
## <none>                        93.546 157.55
## - Fast.food..Y.N.         1   95.696 157.70
## - Cycle.R.I.              1   95.793 157.79
## - TSH..mIU.L.             1   96.344 158.34
## - No..of.aborptions       1   96.554 158.55
## + Avg..F.size..R...mm.    1   93.375 159.38
## + Age..yrs.               1   93.413 159.41
## + Vit.D3..ng.mL.          1   93.439 159.44
## + FSH.mIU.mL.             1   93.498 159.50
## + Hip.inch.               1   93.505 159.50
## + Weight..Kg.             1   93.511 159.51
## - Marraige.Status..Yrs.   1   97.512 159.51
## + II....beta.HCG.mIU.mL.  1   93.537 159.54
## + Cycle.length.days.      1   93.542 159.54
## - RBS.mg.dl.              1   98.564 160.56
## - Pulse.rate.bpm.         1   98.588 160.59
## - Skin.darkening..Y.N.    1   98.616 160.62
## - Pimples.Y.N.            1  100.192 162.19
## - LH.mIU.mL.              1  108.294 170.29
## - hair.growth.Y.N.        1  108.664 170.66
## - Weight.gain.Y.N.        1  118.133 180.13
## - Follicle.No...R.        1  167.343 229.34
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## 
## Step:  AIC=155.84
## PCOS..Y.N. ~ Height.Cm. + BMI + Blood.Group + Pulse.rate.bpm. + 
##     RR..breaths.min. + Hb.g.dl. + Cycle.R.I. + Marraige.Status..Yrs. + 
##     Pregnant.Y.N. + No..of.aborptions + I...beta.HCG.mIU.mL. + 
##     LH.mIU.mL. + TSH..mIU.L. + AMH.ng.mL. + PRL.ng.mL. + PRG.ng.mL. + 
##     RBS.mg.dl. + Weight.gain.Y.N. + hair.growth.Y.N. + Skin.darkening..Y.N. + 
##     Hair.loss.Y.N. + Pimples.Y.N. + Fast.food..Y.N. + Reg.Exercise.Y.N. + 
##     BP._Systolic..mmHg. + BP._Diastolic..mmHg. + Follicle.No...L. + 
##     Follicle.No...R. + Avg..F.size..L...mm. + Endometrium..mm.
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
##                          Df Deviance    AIC
## - BMI                     1   94.072 154.07
## - Height.Cm.              1   94.279 154.28
## - Endometrium..mm.        1   94.404 154.40
## - AMH.ng.mL.              1   94.559 154.56
## - Hb.g.dl.                1   94.589 154.59
## - Avg..F.size..L...mm.    1   94.790 154.79
## - Reg.Exercise.Y.N.       1   94.799 154.80
## - Pregnant.Y.N.           1   94.844 154.84
## - Hair.loss.Y.N.          1   95.033 155.03
## - Follicle.No...L.        1   95.102 155.10
## - RR..breaths.min.        1   95.220 155.22
## - PRG.ng.mL.              1   95.248 155.25
## - PRL.ng.mL.              1   95.322 155.32
## - BP._Diastolic..mmHg.    1   95.453 155.45
## - Blood.Group             1   95.557 155.56
## - I...beta.HCG.mIU.mL.    1   95.616 155.62
## - BP._Systolic..mmHg.     1   95.739 155.74
## <none>                        93.842 155.84
## - Cycle.R.I.              1   96.162 156.16
## - Fast.food..Y.N.         1   96.236 156.24
## - TSH..mIU.L.             1   96.675 156.68
## - No..of.aborptions       1   96.907 156.91
## - Marraige.Status..Yrs.   1   97.519 157.52
## + Waist.inch.             1   93.546 157.55
## + Avg..F.size..R...mm.    1   93.653 157.65
## + Hip.inch.               1   93.665 157.66
## + Age..yrs.               1   93.717 157.72
## + Vit.D3..ng.mL.          1   93.717 157.72
## + FSH.mIU.mL.             1   93.809 157.81
## + Weight..Kg.             1   93.818 157.82
## + Cycle.length.days.      1   93.836 157.84
## + II....beta.HCG.mIU.mL.  1   93.837 157.84
## - Skin.darkening..Y.N.    1   98.649 158.65
## - RBS.mg.dl.              1   98.653 158.65
## - Pulse.rate.bpm.         1   99.162 159.16
## - Pimples.Y.N.            1  100.300 160.30
## - LH.mIU.mL.              1  108.779 168.78
## - hair.growth.Y.N.        1  110.316 170.32
## - Weight.gain.Y.N.        1  121.442 181.44
## - Follicle.No...R.        1  168.031 228.03
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## 
## Step:  AIC=154.07
## PCOS..Y.N. ~ Height.Cm. + Blood.Group + Pulse.rate.bpm. + RR..breaths.min. + 
##     Hb.g.dl. + Cycle.R.I. + Marraige.Status..Yrs. + Pregnant.Y.N. + 
##     No..of.aborptions + I...beta.HCG.mIU.mL. + LH.mIU.mL. + TSH..mIU.L. + 
##     AMH.ng.mL. + PRL.ng.mL. + PRG.ng.mL. + RBS.mg.dl. + Weight.gain.Y.N. + 
##     hair.growth.Y.N. + Skin.darkening..Y.N. + Hair.loss.Y.N. + 
##     Pimples.Y.N. + Fast.food..Y.N. + Reg.Exercise.Y.N. + BP._Systolic..mmHg. + 
##     BP._Diastolic..mmHg. + Follicle.No...L. + Follicle.No...R. + 
##     Avg..F.size..L...mm. + Endometrium..mm.
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
##                          Df Deviance    AIC
## - Height.Cm.              1   94.451 152.45
## - Endometrium..mm.        1   94.537 152.54
## - Pregnant.Y.N.           1   94.974 152.97
## - Hb.g.dl.                1   94.979 152.98
## - Avg..F.size..L...mm.    1   95.053 153.05
## - AMH.ng.mL.              1   95.089 153.09
## - Reg.Exercise.Y.N.       1   95.158 153.16
## - Hair.loss.Y.N.          1   95.265 153.26
## - Follicle.No...L.        1   95.289 153.29
## - PRG.ng.mL.              1   95.417 153.42
## - PRL.ng.mL.              1   95.473 153.47
## - RR..breaths.min.        1   95.508 153.51
## - I...beta.HCG.mIU.mL.    1   95.877 153.88
## - Blood.Group             1   95.880 153.88
## - BP._Diastolic..mmHg.    1   96.009 154.01
## <none>                        94.072 154.07
## - Fast.food..Y.N.         1   96.417 154.42
## - BP._Systolic..mmHg.     1   96.599 154.60
## - Cycle.R.I.              1   96.860 154.86
## - TSH..mIU.L.             1   97.058 155.06
## - No..of.aborptions       1   97.279 155.28
## + Avg..F.size..R...mm.    1   93.830 155.83
## + BMI                     1   93.842 155.84
## + Vit.D3..ng.mL.          1   93.946 155.95
## + Waist.inch.             1   93.948 155.95
## - Marraige.Status..Yrs.   1   97.961 155.96
## + Age..yrs.               1   93.988 155.99
## + Hip.inch.               1   94.001 156.00
## + FSH.mIU.mL.             1   94.034 156.03
## + Cycle.length.days.      1   94.065 156.06
## + Weight..Kg.             1   94.069 156.07
## + II....beta.HCG.mIU.mL.  1   94.072 156.07
## - RBS.mg.dl.              1   99.304 157.30
## - Skin.darkening..Y.N.    1   99.322 157.32
## - Pulse.rate.bpm.         1   99.958 157.96
## - Pimples.Y.N.            1  101.186 159.19
## - LH.mIU.mL.              1  109.602 167.60
## - hair.growth.Y.N.        1  110.513 168.51
## - Weight.gain.Y.N.        1  121.495 179.50
## - Follicle.No...R.        1  170.439 228.44
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## 
## Step:  AIC=152.45
## PCOS..Y.N. ~ Blood.Group + Pulse.rate.bpm. + RR..breaths.min. + 
##     Hb.g.dl. + Cycle.R.I. + Marraige.Status..Yrs. + Pregnant.Y.N. + 
##     No..of.aborptions + I...beta.HCG.mIU.mL. + LH.mIU.mL. + TSH..mIU.L. + 
##     AMH.ng.mL. + PRL.ng.mL. + PRG.ng.mL. + RBS.mg.dl. + Weight.gain.Y.N. + 
##     hair.growth.Y.N. + Skin.darkening..Y.N. + Hair.loss.Y.N. + 
##     Pimples.Y.N. + Fast.food..Y.N. + Reg.Exercise.Y.N. + BP._Systolic..mmHg. + 
##     BP._Diastolic..mmHg. + Follicle.No...L. + Follicle.No...R. + 
##     Avg..F.size..L...mm. + Endometrium..mm.
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
##                          Df Deviance    AIC
## - Endometrium..mm.        1   95.088 151.09
## - Hb.g.dl.                1   95.252 151.25
## - Avg..F.size..L...mm.    1   95.337 151.34
## - Reg.Exercise.Y.N.       1   95.512 151.51
## - AMH.ng.mL.              1   95.565 151.56
## - Follicle.No...L.        1   95.618 151.62
## - Pregnant.Y.N.           1   95.707 151.71
## - RR..breaths.min.        1   95.733 151.73
## - PRG.ng.mL.              1   95.865 151.87
## - Hair.loss.Y.N.          1   95.921 151.92
## - PRL.ng.mL.              1   95.931 151.93
## - I...beta.HCG.mIU.mL.    1   95.973 151.97
## - Blood.Group             1   96.230 152.23
## - BP._Diastolic..mmHg.    1   96.350 152.35
## <none>                        94.451 152.45
## - Fast.food..Y.N.         1   96.690 152.69
## - BP._Systolic..mmHg.     1   96.893 152.89
## - Cycle.R.I.              1   97.253 153.25
## - TSH..mIU.L.             1   97.423 153.42
## - No..of.aborptions       1   97.463 153.46
## - Marraige.Status..Yrs.   1   97.967 153.97
## + Height.Cm.              1   94.072 154.07
## + Avg..F.size..R...mm.    1   94.088 154.09
## + Age..yrs.               1   94.275 154.28
## + BMI                     1   94.279 154.28
## + Weight..Kg.             1   94.303 154.30
## + Vit.D3..ng.mL.          1   94.316 154.32
## + Waist.inch.             1   94.420 154.42
## + FSH.mIU.mL.             1   94.425 154.43
## + Hip.inch.               1   94.440 154.44
## + II....beta.HCG.mIU.mL.  1   94.450 154.45
## + Cycle.length.days.      1   94.450 154.45
## - Skin.darkening..Y.N.    1   99.475 155.47
## - RBS.mg.dl.              1   99.833 155.83
## - Pulse.rate.bpm.         1  100.242 156.24
## - Pimples.Y.N.            1  101.244 157.24
## - LH.mIU.mL.              1  110.353 166.35
## - hair.growth.Y.N.        1  110.570 166.57
## - Weight.gain.Y.N.        1  121.525 177.53
## - Follicle.No...R.        1  170.724 226.72
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## 
## Step:  AIC=151.09
## PCOS..Y.N. ~ Blood.Group + Pulse.rate.bpm. + RR..breaths.min. + 
##     Hb.g.dl. + Cycle.R.I. + Marraige.Status..Yrs. + Pregnant.Y.N. + 
##     No..of.aborptions + I...beta.HCG.mIU.mL. + LH.mIU.mL. + TSH..mIU.L. + 
##     AMH.ng.mL. + PRL.ng.mL. + PRG.ng.mL. + RBS.mg.dl. + Weight.gain.Y.N. + 
##     hair.growth.Y.N. + Skin.darkening..Y.N. + Hair.loss.Y.N. + 
##     Pimples.Y.N. + Fast.food..Y.N. + Reg.Exercise.Y.N. + BP._Systolic..mmHg. + 
##     BP._Diastolic..mmHg. + Follicle.No...L. + Follicle.No...R. + 
##     Avg..F.size..L...mm.
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
##                          Df Deviance    AIC
## - Avg..F.size..L...mm.    1   95.910 149.91
## - Hb.g.dl.                1   95.957 149.96
## - RR..breaths.min.        1   96.155 150.16
## - Pregnant.Y.N.           1   96.172 150.17
## - AMH.ng.mL.              1   96.249 150.25
## - Reg.Exercise.Y.N.       1   96.269 150.27
## - I...beta.HCG.mIU.mL.    1   96.392 150.39
## - Follicle.No...L.        1   96.516 150.52
## - PRG.ng.mL.              1   96.829 150.83
## - BP._Diastolic..mmHg.    1   96.867 150.87
## - Hair.loss.Y.N.          1   96.872 150.87
## - PRL.ng.mL.              1   96.879 150.88
## - Blood.Group             1   96.959 150.96
## <none>                        95.088 151.09
## - BP._Systolic..mmHg.     1   97.580 151.58
## - Cycle.R.I.              1   97.728 151.73
## - Fast.food..Y.N.         1   97.864 151.86
## - TSH..mIU.L.             1   97.872 151.87
## - No..of.aborptions       1   98.216 152.22
## + Endometrium..mm.        1   94.451 152.45
## - Marraige.Status..Yrs.   1   98.534 152.53
## + Height.Cm.              1   94.537 152.54
## + Avg..F.size..R...mm.    1   94.824 152.82
## + Age..yrs.               1   94.883 152.88
## + Weight..Kg.             1   94.910 152.91
## + Vit.D3..ng.mL.          1   95.009 153.01
## + BMI                     1   95.019 153.02
## + FSH.mIU.mL.             1   95.065 153.06
## + Waist.inch.             1   95.069 153.07
## + Cycle.length.days.      1   95.085 153.09
## + II....beta.HCG.mIU.mL.  1   95.088 153.09
## + Hip.inch.               1   95.088 153.09
## - Skin.darkening..Y.N.    1  100.101 154.10
## - Pulse.rate.bpm.         1  100.344 154.34
## - RBS.mg.dl.              1  101.180 155.18
## - Pimples.Y.N.            1  101.887 155.89
## - LH.mIU.mL.              1  110.983 164.98
## - hair.growth.Y.N.        1  110.991 164.99
## - Weight.gain.Y.N.        1  121.537 175.54
## - Follicle.No...R.        1  170.746 224.75
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## 
## Step:  AIC=149.91
## PCOS..Y.N. ~ Blood.Group + Pulse.rate.bpm. + RR..breaths.min. + 
##     Hb.g.dl. + Cycle.R.I. + Marraige.Status..Yrs. + Pregnant.Y.N. + 
##     No..of.aborptions + I...beta.HCG.mIU.mL. + LH.mIU.mL. + TSH..mIU.L. + 
##     AMH.ng.mL. + PRL.ng.mL. + PRG.ng.mL. + RBS.mg.dl. + Weight.gain.Y.N. + 
##     hair.growth.Y.N. + Skin.darkening..Y.N. + Hair.loss.Y.N. + 
##     Pimples.Y.N. + Fast.food..Y.N. + Reg.Exercise.Y.N. + BP._Systolic..mmHg. + 
##     BP._Diastolic..mmHg. + Follicle.No...L. + Follicle.No...R.
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
##                          Df Deviance    AIC
## - RR..breaths.min.        1   96.753 148.75
## - Hb.g.dl.                1   96.766 148.77
## - AMH.ng.mL.              1   97.035 149.03
## - Reg.Exercise.Y.N.       1   97.160 149.16
## - Blood.Group             1   97.250 149.25
## - I...beta.HCG.mIU.mL.    1   97.256 149.26
## - BP._Diastolic..mmHg.    1   97.491 149.49
## - Pregnant.Y.N.           1   97.520 149.52
## - Hair.loss.Y.N.          1   97.600 149.60
## - PRL.ng.mL.              1   97.646 149.65
## - PRG.ng.mL.              1   97.812 149.81
## <none>                        95.910 149.91
## - BP._Systolic..mmHg.     1   98.127 150.13
## - Fast.food..Y.N.         1   98.214 150.21
## - TSH..mIU.L.             1   98.580 150.58
## - No..of.aborptions       1   98.582 150.58
## - Cycle.R.I.              1   98.630 150.63
## - Follicle.No...L.        1   98.924 150.92
## + Avg..F.size..L...mm.    1   95.088 151.09
## + Endometrium..mm.        1   95.337 151.34
## - Marraige.Status..Yrs.   1   99.452 151.45
## + Height.Cm.              1   95.471 151.47
## + Age..yrs.               1   95.678 151.68
## + Weight..Kg.             1   95.765 151.76
## + BMI                     1   95.801 151.80
## + Waist.inch.             1   95.832 151.83
## + Vit.D3..ng.mL.          1   95.847 151.85
## + Cycle.length.days.      1   95.882 151.88
## + II....beta.HCG.mIU.mL.  1   95.884 151.88
## + Avg..F.size..R...mm.    1   95.889 151.89
## + FSH.mIU.mL.             1   95.907 151.91
## + Hip.inch.               1   95.909 151.91
## - Pulse.rate.bpm.         1  100.616 152.62
## - Skin.darkening..Y.N.    1  100.913 152.91
## - Pimples.Y.N.            1  101.900 153.90
## - RBS.mg.dl.              1  102.291 154.29
## - hair.growth.Y.N.        1  111.002 163.00
## - LH.mIU.mL.              1  111.312 163.31
## - Weight.gain.Y.N.        1  121.539 173.54
## - Follicle.No...R.        1  171.742 223.74
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## 
## Step:  AIC=148.75
## PCOS..Y.N. ~ Blood.Group + Pulse.rate.bpm. + Hb.g.dl. + Cycle.R.I. + 
##     Marraige.Status..Yrs. + Pregnant.Y.N. + No..of.aborptions + 
##     I...beta.HCG.mIU.mL. + LH.mIU.mL. + TSH..mIU.L. + AMH.ng.mL. + 
##     PRL.ng.mL. + PRG.ng.mL. + RBS.mg.dl. + Weight.gain.Y.N. + 
##     hair.growth.Y.N. + Skin.darkening..Y.N. + Hair.loss.Y.N. + 
##     Pimples.Y.N. + Fast.food..Y.N. + Reg.Exercise.Y.N. + BP._Systolic..mmHg. + 
##     BP._Diastolic..mmHg. + Follicle.No...L. + Follicle.No...R.
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
##                          Df Deviance    AIC
## - Reg.Exercise.Y.N.       1   97.659 147.66
## - Hb.g.dl.                1   97.773 147.77
## - AMH.ng.mL.              1   97.785 147.78
## - Blood.Group             1   97.927 147.93
## - Pregnant.Y.N.           1   98.346 148.35
## - I...beta.HCG.mIU.mL.    1   98.424 148.42
## - PRL.ng.mL.              1   98.568 148.57
## - Fast.food..Y.N.         1   98.723 148.72
## <none>                        96.753 148.75
## - BP._Systolic..mmHg.     1   98.762 148.76
## - PRG.ng.mL.              1   98.885 148.88
## - Hair.loss.Y.N.          1   98.982 148.98
## - No..of.aborptions       1   99.012 149.01
## - BP._Diastolic..mmHg.    1   99.145 149.15
## - TSH..mIU.L.             1   99.533 149.53
## - Follicle.No...L.        1   99.644 149.64
## - Cycle.R.I.              1   99.830 149.83
## + RR..breaths.min.        1   95.910 149.91
## + Avg..F.size..L...mm.    1   96.155 150.16
## + Endometrium..mm.        1   96.346 150.35
## + Age..yrs.               1   96.392 150.39
## + Height.Cm.              1   96.438 150.44
## - Marraige.Status..Yrs.   1  100.525 150.53
## + BMI                     1   96.596 150.60
## - Pulse.rate.bpm.         1  100.618 150.62
## + Waist.inch.             1   96.631 150.63
## + Weight..Kg.             1   96.645 150.65
## + Vit.D3..ng.mL.          1   96.717 150.72
## + II....beta.HCG.mIU.mL.  1   96.719 150.72
## + Cycle.length.days.      1   96.722 150.72
## + FSH.mIU.mL.             1   96.733 150.73
## + Avg..F.size..R...mm.    1   96.746 150.75
## + Hip.inch.               1   96.751 150.75
## - Skin.darkening..Y.N.    1  102.178 152.18
## - Pimples.Y.N.            1  102.345 152.34
## - RBS.mg.dl.              1  103.293 153.29
## - hair.growth.Y.N.        1  112.168 162.17
## - LH.mIU.mL.              1  112.350 162.35
## - Weight.gain.Y.N.        1  121.539 171.54
## - Follicle.No...R.        1  173.259 223.26
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## 
## Step:  AIC=147.66
## PCOS..Y.N. ~ Blood.Group + Pulse.rate.bpm. + Hb.g.dl. + Cycle.R.I. + 
##     Marraige.Status..Yrs. + Pregnant.Y.N. + No..of.aborptions + 
##     I...beta.HCG.mIU.mL. + LH.mIU.mL. + TSH..mIU.L. + AMH.ng.mL. + 
##     PRL.ng.mL. + PRG.ng.mL. + RBS.mg.dl. + Weight.gain.Y.N. + 
##     hair.growth.Y.N. + Skin.darkening..Y.N. + Hair.loss.Y.N. + 
##     Pimples.Y.N. + Fast.food..Y.N. + BP._Systolic..mmHg. + BP._Diastolic..mmHg. + 
##     Follicle.No...L. + Follicle.No...R.
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
##                          Df Deviance    AIC
## - Hb.g.dl.                1   99.061 147.06
## - Pregnant.Y.N.           1   99.077 147.08
## - AMH.ng.mL.              1   99.153 147.15
## - Blood.Group             1   99.167 147.17
## - PRG.ng.mL.              1   99.253 147.25
## - BP._Systolic..mmHg.     1   99.278 147.28
## - Hair.loss.Y.N.          1   99.609 147.61
## <none>                        97.659 147.66
## - PRL.ng.mL.              1   99.808 147.81
## - Fast.food..Y.N.         1   99.821 147.82
## - I...beta.HCG.mIU.mL.    1   99.924 147.92
## - Cycle.R.I.              1  100.145 148.15
## - No..of.aborptions       1  100.354 148.35
## - BP._Diastolic..mmHg.    1  100.641 148.64
## + Reg.Exercise.Y.N.       1   96.753 148.75
## - Marraige.Status..Yrs.   1  100.810 148.81
## - Follicle.No...L.        1  100.901 148.90
## + Avg..F.size..L...mm.    1   96.999 149.00
## - TSH..mIU.L.             1  101.099 149.10
## + Endometrium..mm.        1   97.126 149.13
## + RR..breaths.min.        1   97.160 149.16
## + Age..yrs.               1   97.278 149.28
## + Height.Cm.              1   97.343 149.34
## + BMI                     1   97.420 149.42
## + Weight..Kg.             1   97.512 149.51
## + II....beta.HCG.mIU.mL.  1   97.543 149.54
## - Pulse.rate.bpm.         1  101.598 149.60
## + Waist.inch.             1   97.611 149.61
## + Vit.D3..ng.mL.          1   97.638 149.64
## + Avg..F.size..R...mm.    1   97.642 149.64
## + Cycle.length.days.      1   97.654 149.65
## + FSH.mIU.mL.             1   97.658 149.66
## + Hip.inch.               1   97.659 149.66
## - Pimples.Y.N.            1  103.467 151.47
## - RBS.mg.dl.              1  103.931 151.93
## - Skin.darkening..Y.N.    1  103.966 151.97
## - hair.growth.Y.N.        1  112.371 160.37
## - LH.mIU.mL.              1  115.809 163.81
## - Weight.gain.Y.N.        1  121.729 169.73
## - Follicle.No...R.        1  176.334 224.33
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## 
## Step:  AIC=147.06
## PCOS..Y.N. ~ Blood.Group + Pulse.rate.bpm. + Cycle.R.I. + Marraige.Status..Yrs. + 
##     Pregnant.Y.N. + No..of.aborptions + I...beta.HCG.mIU.mL. + 
##     LH.mIU.mL. + TSH..mIU.L. + AMH.ng.mL. + PRL.ng.mL. + PRG.ng.mL. + 
##     RBS.mg.dl. + Weight.gain.Y.N. + hair.growth.Y.N. + Skin.darkening..Y.N. + 
##     Hair.loss.Y.N. + Pimples.Y.N. + Fast.food..Y.N. + BP._Systolic..mmHg. + 
##     BP._Diastolic..mmHg. + Follicle.No...L. + Follicle.No...R.
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
##                          Df Deviance    AIC
## - BP._Systolic..mmHg.     1  100.098 146.10
## - Pregnant.Y.N.           1  100.311 146.31
## - I...beta.HCG.mIU.mL.    1  100.706 146.71
## - Blood.Group             1  100.817 146.82
## - Fast.food..Y.N.         1  101.005 147.00
## - AMH.ng.mL.              1  101.044 147.04
## <none>                        99.061 147.06
## - PRG.ng.mL.              1  101.111 147.11
## - PRL.ng.mL.              1  101.227 147.23
## - Cycle.R.I.              1  101.373 147.37
## - No..of.aborptions       1  101.647 147.65
## + Hb.g.dl.                1   97.659 147.66
## - Marraige.Status..Yrs.   1  101.688 147.69
## - Follicle.No...L.        1  101.705 147.71
## + Reg.Exercise.Y.N.       1   97.773 147.77
## - Pulse.rate.bpm.         1  102.174 148.17
## - TSH..mIU.L.             1  102.211 148.21
## + Endometrium..mm.        1   98.416 148.42
## + Avg..F.size..L...mm.    1   98.424 148.42
## + RR..breaths.min.        1   98.503 148.50
## + Age..yrs.               1   98.580 148.58
## + BMI                     1   98.586 148.59
## + II....beta.HCG.mIU.mL.  1   98.647 148.65
## - Hair.loss.Y.N.          1  102.649 148.65
## - BP._Diastolic..mmHg.    1  102.689 148.69
## + Height.Cm.              1   98.858 148.86
## + Weight..Kg.             1   98.931 148.93
## + Vit.D3..ng.mL.          1   98.977 148.98
## + Avg..F.size..R...mm.    1   98.990 148.99
## + Cycle.length.days.      1   99.027 149.03
## + Waist.inch.             1   99.030 149.03
## + FSH.mIU.mL.             1   99.057 149.06
## + Hip.inch.               1   99.060 149.06
## - Pimples.Y.N.            1  104.544 150.54
## - Skin.darkening..Y.N.    1  105.212 151.21
## - RBS.mg.dl.              1  106.172 152.17
## - hair.growth.Y.N.        1  113.897 159.90
## - LH.mIU.mL.              1  116.211 162.21
## - Weight.gain.Y.N.        1  123.522 169.52
## - Follicle.No...R.        1  179.011 225.01
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## 
## Step:  AIC=146.1
## PCOS..Y.N. ~ Blood.Group + Pulse.rate.bpm. + Cycle.R.I. + Marraige.Status..Yrs. + 
##     Pregnant.Y.N. + No..of.aborptions + I...beta.HCG.mIU.mL. + 
##     LH.mIU.mL. + TSH..mIU.L. + AMH.ng.mL. + PRL.ng.mL. + PRG.ng.mL. + 
##     RBS.mg.dl. + Weight.gain.Y.N. + hair.growth.Y.N. + Skin.darkening..Y.N. + 
##     Hair.loss.Y.N. + Pimples.Y.N. + Fast.food..Y.N. + BP._Diastolic..mmHg. + 
##     Follicle.No...L. + Follicle.No...R.
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
##                          Df Deviance    AIC
## - Pregnant.Y.N.           1  101.418 145.42
## - Blood.Group             1  101.569 145.57
## - AMH.ng.mL.              1  101.835 145.84
## - Cycle.R.I.              1  101.934 145.93
## - Fast.food..Y.N.         1  102.010 146.01
## - I...beta.HCG.mIU.mL.    1  102.097 146.10
## <none>                       100.098 146.10
## - PRL.ng.mL.              1  102.297 146.30
## - No..of.aborptions       1  102.476 146.48
## - PRG.ng.mL.              1  102.528 146.53
## - Follicle.No...L.        1  102.560 146.56
## - Marraige.Status..Yrs.   1  102.611 146.61
## - Pulse.rate.bpm.         1  102.639 146.64
## + BP._Systolic..mmHg.     1   99.061 147.06
## - TSH..mIU.L.             1  103.113 147.11
## + BMI                     1   99.197 147.20
## + Hb.g.dl.                1   99.278 147.28
## + Reg.Exercise.Y.N.       1   99.306 147.31
## + Endometrium..mm.        1   99.373 147.37
## + RR..breaths.min.        1   99.595 147.59
## + Avg..F.size..L...mm.    1   99.647 147.65
## + Age..yrs.               1   99.748 147.75
## + II....beta.HCG.mIU.mL.  1   99.816 147.82
## + Weight..Kg.             1   99.869 147.87
## + Height.Cm.              1   99.934 147.93
## + Cycle.length.days.      1  100.016 148.02
## + Avg..F.size..R...mm.    1  100.032 148.03
## + Vit.D3..ng.mL.          1  100.041 148.04
## + Hip.inch.               1  100.062 148.06
## + FSH.mIU.mL.             1  100.097 148.10
## + Waist.inch.             1  100.097 148.10
## - Hair.loss.Y.N.          1  104.615 148.62
## - BP._Diastolic..mmHg.    1  105.294 149.29
## - Pimples.Y.N.            1  105.493 149.49
## - Skin.darkening..Y.N.    1  105.937 149.94
## - RBS.mg.dl.              1  106.626 150.63
## - hair.growth.Y.N.        1  114.398 158.40
## - LH.mIU.mL.              1  118.104 162.10
## - Weight.gain.Y.N.        1  123.805 167.81
## - Follicle.No...R.        1  180.489 224.49
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## 
## Step:  AIC=145.42
## PCOS..Y.N. ~ Blood.Group + Pulse.rate.bpm. + Cycle.R.I. + Marraige.Status..Yrs. + 
##     No..of.aborptions + I...beta.HCG.mIU.mL. + LH.mIU.mL. + TSH..mIU.L. + 
##     AMH.ng.mL. + PRL.ng.mL. + PRG.ng.mL. + RBS.mg.dl. + Weight.gain.Y.N. + 
##     hair.growth.Y.N. + Skin.darkening..Y.N. + Hair.loss.Y.N. + 
##     Pimples.Y.N. + Fast.food..Y.N. + BP._Diastolic..mmHg. + Follicle.No...L. + 
##     Follicle.No...R.
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
##                          Df Deviance    AIC
## - I...beta.HCG.mIU.mL.    1   102.95 144.95
## - Blood.Group             1   103.29 145.29
## <none>                        101.42 145.42
## - PRG.ng.mL.              1   103.42 145.42
## - AMH.ng.mL.              1   103.50 145.50
## - Pulse.rate.bpm.         1   103.50 145.50
## - Marraige.Status..Yrs.   1   103.64 145.64
## - Fast.food..Y.N.         1   103.64 145.65
## - Follicle.No...L.        1   103.65 145.65
## - Cycle.R.I.              1   103.80 145.80
## - PRL.ng.mL.              1   103.92 145.92
## + Pregnant.Y.N.           1   100.10 146.10
## - TSH..mIU.L.             1   104.18 146.18
## - No..of.aborptions       1   104.28 146.28
## + BP._Systolic..mmHg.     1   100.31 146.31
## + Avg..F.size..L...mm.    1   100.52 146.52
## + Hb.g.dl.                1   100.74 146.74
## + BMI                     1   100.79 146.79
## + Reg.Exercise.Y.N.       1   100.83 146.84
## + RR..breaths.min.        1   100.86 146.86
## + Height.Cm.              1   100.96 146.96
## + Endometrium..mm.        1   100.97 146.97
## + II....beta.HCG.mIU.mL.  1   101.02 147.02
## + Age..yrs.               1   101.07 147.07
## + Weight..Kg.             1   101.15 147.15
## + Cycle.length.days.      1   101.29 147.29
## + Hip.inch.               1   101.36 147.35
## + Vit.D3..ng.mL.          1   101.36 147.36
## + Avg..F.size..R...mm.    1   101.41 147.41
## + Waist.inch.             1   101.42 147.42
## + FSH.mIU.mL.             1   101.42 147.42
## - Hair.loss.Y.N.          1   106.03 148.03
## - Pimples.Y.N.            1   106.63 148.63
## - BP._Diastolic..mmHg.    1   107.37 149.37
## - Skin.darkening..Y.N.    1   107.67 149.67
## - RBS.mg.dl.              1   107.82 149.82
## - hair.growth.Y.N.        1   114.86 156.86
## - LH.mIU.mL.              1   119.55 161.54
## - Weight.gain.Y.N.        1   126.03 168.03
## - Follicle.No...R.        1   181.30 223.30
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## 
## Step:  AIC=144.95
## PCOS..Y.N. ~ Blood.Group + Pulse.rate.bpm. + Cycle.R.I. + Marraige.Status..Yrs. + 
##     No..of.aborptions + LH.mIU.mL. + TSH..mIU.L. + AMH.ng.mL. + 
##     PRL.ng.mL. + PRG.ng.mL. + RBS.mg.dl. + Weight.gain.Y.N. + 
##     hair.growth.Y.N. + Skin.darkening..Y.N. + Hair.loss.Y.N. + 
##     Pimples.Y.N. + Fast.food..Y.N. + BP._Diastolic..mmHg. + Follicle.No...L. + 
##     Follicle.No...R.
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
##                          Df Deviance    AIC
## - Marraige.Status..Yrs.   1   104.36 144.36
## - Pulse.rate.bpm.         1   104.45 144.45
## - Blood.Group             1   104.52 144.52
## - AMH.ng.mL.              1   104.57 144.57
## <none>                        102.95 144.95
## - PRG.ng.mL.              1   105.26 145.26
## - Fast.food..Y.N.         1   105.33 145.33
## - Follicle.No...L.        1   105.37 145.37
## - PRL.ng.mL.              1   105.39 145.39
## + I...beta.HCG.mIU.mL.    1   101.42 145.42
## - TSH..mIU.L.             1   105.48 145.48
## - No..of.aborptions       1   105.53 145.53
## + BP._Systolic..mmHg.     1   101.57 145.57
## + Reg.Exercise.Y.N.       1   102.00 146.00
## + Pregnant.Y.N.           1   102.10 146.10
## + BMI                     1   102.14 146.14
## + Avg..F.size..L...mm.    1   102.19 146.19
## + RR..breaths.min.        1   102.20 146.20
## - Cycle.R.I.              1   106.25 146.25
## + Hb.g.dl.                1   102.64 146.63
## + Endometrium..mm.        1   102.64 146.64
## + Age..yrs.               1   102.79 146.79
## + Cycle.length.days.      1   102.79 146.79
## + Weight..Kg.             1   102.83 146.82
## + Height.Cm.              1   102.86 146.86
## + Vit.D3..ng.mL.          1   102.91 146.91
## + Hip.inch.               1   102.93 146.93
## + FSH.mIU.mL.             1   102.93 146.93
## + II....beta.HCG.mIU.mL.  1   102.95 146.95
## + Waist.inch.             1   102.95 146.95
## + Avg..F.size..R...mm.    1   102.95 146.95
## - Pimples.Y.N.            1   107.49 147.49
## - Hair.loss.Y.N.          1   107.54 147.54
## - BP._Diastolic..mmHg.    1   108.13 148.13
## - Skin.darkening..Y.N.    1   109.56 149.56
## - RBS.mg.dl.              1   109.75 149.75
## - hair.growth.Y.N.        1   115.46 155.46
## - LH.mIU.mL.              1   119.73 159.73
## - Weight.gain.Y.N.        1   126.12 166.12
## - Follicle.No...R.        1   181.33 221.33
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## 
## Step:  AIC=144.36
## PCOS..Y.N. ~ Blood.Group + Pulse.rate.bpm. + Cycle.R.I. + No..of.aborptions + 
##     LH.mIU.mL. + TSH..mIU.L. + AMH.ng.mL. + PRL.ng.mL. + PRG.ng.mL. + 
##     RBS.mg.dl. + Weight.gain.Y.N. + hair.growth.Y.N. + Skin.darkening..Y.N. + 
##     Hair.loss.Y.N. + Pimples.Y.N. + Fast.food..Y.N. + BP._Diastolic..mmHg. + 
##     Follicle.No...L. + Follicle.No...R.
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
##                          Df Deviance    AIC
## - Pulse.rate.bpm.         1   105.56 143.56
## - Fast.food..Y.N.         1   106.20 144.20
## - Follicle.No...L.        1   106.21 144.21
## - Blood.Group             1   106.21 144.21
## - PRL.ng.mL.              1   106.22 144.22
## <none>                        104.36 144.36
## - AMH.ng.mL.              1   106.40 144.40
## - PRG.ng.mL.              1   106.44 144.44
## - TSH..mIU.L.             1   106.92 144.92
## + Marraige.Status..Yrs.   1   102.95 144.95
## - Cycle.R.I.              1   107.02 145.02
## + BP._Systolic..mmHg.     1   103.13 145.13
## - No..of.aborptions       1   107.35 145.35
## + RR..breaths.min.        1   103.37 145.37
## + BMI                     1   103.39 145.38
## + Avg..F.size..L...mm.    1   103.46 145.46
## + Pregnant.Y.N.           1   103.51 145.51
## + I...beta.HCG.mIU.mL.    1   103.64 145.64
## + Cycle.length.days.      1   103.93 145.93
## + Reg.Exercise.Y.N.       1   103.98 145.98
## + Age..yrs.               1   104.01 146.01
## + Hb.g.dl.                1   104.05 146.05
## + Endometrium..mm.        1   104.06 146.06
## + Weight..Kg.             1   104.20 146.20
## + Hip.inch.               1   104.26 146.26
## + FSH.mIU.mL.             1   104.29 146.29
## + II....beta.HCG.mIU.mL.  1   104.33 146.33
## + Vit.D3..ng.mL.          1   104.33 146.34
## + Height.Cm.              1   104.35 146.35
## + Waist.inch.             1   104.35 146.35
## + Avg..F.size..R...mm.    1   104.36 146.36
## - Pimples.Y.N.            1   109.03 147.03
## - Hair.loss.Y.N.          1   109.70 147.71
## - BP._Diastolic..mmHg.    1   110.50 148.50
## - RBS.mg.dl.              1   111.47 149.47
## - Skin.darkening..Y.N.    1   111.71 149.71
## - hair.growth.Y.N.        1   117.18 155.18
## - LH.mIU.mL.              1   121.13 159.13
## - Weight.gain.Y.N.        1   128.84 166.84
## - Follicle.No...R.        1   183.44 221.44
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## 
## Step:  AIC=143.56
## PCOS..Y.N. ~ Blood.Group + Cycle.R.I. + No..of.aborptions + LH.mIU.mL. + 
##     TSH..mIU.L. + AMH.ng.mL. + PRL.ng.mL. + PRG.ng.mL. + RBS.mg.dl. + 
##     Weight.gain.Y.N. + hair.growth.Y.N. + Skin.darkening..Y.N. + 
##     Hair.loss.Y.N. + Pimples.Y.N. + Fast.food..Y.N. + BP._Diastolic..mmHg. + 
##     Follicle.No...L. + Follicle.No...R.
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
##                          Df Deviance    AIC
## - AMH.ng.mL.              1   107.32 143.32
## - Follicle.No...L.        1   107.42 143.42
## - Blood.Group             1   107.44 143.44
## <none>                        105.56 143.56
## - PRL.ng.mL.              1   107.63 143.63
## - TSH..mIU.L.             1   107.66 143.66
## - Fast.food..Y.N.         1   107.67 143.68
## - PRG.ng.mL.              1   107.84 143.84
## - No..of.aborptions       1   108.25 144.25
## + Pulse.rate.bpm.         1   104.36 144.36
## + Marraige.Status..Yrs.   1   104.45 144.45
## + BMI                     1   104.46 144.46
## - Cycle.R.I.              1   108.83 144.83
## + BP._Systolic..mmHg.     1   104.88 144.88
## + Pregnant.Y.N.           1   104.90 144.90
## + Cycle.length.days.      1   104.96 144.96
## + Avg..F.size..L...mm.    1   104.96 144.96
## + Reg.Exercise.Y.N.       1   105.08 145.08
## + I...beta.HCG.mIU.mL.    1   105.10 145.10
## + Age..yrs.               1   105.31 145.31
## + Hb.g.dl.                1   105.36 145.36
## + Weight..Kg.             1   105.36 145.37
## + Endometrium..mm.        1   105.42 145.42
## + RR..breaths.min.        1   105.43 145.43
## + FSH.mIU.mL.             1   105.44 145.44
## + Hip.inch.               1   105.47 145.47
## + II....beta.HCG.mIU.mL.  1   105.52 145.52
## + Height.Cm.              1   105.53 145.53
## + Vit.D3..ng.mL.          1   105.55 145.55
## + Avg..F.size..R...mm.    1   105.56 145.56
## + Waist.inch.             1   105.56 145.56
## - Pimples.Y.N.            1   110.33 146.33
## - Hair.loss.Y.N.          1   111.42 147.42
## - RBS.mg.dl.              1   112.93 148.93
## - BP._Diastolic..mmHg.    1   112.98 148.98
## - Skin.darkening..Y.N.    1   113.62 149.62
## - hair.growth.Y.N.        1   117.81 153.81
## - LH.mIU.mL.              1   122.14 158.14
## - Weight.gain.Y.N.        1   129.50 165.50
## - Follicle.No...R.        1   185.58 221.58
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## 
## Step:  AIC=143.32
## PCOS..Y.N. ~ Blood.Group + Cycle.R.I. + No..of.aborptions + LH.mIU.mL. + 
##     TSH..mIU.L. + PRL.ng.mL. + PRG.ng.mL. + RBS.mg.dl. + Weight.gain.Y.N. + 
##     hair.growth.Y.N. + Skin.darkening..Y.N. + Hair.loss.Y.N. + 
##     Pimples.Y.N. + Fast.food..Y.N. + BP._Diastolic..mmHg. + Follicle.No...L. + 
##     Follicle.No...R.
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
##                          Df Deviance    AIC
## - PRL.ng.mL.              1   108.92 142.92
## - Blood.Group             1   109.06 143.06
## <none>                        107.32 143.32
## - TSH..mIU.L.             1   109.43 143.43
## - Follicle.No...L.        1   109.50 143.50
## + AMH.ng.mL.              1   105.56 143.56
## + BMI                     1   105.73 143.73
## - Fast.food..Y.N.         1   109.75 143.75
## + Marraige.Status..Yrs.   1   105.83 143.83
## - PRG.ng.mL.              1   109.86 143.86
## - No..of.aborptions       1   110.30 144.30
## + Pulse.rate.bpm.         1   106.40 144.40
## + Pregnant.Y.N.           1   106.43 144.43
## + Reg.Exercise.Y.N.       1   106.44 144.44
## - Cycle.R.I.              1   110.59 144.59
## + Avg..F.size..L...mm.    1   106.62 144.62
## + Cycle.length.days.      1   106.77 144.77
## + BP._Systolic..mmHg.     1   106.82 144.82
## + Hb.g.dl.                1   106.87 144.87
## + Hip.inch.               1   106.88 144.88
## + Age..yrs.               1   106.91 144.91
## + Weight..Kg.             1   106.96 144.96
## + Endometrium..mm.        1   107.02 145.02
## + I...beta.HCG.mIU.mL.    1   107.08 145.08
## - Pimples.Y.N.            1   111.09 145.09
## + Waist.inch.             1   107.16 145.16
## + FSH.mIU.mL.             1   107.18 145.18
## + RR..breaths.min.        1   107.20 145.20
## + Height.Cm.              1   107.26 145.26
## + II....beta.HCG.mIU.mL.  1   107.26 145.26
## + Vit.D3..ng.mL.          1   107.31 145.31
## + Avg..F.size..R...mm.    1   107.32 145.32
## - Hair.loss.Y.N.          1   113.31 147.31
## - BP._Diastolic..mmHg.    1   113.94 147.94
## - RBS.mg.dl.              1   114.06 148.06
## - Skin.darkening..Y.N.    1   115.96 149.96
## - hair.growth.Y.N.        1   120.30 154.29
## - LH.mIU.mL.              1   124.75 158.75
## - Weight.gain.Y.N.        1   130.10 164.10
## - Follicle.No...R.        1   185.92 219.92
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## 
## Step:  AIC=142.92
## PCOS..Y.N. ~ Blood.Group + Cycle.R.I. + No..of.aborptions + LH.mIU.mL. + 
##     TSH..mIU.L. + PRG.ng.mL. + RBS.mg.dl. + Weight.gain.Y.N. + 
##     hair.growth.Y.N. + Skin.darkening..Y.N. + Hair.loss.Y.N. + 
##     Pimples.Y.N. + Fast.food..Y.N. + BP._Diastolic..mmHg. + Follicle.No...L. + 
##     Follicle.No...R.
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
##                          Df Deviance    AIC
## - Blood.Group             1   110.66 142.66
## - Follicle.No...L.        1   110.88 142.88
## <none>                        108.92 142.92
## - PRG.ng.mL.              1   111.14 143.14
## + PRL.ng.mL.              1   107.32 143.32
## - TSH..mIU.L.             1   111.42 143.42
## - Fast.food..Y.N.         1   111.44 143.44
## + BMI                     1   107.61 143.61
## + AMH.ng.mL.              1   107.63 143.63
## + Reg.Exercise.Y.N.       1   107.71 143.71
## + Pulse.rate.bpm.         1   107.80 143.80
## + Pregnant.Y.N.           1   107.88 143.88
## + Marraige.Status..Yrs.   1   108.04 144.04
## - No..of.aborptions       1   112.10 144.10
## - Cycle.R.I.              1   112.22 144.22
## + Avg..F.size..L...mm.    1   108.26 144.26
## + Age..yrs.               1   108.34 144.34
## + Weight..Kg.             1   108.36 144.36
## + Cycle.length.days.      1   108.37 144.37
## + BP._Systolic..mmHg.     1   108.38 144.38
## + Hip.inch.               1   108.41 144.41
## + Endometrium..mm.        1   108.45 144.45
## + Hb.g.dl.                1   108.54 144.54
## - Pimples.Y.N.            1   112.58 144.59
## + I...beta.HCG.mIU.mL.    1   108.60 144.60
## + FSH.mIU.mL.             1   108.75 144.75
## + Waist.inch.             1   108.80 144.80
## + RR..breaths.min.        1   108.81 144.81
## + Height.Cm.              1   108.82 144.82
## + II....beta.HCG.mIU.mL.  1   108.89 144.89
## + Vit.D3..ng.mL.          1   108.91 144.91
## + Avg..F.size..R...mm.    1   108.92 144.92
## - Hair.loss.Y.N.          1   114.54 146.54
## - RBS.mg.dl.              1   115.03 147.03
## - BP._Diastolic..mmHg.    1   115.28 147.28
## - Skin.darkening..Y.N.    1   117.60 149.60
## - hair.growth.Y.N.        1   122.64 154.64
## - LH.mIU.mL.              1   126.71 158.71
## - Weight.gain.Y.N.        1   132.03 164.03
## - Follicle.No...R.        1   186.57 218.57
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## 
## Step:  AIC=142.66
## PCOS..Y.N. ~ Cycle.R.I. + No..of.aborptions + LH.mIU.mL. + TSH..mIU.L. + 
##     PRG.ng.mL. + RBS.mg.dl. + Weight.gain.Y.N. + hair.growth.Y.N. + 
##     Skin.darkening..Y.N. + Hair.loss.Y.N. + Pimples.Y.N. + Fast.food..Y.N. + 
##     BP._Diastolic..mmHg. + Follicle.No...L. + Follicle.No...R.
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
##                          Df Deviance    AIC
## - Fast.food..Y.N.         1   112.53 142.53
## <none>                        110.66 142.66
## + Blood.Group             1   108.92 142.92
## + PRL.ng.mL.              1   109.06 143.06
## - Follicle.No...L.        1   113.17 143.17
## + Reg.Exercise.Y.N.       1   109.19 143.19
## + Pregnant.Y.N.           1   109.25 143.25
## + AMH.ng.mL.              1   109.43 143.43
## - PRG.ng.mL.              1   113.49 143.49
## + BMI                     1   109.49 143.49
## + Marraige.Status..Yrs.   1   109.57 143.57
## + Pulse.rate.bpm.         1   109.60 143.60
## - No..of.aborptions       1   113.63 143.63
## - TSH..mIU.L.             1   113.65 143.65
## + Cycle.length.days.      1   109.92 143.92
## + Age..yrs.               1   109.93 143.93
## + Endometrium..mm.        1   110.06 144.06
## + Hb.g.dl.                1   110.06 144.06
## + FSH.mIU.mL.             1   110.11 144.11
## + Hip.inch.               1   110.18 144.18
## + Weight..Kg.             1   110.28 144.28
## + BP._Systolic..mmHg.     1   110.34 144.34
## + Avg..F.size..L...mm.    1   110.44 144.44
## + I...beta.HCG.mIU.mL.    1   110.49 144.49
## + Waist.inch.             1   110.54 144.54
## + RR..breaths.min.        1   110.55 144.55
## + II....beta.HCG.mIU.mL.  1   110.56 144.56
## + Height.Cm.              1   110.56 144.56
## + Avg..F.size..R...mm.    1   110.60 144.60
## + Vit.D3..ng.mL.          1   110.66 144.66
## - Pimples.Y.N.            1   114.69 144.69
## - Cycle.R.I.              1   115.77 145.77
## - RBS.mg.dl.              1   116.47 146.47
## - Hair.loss.Y.N.          1   116.89 146.89
## - BP._Diastolic..mmHg.    1   117.17 147.17
## - Skin.darkening..Y.N.    1   119.63 149.63
## - hair.growth.Y.N.        1   123.73 153.73
## - LH.mIU.mL.              1   126.94 156.94
## - Weight.gain.Y.N.        1   132.85 162.85
## - Follicle.No...R.        1   186.58 216.58
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## 
## Step:  AIC=142.52
## PCOS..Y.N. ~ Cycle.R.I. + No..of.aborptions + LH.mIU.mL. + TSH..mIU.L. + 
##     PRG.ng.mL. + RBS.mg.dl. + Weight.gain.Y.N. + hair.growth.Y.N. + 
##     Skin.darkening..Y.N. + Hair.loss.Y.N. + Pimples.Y.N. + BP._Diastolic..mmHg. + 
##     Follicle.No...L. + Follicle.No...R.
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
##                          Df Deviance    AIC
## <none>                        112.53 142.53
## + Fast.food..Y.N.         1   110.66 142.66
## + Reg.Exercise.Y.N.       1   110.69 142.69
## - Follicle.No...L.        1   114.70 142.70
## + PRL.ng.mL.              1   110.75 142.75
## + Pregnant.Y.N.           1   110.75 142.75
## - PRG.ng.mL.              1   114.97 142.97
## + AMH.ng.mL.              1   111.03 143.03
## + Pulse.rate.bpm.         1   111.28 143.28
## - TSH..mIU.L.             1   115.34 143.34
## + Blood.Group             1   111.44 143.44
## + Endometrium..mm.        1   111.50 143.50
## - No..of.aborptions       1   115.51 143.51
## + BMI                     1   111.54 143.54
## + Marraige.Status..Yrs.   1   111.79 143.79
## + Cycle.length.days.      1   111.80 143.80
## + FSH.mIU.mL.             1   111.98 143.98
## + Age..yrs.               1   112.09 144.09
## + Hb.g.dl.                1   112.10 144.10
## + BP._Systolic..mmHg.     1   112.13 144.13
## + Hip.inch.               1   112.16 144.16
## + I...beta.HCG.mIU.mL.    1   112.21 144.21
## + Weight..Kg.             1   112.29 144.29
## + Height.Cm.              1   112.40 144.40
## + Avg..F.size..R...mm.    1   112.41 144.41
## + Avg..F.size..L...mm.    1   112.41 144.41
## + II....beta.HCG.mIU.mL.  1   112.45 144.45
## + Waist.inch.             1   112.46 144.46
## + RR..breaths.min.        1   112.50 144.50
## + Vit.D3..ng.mL.          1   112.52 144.52
## - Pimples.Y.N.            1   116.89 144.89
## - RBS.mg.dl.              1   117.98 145.98
## - BP._Diastolic..mmHg.    1   118.04 146.04
## - Cycle.R.I.              1   118.65 146.65
## - Hair.loss.Y.N.          1   119.48 147.48
## - Skin.darkening..Y.N.    1   122.63 150.63
## - hair.growth.Y.N.        1   126.86 154.86
## - LH.mIU.mL.              1   127.69 155.69
## - Weight.gain.Y.N.        1   136.31 164.31
## - Follicle.No...R.        1   188.47 216.47
summary(logit.step)
## 
## Call:
## glm(formula = PCOS..Y.N. ~ Cycle.R.I. + No..of.aborptions + LH.mIU.mL. + 
##     TSH..mIU.L. + PRG.ng.mL. + RBS.mg.dl. + Weight.gain.Y.N. + 
##     hair.growth.Y.N. + Skin.darkening..Y.N. + Hair.loss.Y.N. + 
##     Pimples.Y.N. + BP._Diastolic..mmHg. + Follicle.No...L. + 
##     Follicle.No...R., family = "binomial", data = train.df1)
## 
## Coefficients:
##                      Estimate Std. Error z value Pr(>|z|)    
## (Intercept)          -8.86317    4.90312  -1.808 0.070659 .  
## Cycle.R.I.            0.73633    0.31375   2.347 0.018932 *  
## No..of.aborptions    -0.95178    0.62718  -1.518 0.129131    
## LH.mIU.mL.            0.23828    0.11015   2.163 0.030522 *  
## TSH..mIU.L.           0.20029    0.10380   1.930 0.053665 .  
## PRG.ng.mL.           -0.49223    0.96726  -0.509 0.610829    
## RBS.mg.dl.            0.04565    0.01986   2.298 0.021557 *  
## Weight.gain.Y.N.      2.72560    0.64070   4.254 2.10e-05 ***
## hair.growth.Y.N.      2.23442    0.62730   3.562 0.000368 ***
## Skin.darkening..Y.N.  1.74553    0.57176   3.053 0.002266 ** 
## Hair.loss.Y.N.        1.50611    0.59923   2.513 0.011957 *  
## Pimples.Y.N.          1.08065    0.53172   2.032 0.042117 *  
## BP._Diastolic..mmHg. -0.13473    0.05959  -2.261 0.023770 *  
## Follicle.No...L.      0.14423    0.09891   1.458 0.144779    
## Follicle.No...R.      0.75502    0.12535   6.023 1.71e-09 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 463.92  on 374  degrees of freedom
## Residual deviance: 112.52  on 360  degrees of freedom
## AIC: 142.52
## 
## Number of Fisher Scoring iterations: 9

Eliminate less significant variables and multicollinearity to stabilize the model.

Like BMI, RR..breaths.min., Hb.g.dl., Cycle.length.days., PRG.ng.mL., Fast.food..Y.N.

formula(logit.step)
## PCOS..Y.N. ~ Cycle.R.I. + No..of.aborptions + LH.mIU.mL. + TSH..mIU.L. + 
##     PRG.ng.mL. + RBS.mg.dl. + Weight.gain.Y.N. + hair.growth.Y.N. + 
##     Skin.darkening..Y.N. + Hair.loss.Y.N. + Pimples.Y.N. + BP._Diastolic..mmHg. + 
##     Follicle.No...L. + Follicle.No...R.
# Logistic regression with the same predictors as your poly linear model
logit.pcos2 <- glm(PCOS..Y.N. ~ Pulse.rate.bpm. + Cycle.R.I. + Pregnant.Y.N. + LH.mIU.mL. + Weight.gain.Y.N. +                                      hair.growth.Y.N. + Skin.darkening..Y.N. + Pimples.Y.N. + Reg.Exercise.Y.N. +                                        Follicle.No...L. + Follicle.No...R. + Endometrium..mm., 
                  data   = train.df1, family = "binomial" )
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
summary(logit.pcos2)
## 
## Call:
## glm(formula = PCOS..Y.N. ~ Pulse.rate.bpm. + Cycle.R.I. + Pregnant.Y.N. + 
##     LH.mIU.mL. + Weight.gain.Y.N. + hair.growth.Y.N. + Skin.darkening..Y.N. + 
##     Pimples.Y.N. + Reg.Exercise.Y.N. + Follicle.No...L. + Follicle.No...R. + 
##     Endometrium..mm., family = "binomial", data = train.df1)
## 
## Coefficients:
##                       Estimate Std. Error z value Pr(>|z|)    
## (Intercept)          -24.70591    7.05237  -3.503 0.000460 ***
## Pulse.rate.bpm.        0.16303    0.08796   1.853 0.063813 .  
## Cycle.R.I.             0.45337    0.26848   1.689 0.091285 .  
## Pregnant.Y.N.         -0.81821    0.53438  -1.531 0.125737    
## LH.mIU.mL.             0.17486    0.09868   1.772 0.076393 .  
## Weight.gain.Y.N.       2.57538    0.58908   4.372 1.23e-05 ***
## hair.growth.Y.N.       2.14870    0.55421   3.877 0.000106 ***
## Skin.darkening..Y.N.   1.23399    0.52253   2.362 0.018197 *  
## Pimples.Y.N.           0.97177    0.48580   2.000 0.045462 *  
## Reg.Exercise.Y.N.      0.46770    0.54348   0.861 0.389474    
## Follicle.No...L.       0.12500    0.08983   1.392 0.164037    
## Follicle.No...R.       0.63590    0.10053   6.326 2.52e-10 ***
## Endometrium..mm.       0.17333    0.10982   1.578 0.114479    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 463.92  on 374  degrees of freedom
## Residual deviance: 125.68  on 362  degrees of freedom
## AIC: 151.68
## 
## Number of Fisher Scoring iterations: 9
# Predicted probabilities of PCOS = 1
logit.pcos.prob <- predict(logit.pcos2,
                           newdata = valid.df1,
                           type = "response")
head(logit.pcos.prob)
##            1            2            3            4            5            6 
## 1.411774e-03 7.840105e-05 5.683765e-05 1.842100e-02 1.758936e-02 2.560217e-02
# Convert probabilities to class labels
logit.pcos.class <- ifelse(logit.pcos.prob > 0.5, 1, 0)

confusionMatrix(
  as.factor(logit.pcos.class),
  as.factor(valid.df1$PCOS..Y.N.),
  positive = "1"
)
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction   0   1
##          0 102  15
##          1   1  44
##                                           
##                Accuracy : 0.9012          
##                  95% CI : (0.8446, 0.9425)
##     No Information Rate : 0.6358          
##     P-Value [Acc > NIR] : 1.136e-14       
##                                           
##                   Kappa : 0.7754          
##                                           
##  Mcnemar's Test P-Value : 0.001154        
##                                           
##             Sensitivity : 0.7458          
##             Specificity : 0.9903          
##          Pos Pred Value : 0.9778          
##          Neg Pred Value : 0.8718          
##              Prevalence : 0.3642          
##          Detection Rate : 0.2716          
##    Detection Prevalence : 0.2778          
##       Balanced Accuracy : 0.8680          
##                                           
##        'Positive' Class : 1               
## 
df_pcos <- data.frame(
  actual    = valid.df1$PCOS..Y.N.,
  predicted = logit.pcos.prob
)

roc_pcos <- roc(df_pcos$actual, df_pcos$predicted)
## Setting levels: control = 0, case = 1
## Setting direction: controls < cases
plot.roc(roc_pcos,
         main = "ROC Curve – PCOS Logistic Model")

auc(roc_pcos)   # AUC value
## Area under the curve: 0.935
#specificity = 1-FPR
#sensitivity = TP/(TP+FN)

KNN Classifier model


set.seed(4)
# pick predictors + target
pcos_cols <- c("PCOS..Y.N.","Age..yrs.","Weight..Kg.","Height.Cm.","BMI","Blood.Group",
  "Pulse.rate.bpm.","RR..breaths.min.","Hb.g.dl.","Cycle.R.I.",
  "Cycle.length.days.","Marraige.Status..Yrs.","Pregnant.Y.N.",
  "No..of.aborptions","I...beta.HCG.mIU.mL.","II....beta.HCG.mIU.mL.",
  "FSH.mIU.mL.","LH.mIU.mL.","Hip.inch.","Waist.inch.",
  "TSH..mIU.L.","AMH.ng.mL.","PRL.ng.mL.",
  "Vit.D3..ng.mL.","PRG.ng.mL.","RBS.mg.dl.","Weight.gain.Y.N.",
  "hair.growth.Y.N.","Skin.darkening..Y.N.","Hair.loss.Y.N.","Pimples.Y.N.",
  "Fast.food..Y.N.","Reg.Exercise.Y.N.","BP._Systolic..mmHg.",
  "BP._Diastolic..mmHg.","Follicle.No...L.","Follicle.No...R.",
  "Avg..F.size..L...mm.","Avg..F.size..R...mm.","Endometrium..mm.")

train.knn <- train.df1[, pcos_cols]
valid.knn <- valid.df1[, pcos_cols]

# ensure target is factor
train.knn$PCOS..Y.N. <- as.factor(train.knn$PCOS..Y.N.)
valid.knn$PCOS..Y.N. <- as.factor(valid.knn$PCOS..Y.N.)

# convert Y/N predictors to numeric 0/1 if they are factors
yn_cols <- c("Pregnant.Y.N.", "Weight.gain.Y.N.", "hair.growth.Y.N.",
             "Skin.darkening..Y.N.", "Hair.loss.Y.N.", "Pimples.Y.N.",
             "Fast.food..Y.N.", "Reg.Exercise.Y.N.")

for (v in yn_cols) {
  if (is.factor(train.knn[[v]])) {
    train.knn[[v]] <- as.numeric(as.character(train.knn[[v]]))
    valid.knn[[v]] <- as.numeric(as.character(valid.knn[[v]]))
  }
}

# normalize numeric predictors using training min/max
num_cols <- sapply(train.knn, is.numeric)
norm_cols <- names(train.knn)[num_cols]
norm_cols <- setdiff(norm_cols, "PCOS..Y.N.")  # don't scale target

normalize <- function(x, minx, maxx) (x - minx) / (maxx - minx)

train.norm <- train.knn
valid.norm <- valid.knn

for (v in norm_cols) {
  mn <- min(train.knn[[v]], na.rm = TRUE)
  mx <- max(train.knn[[v]], na.rm = TRUE)
  train.norm[[v]] <- normalize(train.knn[[v]], mn, mx)
  valid.norm[[v]] <- normalize(valid.knn[[v]], mn, mx)
}
# features (all predictors) and class
train.x <- train.norm[, norm_cols]
valid.x <- valid.norm[, norm_cols]
train.y <- train.norm$PCOS..Y.N.

set.seed(41)
knn.pred <- knn(train = train.x,
                test  = valid.x,
                cl    = train.y,
                k     = 5)

confusionMatrix(knn.pred, valid.norm$PCOS..Y.N., positive = "1")
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction  0  1
##          0 96 20
##          1  7 39
##                                           
##                Accuracy : 0.8333          
##                  95% CI : (0.7669, 0.8872)
##     No Information Rate : 0.6358          
##     P-Value [Acc > NIR] : 2.555e-08       
##                                           
##                   Kappa : 0.6223          
##                                           
##  Mcnemar's Test P-Value : 0.02092         
##                                           
##             Sensitivity : 0.6610          
##             Specificity : 0.9320          
##          Pos Pred Value : 0.8478          
##          Neg Pred Value : 0.8276          
##              Prevalence : 0.3642          
##          Detection Rate : 0.2407          
##    Detection Prevalence : 0.2840          
##       Balanced Accuracy : 0.7965          
##                                           
##        'Positive' Class : 1               
## 
accuracy.df <- data.frame(k = 1:20, accuracy = NA)

for (i in 1:20) {
  set.seed(1)
  knn.pred <- knn(train = train.x,
                  test  = valid.x,
                  cl    = train.y,
                  k     = i)
  accuracy.df$accuracy[i] <-
    confusionMatrix(knn.pred, valid.norm$PCOS..Y.N., positive = "1")$overall["Accuracy"]
}

accuracy.df
##     k  accuracy
## 1   1 0.8148148
## 2   2 0.7777778
## 3   3 0.8271605
## 4   4 0.8271605
## 5   5 0.8333333
## 6   6 0.8395062
## 7   7 0.8456790
## 8   8 0.8271605
## 9   9 0.8518519
## 10 10 0.8580247
## 11 11 0.8518519
## 12 12 0.8395062
## 13 13 0.8395062
## 14 14 0.8333333
## 15 15 0.8148148
## 16 16 0.8271605
## 17 17 0.8271605
## 18 18 0.8271605
## 19 19 0.8395062
## 20 20 0.8395062
ggplot(accuracy.df, aes(x = k, y = accuracy)) +
  geom_line() +
  geom_point() +
  scale_x_continuous(breaks = 1:20) +
  labs(title = "KNN Accuracy for Different K (PCOS)",
       x = "K (Number of Neighbors)",
       y = "Validation Accuracy") +
  theme_minimal()


Classification Tree Model


library(tree)
## Warning: package 'tree' was built under R version 4.5.2
library(ISLR)
library(rpart)
library(rpart.plot)
## Warning: package 'rpart.plot' was built under R version 4.5.2
# Make sure outcome is factor (0/1 → classification)
datafpc1$PCOS..Y.N. <- as.factor(datafpc1$PCOS..Y.N.)

tree.pcos <- rpart(
  PCOS..Y.N. ~  Age..yrs. + Weight..Kg. + Height.Cm. + BMI + Blood.Group +   Pulse.rate.bpm. +  RR..breaths.min.                    + Hb.g.dl. + Cycle.R.I. + Cycle.length.days. + Marraige.Status..Yrs. + Pregnant.Y.N. +                       No..of.aborptions + I...beta.HCG.mIU.mL. + II....beta.HCG.mIU.mL. + FSH.mIU.mL. + LH.mIU.mL. +
                    Hip.inch. + Waist.inch. + TSH..mIU.L. + AMH.ng.mL. + PRL.ng.mL. + Vit.D3..ng.mL. +                            PRG.ng.mL. + RBS.mg.dl. + Weight.gain.Y.N. + hair.growth.Y.N. + Skin.darkening..Y.N. +
                    Hair.loss.Y.N. + Pimples.Y.N. + Fast.food..Y.N. + Reg.Exercise.Y.N. + BP._Systolic..mmHg. +
                   BP._Diastolic..mmHg. + Follicle.No...L. + Follicle.No...R. + Avg..F.size..L...mm. +
                      Avg..F.size..R...mm. + Endometrium..mm., data   = train.df1, method = "class" )

summary(tree.pcos)
## Call:
## rpart(formula = PCOS..Y.N. ~ Age..yrs. + Weight..Kg. + Height.Cm. + 
##     BMI + Blood.Group + Pulse.rate.bpm. + RR..breaths.min. + 
##     Hb.g.dl. + Cycle.R.I. + Cycle.length.days. + Marraige.Status..Yrs. + 
##     Pregnant.Y.N. + No..of.aborptions + I...beta.HCG.mIU.mL. + 
##     II....beta.HCG.mIU.mL. + FSH.mIU.mL. + LH.mIU.mL. + Hip.inch. + 
##     Waist.inch. + TSH..mIU.L. + AMH.ng.mL. + PRL.ng.mL. + Vit.D3..ng.mL. + 
##     PRG.ng.mL. + RBS.mg.dl. + Weight.gain.Y.N. + hair.growth.Y.N. + 
##     Skin.darkening..Y.N. + Hair.loss.Y.N. + Pimples.Y.N. + Fast.food..Y.N. + 
##     Reg.Exercise.Y.N. + BP._Systolic..mmHg. + BP._Diastolic..mmHg. + 
##     Follicle.No...L. + Follicle.No...R. + Avg..F.size..L...mm. + 
##     Avg..F.size..R...mm. + Endometrium..mm., data = train.df1, 
##     method = "class")
##   n= 375 
## 
##           CP nsplit rel error    xerror       xstd
## 1 0.50000000      0 1.0000000 1.0000000 0.07716232
## 2 0.07758621      1 0.5000000 0.5689655 0.06357371
## 3 0.02155172      3 0.3448276 0.4396552 0.05722476
## 4 0.01724138      5 0.3017241 0.4741379 0.05905854
## 5 0.01293103      6 0.2844828 0.4827586 0.05949983
## 6 0.01000000      8 0.2586207 0.4913793 0.05993457
## 
## Variable importance
##       Follicle.No...R.       Follicle.No...L.              Hip.inch. 
##                     30                     19                      6 
##       hair.growth.Y.N.       Weight.gain.Y.N.   Skin.darkening..Y.N. 
##                      6                      6                      5 
##            Weight..Kg.           Pimples.Y.N.        Fast.food..Y.N. 
##                      5                      3                      3 
##              Age..yrs.             Cycle.R.I.     Cycle.length.days. 
##                      2                      2                      2 
##                    BMI            Waist.inch.   I...beta.HCG.mIU.mL. 
##                      2                      2                      2 
##       Endometrium..mm.   Avg..F.size..L...mm.             LH.mIU.mL. 
##                      1                      1                      1 
## II....beta.HCG.mIU.mL.  Marraige.Status..Yrs.         Vit.D3..ng.mL. 
##                      1                      1                      1 
##   Avg..F.size..R...mm. 
##                      1 
## 
## Node number 1: 375 observations,    complexity param=0.5
##   predicted class=0  expected loss=0.3093333  P(node) =1
##     class counts:   259   116
##    probabilities: 0.691 0.309 
##   left son=2 (237 obs) right son=3 (138 obs)
##   Primary splits:
##       Follicle.No...R.     < 7.5      to the left,  improve=70.15725, (0 missing)
##       Follicle.No...L.     < 8.5      to the left,  improve=49.28978, (0 missing)
##       hair.growth.Y.N.     < 0.5      to the left,  improve=38.73654, (0 missing)
##       Skin.darkening..Y.N. < 0.5      to the left,  improve=33.29539, (0 missing)
##       Weight.gain.Y.N.     < 0.5      to the left,  improve=27.88715, (0 missing)
##   Surrogate splits:
##       Follicle.No...L.     < 6.5      to the left,  agree=0.832, adj=0.543, (0 split)
##       Skin.darkening..Y.N. < 0.5      to the left,  agree=0.696, adj=0.174, (0 split)
##       hair.growth.Y.N.     < 0.5      to the left,  agree=0.680, adj=0.130, (0 split)
##       Age..yrs.            < 24.5     to the right, agree=0.659, adj=0.072, (0 split)
##       Cycle.length.days.   < 4.5      to the right, agree=0.656, adj=0.065, (0 split)
## 
## Node number 2: 237 observations,    complexity param=0.02155172
##   predicted class=0  expected loss=0.07594937  P(node) =0.632
##     class counts:   219    18
##    probabilities: 0.924 0.076 
##   left son=4 (192 obs) right son=5 (45 obs)
##   Primary splits:
##       hair.growth.Y.N. < 0.5      to the left,  improve=5.037351, (0 missing)
##       LH.mIU.mL.       < 5.46     to the left,  improve=3.329219, (0 missing)
##       AMH.ng.mL.       < 17.35    to the left,  improve=3.306853, (0 missing)
##       Follicle.No...R. < 5.5      to the left,  improve=2.551673, (0 missing)
##       Hip.inch.        < 44.5     to the left,  improve=2.540677, (0 missing)
##   Surrogate splits:
##       Waist.inch.    < 40.5     to the left,  agree=0.819, adj=0.044, (0 split)
##       PRG.ng.mL.     < 0.13     to the right, agree=0.819, adj=0.044, (0 split)
##       BMI            < 32.84121 to the left,  agree=0.814, adj=0.022, (0 split)
##       Vit.D3..ng.mL. < 61.65    to the left,  agree=0.814, adj=0.022, (0 split)
## 
## Node number 3: 138 observations,    complexity param=0.07758621
##   predicted class=1  expected loss=0.2898551  P(node) =0.368
##     class counts:    40    98
##    probabilities: 0.290 0.710 
##   left son=6 (67 obs) right son=7 (71 obs)
##   Primary splits:
##       Weight.gain.Y.N.     < 0.5      to the left,  improve=14.082980, (0 missing)
##       Skin.darkening..Y.N. < 0.5      to the left,  improve=12.064910, (0 missing)
##       hair.growth.Y.N.     < 0.5      to the left,  improve=11.879530, (0 missing)
##       Fast.food..Y.N.      < 0.5      to the left,  improve= 8.306140, (0 missing)
##       Cycle.R.I.           < 3        to the left,  improve= 7.935701, (0 missing)
##   Surrogate splits:
##       Hip.inch.       < 36.5     to the left,  agree=0.688, adj=0.358, (0 split)
##       Fast.food..Y.N. < 0.5      to the left,  agree=0.688, adj=0.358, (0 split)
##       Weight..Kg.     < 61.9     to the left,  agree=0.681, adj=0.343, (0 split)
##       Cycle.R.I.      < 3        to the left,  agree=0.681, adj=0.343, (0 split)
##       Pimples.Y.N.    < 0.5      to the left,  agree=0.681, adj=0.343, (0 split)
## 
## Node number 4: 192 observations
##   predicted class=0  expected loss=0.02604167  P(node) =0.512
##     class counts:   187     5
##    probabilities: 0.974 0.026 
## 
## Node number 5: 45 observations,    complexity param=0.02155172
##   predicted class=0  expected loss=0.2888889  P(node) =0.12
##     class counts:    32    13
##    probabilities: 0.711 0.289 
##   left son=10 (38 obs) right son=11 (7 obs)
##   Primary splits:
##       Follicle.No...L.     < 7.5      to the left,  improve=5.353551, (0 missing)
##       Follicle.No...R.     < 5.5      to the left,  improve=5.092576, (0 missing)
##       Fast.food..Y.N.      < 0.5      to the left,  improve=5.007407, (0 missing)
##       Hair.loss.Y.N.       < 0.5      to the left,  improve=3.266667, (0 missing)
##       Avg..F.size..R...mm. < 16.5     to the right, improve=2.892250, (0 missing)
##   Surrogate splits:
##       Follicle.No...R. < 6.5      to the left,  agree=0.889, adj=0.286, (0 split)
##       LH.mIU.mL.       < 0.15     to the right, agree=0.867, adj=0.143, (0 split)
##       Hip.inch.        < 44.5     to the left,  agree=0.867, adj=0.143, (0 split)
## 
## Node number 6: 67 observations,    complexity param=0.07758621
##   predicted class=0  expected loss=0.4776119  P(node) =0.1786667
##     class counts:    35    32
##    probabilities: 0.522 0.478 
##   left son=12 (36 obs) right son=13 (31 obs)
##   Primary splits:
##       Hip.inch.        < 37       to the right, improve=8.061868, (0 missing)
##       Weight..Kg.      < 55.5     to the right, improve=7.104908, (0 missing)
##       Follicle.No...R. < 13.5     to the left,  improve=7.046871, (0 missing)
##       Waist.inch.      < 33.5     to the right, improve=6.258148, (0 missing)
##       hair.growth.Y.N. < 0.5      to the left,  improve=5.926453, (0 missing)
##   Surrogate splits:
##       Weight..Kg.          < 55.5     to the right, agree=0.836, adj=0.645, (0 split)
##       Waist.inch.          < 33.5     to the right, agree=0.761, adj=0.484, (0 split)
##       I...beta.HCG.mIU.mL. < 182.68   to the left,  agree=0.731, adj=0.419, (0 split)
##       BMI                  < 22.35    to the right, agree=0.716, adj=0.387, (0 split)
##       Endometrium..mm.     < 9.45     to the left,  agree=0.716, adj=0.387, (0 split)
## 
## Node number 7: 71 observations
##   predicted class=1  expected loss=0.07042254  P(node) =0.1893333
##     class counts:     5    66
##    probabilities: 0.070 0.930 
## 
## Node number 10: 38 observations,    complexity param=0.01293103
##   predicted class=0  expected loss=0.1842105  P(node) =0.1013333
##     class counts:    31     7
##    probabilities: 0.816 0.184 
##   left son=20 (18 obs) right son=21 (20 obs)
##   Primary splits:
##       Fast.food..Y.N.      < 0.5      to the left,  improve=2.321053, (0 missing)
##       Follicle.No...R.     < 5.5      to the left,  improve=2.021053, (0 missing)
##       Avg..F.size..R...mm. < 16.5     to the right, improve=1.681922, (0 missing)
##       Weight..Kg.          < 68.5     to the left,  improve=1.597298, (0 missing)
##       Avg..F.size..L...mm. < 12.5     to the right, improve=1.597298, (0 missing)
##   Surrogate splits:
##       Follicle.No...L. < 3.5      to the left,  agree=0.737, adj=0.444, (0 split)
##       BMI              < 25.16654 to the left,  agree=0.711, adj=0.389, (0 split)
##       Follicle.No...R. < 3.5      to the left,  agree=0.711, adj=0.389, (0 split)
##       Weight..Kg.      < 60.5     to the left,  agree=0.684, adj=0.333, (0 split)
##       Hip.inch.        < 39.5     to the left,  agree=0.684, adj=0.333, (0 split)
## 
## Node number 11: 7 observations
##   predicted class=1  expected loss=0.1428571  P(node) =0.01866667
##     class counts:     1     6
##    probabilities: 0.143 0.857 
## 
## Node number 12: 36 observations,    complexity param=0.01724138
##   predicted class=0  expected loss=0.25  P(node) =0.096
##     class counts:    27     9
##    probabilities: 0.750 0.250 
##   left son=24 (28 obs) right son=25 (8 obs)
##   Primary splits:
##       Pimples.Y.N.         < 0.5      to the left,  improve=2.892857, (0 missing)
##       LH.mIU.mL.           < 0.96     to the right, improve=2.250000, (0 missing)
##       Follicle.No...R.     < 10.5     to the left,  improve=2.250000, (0 missing)
##       Skin.darkening..Y.N. < 0.5      to the left,  improve=2.240741, (0 missing)
##       PRG.ng.mL.           < 0.37     to the right, improve=1.980000, (0 missing)
##   Surrogate splits:
##       Follicle.No...L.       < 12.5     to the left,  agree=0.833, adj=0.250, (0 split)
##       Marraige.Status..Yrs.  < 12.5     to the left,  agree=0.806, adj=0.125, (0 split)
##       I...beta.HCG.mIU.mL.   < 195.16   to the left,  agree=0.806, adj=0.125, (0 split)
##       II....beta.HCG.mIU.mL. < 215.145  to the left,  agree=0.806, adj=0.125, (0 split)
##       FSH.mIU.mL.            < 1.97     to the right, agree=0.806, adj=0.125, (0 split)
## 
## Node number 13: 31 observations
##   predicted class=1  expected loss=0.2580645  P(node) =0.08266667
##     class counts:     8    23
##    probabilities: 0.258 0.742 
## 
## Node number 20: 18 observations
##   predicted class=0  expected loss=0  P(node) =0.048
##     class counts:    18     0
##    probabilities: 1.000 0.000 
## 
## Node number 21: 20 observations,    complexity param=0.01293103
##   predicted class=0  expected loss=0.35  P(node) =0.05333333
##     class counts:    13     7
##    probabilities: 0.650 0.350 
##   left son=42 (13 obs) right son=43 (7 obs)
##   Primary splits:
##       Avg..F.size..L...mm. < 14.5     to the right, improve=2.858242, (0 missing)
##       Avg..F.size..R...mm. < 17       to the right, improve=2.638462, (0 missing)
##       TSH..mIU.L.          < 2.33     to the left,  improve=2.016667, (0 missing)
##       I...beta.HCG.mIU.mL. < 2.545    to the right, improve=1.382828, (0 missing)
##       Cycle.length.days.   < 5.5      to the left,  improve=1.056044, (0 missing)
##   Surrogate splits:
##       Marraige.Status..Yrs.  < 6.5      to the right, agree=0.8, adj=0.429, (0 split)
##       II....beta.HCG.mIU.mL. < 110.105  to the left,  agree=0.8, adj=0.429, (0 split)
##       LH.mIU.mL.             < 3.68     to the left,  agree=0.8, adj=0.429, (0 split)
##       Vit.D3..ng.mL.         < 47.05    to the left,  agree=0.8, adj=0.429, (0 split)
##       Avg..F.size..R...mm.   < 12.5     to the right, agree=0.8, adj=0.429, (0 split)
## 
## Node number 24: 28 observations
##   predicted class=0  expected loss=0.1428571  P(node) =0.07466667
##     class counts:    24     4
##    probabilities: 0.857 0.143 
## 
## Node number 25: 8 observations
##   predicted class=1  expected loss=0.375  P(node) =0.02133333
##     class counts:     3     5
##    probabilities: 0.375 0.625 
## 
## Node number 42: 13 observations
##   predicted class=0  expected loss=0.1538462  P(node) =0.03466667
##     class counts:    11     2
##    probabilities: 0.846 0.154 
## 
## Node number 43: 7 observations
##   predicted class=1  expected loss=0.2857143  P(node) =0.01866667
##     class counts:     2     5
##    probabilities: 0.286 0.714
# Plot the tree
rpart.plot(tree.pcos,
           type = 1, extra = 1,
           split.font = 1, varlen = -10,
           main = "PCOS Classification Tree")

# Class prediction
tree.pred <- predict(tree.pcos, valid.df1, type = "class")

table(tree.pred,valid.df1$PCOS..Y.N.)
##          
## tree.pred  0  1
##         0 91 15
##         1 12 44
class(tree.pred); levels(tree.pred)
## [1] "factor"
## [1] "0" "1"
class(valid.df1$PCOS..Y.N.); levels(valid.df1$PCOS..Y.N.)
## [1] "numeric"
## NULL
# Force SAME levels for both
valid.df1$PCOS..Y.N. <- factor(valid.df1$PCOS..Y.N., levels = c(0, 1))
tree.pred <- factor(tree.pred, levels = c(0, 1))

# Now this will work
confusionMatrix(
  data      = tree.pred,
  reference = valid.df1$PCOS..Y.N.,
  positive  = "1"
)
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction  0  1
##          0 91 15
##          1 12 44
##                                           
##                Accuracy : 0.8333          
##                  95% CI : (0.7669, 0.8872)
##     No Information Rate : 0.6358          
##     P-Value [Acc > NIR] : 2.555e-08       
##                                           
##                   Kappa : 0.6362          
##                                           
##  Mcnemar's Test P-Value : 0.7003          
##                                           
##             Sensitivity : 0.7458          
##             Specificity : 0.8835          
##          Pos Pred Value : 0.7857          
##          Neg Pred Value : 0.8585          
##              Prevalence : 0.3642          
##          Detection Rate : 0.2716          
##    Detection Prevalence : 0.3457          
##       Balanced Accuracy : 0.8146          
##                                           
##        'Positive' Class : 1               
## 
# ROC curve

# Get class probabilities
tree.prob <- predict(tree.pcos, valid.df1, type = "prob")[, "1"]

roc.tree <- roc(valid.df1$PCOS..Y.N., tree.prob)
## Setting levels: control = 0, case = 1
## Setting direction: controls < cases
plot(roc.tree, main = "Decision Tree ROC Curve")

auc(roc.tree)
## Area under the curve: 0.8726
# Collect metrics for all models
get_class_metrics <- function(actual, predicted_class, predicted_prob = NULL) {
  
  cm <- confusionMatrix(
    factor(predicted_class, levels = c(0,1)),
    factor(actual, levels = c(0,1)),
    positive = "1"
  )
  
  out <- list(
    Accuracy    = cm$overall["Accuracy"],
    Sensitivity = cm$byClass["Sensitivity"],
    Specificity = cm$byClass["Specificity"]
  )
  
  if (!is.null(predicted_prob)) {
    roc_obj <- roc(actual, predicted_prob)
    out$AUC <- auc(roc_obj)
  } else {
    out$AUC <- NA
  }
  
  return(out)
}
# Linear Regression Model (Polynomial deg 3)

valid.df$Predicted <- predict(fitlm2_poly1, valid.df)
valid.df$Pred_Class <- ifelse(valid.df$Predicted >= 0.5, 1, 0)

poly_metrics <- get_class_metrics(
  actual          = valid.df$PCOS..Y.N.,
  predicted_class = valid.df$Pred_Class,
  predicted_prob  = valid.df$Predicted
)
## Setting levels: control = 0, case = 1
## Setting direction: controls < cases
poly_rmse <- sqrt(mean((valid.df$Predicted - valid.df$PCOS..Y.N.)^2))

# Logistic Regression Model
logit.pcos.prob <- predict(logit.pcos2, valid.df1, type = "response")
logit.class <- ifelse(logit.pcos.prob >= 0.5, 1, 0)

logit_metrics <- get_class_metrics(
  actual          = valid.df1$PCOS..Y.N.,
  predicted_class = logit.class,
  predicted_prob  = logit.pcos.prob
)
## Setting levels: control = 0, case = 1
## Setting direction: controls < cases
# KNN Model
knn_metrics <- get_class_metrics(
  actual          = valid.norm$PCOS..Y.N.,
  predicted_class = knn.pred
)

# Decision Tree Model
tree.pred <- predict(tree.pcos, valid.df1, type = "class")
tree.prob <- predict(tree.pcos, valid.df1, type = "prob")[,"1"]

tree_metrics <- get_class_metrics(
  actual          = valid.df1$PCOS..Y.N.,
  predicted_class = tree.pred,
  predicted_prob  = tree.prob
)
## Setting levels: control = 0, case = 1
## Setting direction: controls < cases
# Combine all metrics into a summary table
model_comparison <- data.frame(
  Model = c(
    "Polynomial Linear Regression",
    "Logistic Regression",
    "KNN Classifier (k = 5)",
    "Decision Tree"
  ),
  Accuracy = c(
    poly_metrics$Accuracy,
    logit_metrics$Accuracy,
    knn_metrics$Accuracy,
    tree_metrics$Accuracy
  ),
  Sensitivity = c(
    poly_metrics$Sensitivity,
    logit_metrics$Sensitivity,
    knn_metrics$Sensitivity,
    tree_metrics$Sensitivity
  ),
  Specificity = c(
    poly_metrics$Specificity,
    logit_metrics$Specificity,
    knn_metrics$Specificity,
    tree_metrics$Specificity
  ),
  AUC = c(
    poly_metrics$AUC,
    logit_metrics$AUC,
    NA,
    tree_metrics$AUC
  ),
  RMSE = c(
    poly_rmse,
    NA,
    NA,
    NA
  )
)
print(model_comparison)
##                          Model  Accuracy Sensitivity Specificity       AUC
## 1 Polynomial Linear Regression 0.8888889   0.7450980   0.9549550 0.9559265
## 2          Logistic Regression 0.9012346   0.7457627   0.9902913 0.9350008
## 3       KNN Classifier (k = 5) 0.8395062   0.6271186   0.9611650        NA
## 4                Decision Tree 0.8333333   0.7457627   0.8834951 0.8725522
##        RMSE
## 1 0.2856368
## 2        NA
## 3        NA
## 4        NA

Yes, the results show that we can build a good PCOS prediction model using easy-to-measure lifestyle and medical information. Models like logistic regression and polynomial regression achieved close to 90% accuracy with good sensitivity and very high specificity. This means they can correctly identify PCOS cases while avoiding many false alarms. Since these models rely on simple measures such as cycle regularity, weight gain, hair growth, and follicle count, they are practical for early screening and awareness without complex tests.