library(dplyr)
## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
library(MASS)
## 
## Attaching package: 'MASS'
## The following object is masked from 'package:dplyr':
## 
##     select
data("survey")
summary(survey)
##      Sex          Wr.Hnd          NW.Hnd        W.Hnd          Fold    
##  Female:118   Min.   :13.00   Min.   :12.50   Left : 18   L on R : 99  
##  Male  :118   1st Qu.:17.50   1st Qu.:17.50   Right:218   Neither: 18  
##  NA's  :  1   Median :18.50   Median :18.50   NA's :  1   R on L :120  
##               Mean   :18.67   Mean   :18.58                            
##               3rd Qu.:19.80   3rd Qu.:19.73                            
##               Max.   :23.20   Max.   :23.50                            
##               NA's   :1       NA's   :1                                
##      Pulse             Clap       Exer       Smoke         Height     
##  Min.   : 35.00   Left   : 39   Freq:115   Heavy: 11   Min.   :150.0  
##  1st Qu.: 66.00   Neither: 50   None: 24   Never:189   1st Qu.:165.0  
##  Median : 72.50   Right  :147   Some: 98   Occas: 19   Median :171.0  
##  Mean   : 74.15   NA's   :  1              Regul: 17   Mean   :172.4  
##  3rd Qu.: 80.00                            NA's :  1   3rd Qu.:180.0  
##  Max.   :104.00                                        Max.   :200.0  
##  NA's   :45                                            NA's   :28     
##        M.I           Age       
##  Imperial: 68   Min.   :16.75  
##  Metric  :141   1st Qu.:17.67  
##  NA's    : 28   Median :18.58  
##                 Mean   :20.37  
##                 3rd Qu.:20.17  
##                 Max.   :73.00  
## 
mean(survey$Age)
## [1] 20.37451
mean(survey$Pulse)
## [1] NA
veri<-na.omit(survey)
summary(veri)
##      Sex         Wr.Hnd         NW.Hnd        W.Hnd          Fold   
##  Female:84   Min.   :13.0   Min.   :12.50   Left : 12   L on R :72  
##  Male  :84   1st Qu.:17.5   1st Qu.:17.50   Right:156   Neither: 8  
##              Median :18.5   Median :18.50               R on L :88  
##              Mean   :18.8   Mean   :18.73                           
##              3rd Qu.:20.0   3rd Qu.:20.00                           
##              Max.   :23.2   Max.   :23.50                           
##      Pulse             Clap       Exer      Smoke         Height     
##  Min.   : 35.00   Left   : 28   Freq:85   Heavy:  7   Min.   :152.0  
##  1st Qu.: 66.75   Neither: 33   None:14   Never:134   1st Qu.:165.0  
##  Median : 72.00   Right  :107   Some:69   Occas: 13   Median :170.6  
##  Mean   : 74.02                           Regul: 14   Mean   :172.5  
##  3rd Qu.: 80.00                                       3rd Qu.:180.0  
##  Max.   :104.00                                       Max.   :200.0  
##        M.I           Age       
##  Imperial: 58   Min.   :16.92  
##  Metric  :110   1st Qu.:17.67  
##                 Median :18.58  
##                 Mean   :20.43  
##                 3rd Qu.:20.17  
##                 Max.   :70.42
mean(veri$Age)
## [1] 20.43358
mean(veri$Height)
## [1] 172.4763
median(survey$Age)
## [1] 18.583
library(lsr)
modeOf(survey$Age)
## [1] 17.5