# ---
# title: Health Plan Descriptive Information
# ---

df  <- read.csv("C:/zz/data/csv/Health Plan Descriptive Information.csv")
# attach(df)
summary(df)
##    SubTrendID        OrgID       OrgSubmissionID
##  Min.   : 1001   Min.   :    3   Min.   : 1001  
##  1st Qu.: 2515   1st Qu.:  284   1st Qu.: 3232  
##  Median : 8176   Median : 1695   Median : 8202  
##  Mean   : 6751   Mean   : 5233   Mean   : 7310  
##  3rd Qu.: 9349   3rd Qu.: 9966   3rd Qu.:10485  
##  Max.   :11590   Max.   :22275   Max.   :11590  
##                                                 
##                                                                                    Name     
##  Humana Health Plan of Texas, Inc.                                                   :  36  
##  SHA, LLC dba FIRSTCARE                                                              :  36  
##  Anthem Health Plans Kentucky, Inc. dba Anthem Blue Cross and Blue Shield in Kentucky:  18  
##  Anthem Insurance Companies, Inc. dba Anthem Blue Cross and Blue Shield in Indiana   :  18  
##  Blue Cross and Blue Shield of Vermont                                               :  18  
##  Blue Cross of California dba Anthem Blue Cross                                      :  18  
##  (Other)                                                                             :3366  
##                  ShortName        ProductLine               ReportingProduct
##  Humana Insurance Inc,:  45   Commercial:3510   HMO                 : 468   
##  Coventry Health Care :  36                     HMO/POS Combined    :1224   
##  Humana TX            :  36                     HMO/POS/PPO Combined: 144   
##  SHA FIRSTCARE        :  36                     HMO/PPO Combined    :   9   
##  CH&L                 :  27                     POS                 :   9   
##  PacificSource        :  27                     PPO                 :1656   
##  (Other)              :3303                                                 
##        SpecialArea         SpecialProject
##              :3384                :3384  
##  San Antonio :  18   Accred       :   9  
##  Abilene, TX :   9   Accreditation:   9  
##  Amarillo, TX:   9   MN Commercial:   9  
##  Arizona     :   9   NJ Commercial:   9  
##  Austin      :   9   TX Comm      :  81  
##  (Other)     :  72   TX Commercial:   9  
##                                                         MeasureName  
##  Board Certification - Percent of Family Medicine Physicians  : 390  
##  Board Certification - Percent of Geriatricians               : 390  
##  Board Certification - Percent of Internal Medicine Physicians: 390  
##  Board Certification - Percent of OB/GYNs                     : 390  
##  Board Certification - Percent of Other Physician Specialists : 390  
##  Board Certification - Percent of Pediatricians               : 390  
##  (Other)                                                      :1170  
##    MeasureID     IDSSElementID  MeasureNameAbbreviation      Rate     
##  Min.   : 499   mmftot  : 390   BCR:2340                NR     : 207  
##  1st Qu.: 501   mmmtot  : 390   ENP:1170                ND     :  18  
##  Median :2731   mmttot  : 390                           100.00 :  16  
##  Mean   :1988   pctgerbc: 390                           66.67  :  15  
##  3rd Qu.:2733   pctintbc: 390                           80.00  :   9  
##  Max.   :2735   pctobgbc: 390                           (Other):3233  
##                 (Other) :1170                           NA's   :  12  
##       Year      CollectionMethod UpperConfidenceLevel LowerConfidenceLevel
##  Min.   :2014   Mode:logical     Mode:logical         Mode:logical        
##  1st Qu.:2014   NA's:3510        NA's:3510            NA's:3510           
##  Median :2014                                                             
##  Mean   :2014                                                             
##  3rd Qu.:2014                                                             
##  Max.   :2014                                                             
##                                                                           
##     X          
##  Mode:logical  
##  NA's:3510     
##                
##                
##                
##                
## 
names(df)
##  [1] "SubTrendID"              "OrgID"                  
##  [3] "OrgSubmissionID"         "Name"                   
##  [5] "ShortName"               "ProductLine"            
##  [7] "ReportingProduct"        "SpecialArea"            
##  [9] "SpecialProject"          "MeasureName"            
## [11] "MeasureID"               "IDSSElementID"          
## [13] "MeasureNameAbbreviation" "Rate"                   
## [15] "Year"                    "CollectionMethod"       
## [17] "UpperConfidenceLevel"    "LowerConfidenceLevel"   
## [19] "X"
for (c in 1:ncol(df)) 
  print(head (table(df[c]),20))
## 
## 1001 1069 1125 1134 1144 1151 1154 1157 1161 1163 1202 1204 1236 1292 1344 1366 
##    9    9    9    9    9    9    9    9    9    9    9    9    9    9    9    9 
## 1377 1398 1414 1419 
##    9    9    9    9 
## 
##   3   5   9  10  14  30  31  74  76  79  81  82  83  93  94  98  99 101 102 105 
##   9   9   9   9   9   9   9   9   9   9  18   9  36   9   9   9   9   9   9   9 
## 
## 1001 1069 1134 1144 1151 1154 1157 1161 1163 1202 1204 1236 1292 1366 1377 1398 
##    9    9    9    9    9    9    9    9    9    9    9    9    9    9    9    9 
## 1419 1425 1444 1448 
##    9    9    9    9 
## 
##                   ADVANTAGE Health Solutions, Inc 
##                                                 9 
##                  Aetna Health Inc. - (New Jersey) 
##                                                 9 
##                      Aetna Health Inc.  (Florida) 
##                                                 9 
##                   Aetna Health Inc. (Connecticut) 
##                                                 9 
##                       Aetna Health Inc. (Georgia) 
##                                                 9 
##                         Aetna Health Inc. (Maine) 
##                                                 9 
##                      Aetna Health Inc. (New York) 
##                                                 9 
##                  Aetna Health Inc. (Pennsylvania) 
##                                                 9 
##        Aetna Health Inc. (Pennsylvania) - Arizona 
##                                                 9 
##       Aetna Health Inc. (Pennsylvania) - Colorado 
##                                                 9 
##       Aetna Health Inc. (Pennsylvania) - Delaware 
##                                                 9 
##       Aetna Health Inc. (Pennsylvania) - Illinois 
##                                                 9 
##       Aetna Health Inc. (Pennsylvania) - Maryland 
##                                                 9 
##  Aetna Health Inc. (Pennsylvania) - Massachusetts 
##                                                 9 
##       Aetna Health Inc. (Pennsylvania) - Missouri 
##                                                 9 
## Aetna Health Inc. (Pennsylvania) - North Carolina 
##                                                 9 
##           Aetna Health Inc. (Pennsylvania) - Ohio 
##                                                 9 
##       Aetna Health Inc. (Pennsylvania) - Oklahoma 
##                                                 9 
##      Aetna Health Inc. (Pennsylvania) - Tennessee 
##                                                 9 
##                         Aetna Health Inc. (Texas) 
##                                                 9 
## 
##                686 UHIC AR ADVANTAGE Health Solutions 
##                          9                          9 
##              Aetna Arizona           Aetna California 
##                          9                          9 
##            Aetna Carolinas             Aetna Colorado 
##                          9                          9 
##          Aetna Connecticut             Aetna Delaware 
##                          9                          9 
##              Aetna Florida              Aetna Georgia 
##                          9                          9 
##             Aetna Illinois                Aetna Maine 
##                          9                          9 
##        Aetna Massachusetts             Aetna MD/DC/VA 
##                          9                          9 
##             Aetna Missouri           Aetna New Jersey 
##                          9                          9 
##             Aetna New York                 Aetna Ohio 
##                          9                          9 
##             Aetna Oklahoma         Aetna Pennsylvania 
##                          9                          9 
## Commercial 
##       3510 
## 
##                  HMO     HMO/POS Combined HMO/POS/PPO Combined 
##                  468                 1224                  144 
##     HMO/PPO Combined                  POS                  PPO 
##                    9                    9                 1656 
## 
##                   Abilene, TX   Amarillo, TX        Arizona         Austin 
##           3384              9              9              9              9 
##    Central, TX Corpus Christi        Houston    Indiana PPO         Kansas 
##              9              9              9              9              9 
##    Lubbock, TX    Puerto Rico    San Antonio       Waco, TX 
##              9              9             18              9 
## 
##                      Accred Accreditation MN Commercial NJ Commercial 
##          3384             9             9             9             9 
##       TX Comm TX Commercial 
##            81             9 
## 
##   Board Certification - Percent of Family Medicine Physicians 
##                                                           390 
##                Board Certification - Percent of Geriatricians 
##                                                           390 
## Board Certification - Percent of Internal Medicine Physicians 
##                                                           390 
##                      Board Certification - Percent of OB/GYNs 
##                                                           390 
##  Board Certification - Percent of Other Physician Specialists 
##                                                           390 
##                Board Certification - Percent of Pediatricians 
##                                                           390 
##                           Enrollment By Product Line - Female 
##                                                           390 
##                             Enrollment By Product Line - Male 
##                                                           390 
##                            Enrollment By Product Line - Total 
##                                                           390 
## 
##  499  500  501 2730 2731 2732 2733 2734 2735 
##  390  390  390  390  390  390  390  390  390 
## 
##   mmftot   mmmtot   mmttot pctgerbc pctintbc pctobgbc pctothbc pctpcpbc 
##      390      390      390      390      390      390      390      390 
## pctpedbc 
##      390 
## 
##  BCR  ENP 
## 2340 1170 
## 
##  0.00 1.01M 1.03M 1.06M 1.07M 1.10M 1.11M 1.14M 1.16M 1.19M 1.25M 1.26M 1.27M 
##     4     1     2     1     3     1     1     1     1     1     2     1     1 
## 1.29M 1.34M 1.39M 1.40M 1.53M 1.54M 1.60M 
##     1     1     2     1     2     1     1 
## 2014 
## 3510 
## integer(0)
## integer(0)
## integer(0)
## integer(0)
# rm("df")

# library(Hmisc)
# describe(df)

# 
# library(pastecs)
# stat.desc(df)

# library(psych)
# describe(df)