Summarizing quantitative data

R ile Anket Verilerini Analiz Etme

Kelly McConville

Assistant Professor of Statistics

Summary statistics

NHANESraw %>%
  filter(Age >= 12) %>%
  select(DaysPhysHlthBad)
# A tibble: 14,390 x 1
   DaysPhysHlthBad
             <int>
 1               0
 2               2
 3              20
 4               2
 5               0
 6               0
 7               0
 8              NA
 9               0
10               0
# ... with 14,380 more rows
R ile Anket Verilerini Analiz Etme

Mean, total, and median

svymean(x = ~DaysPhysHlthBad, design = NHANES_design, na.rm = TRUE)
                  mean     SE
DaysPhysHlthBad 3.3315 0.1128
svytotal(x = ~DaysPhysHlthBad, design = NHANES_design, na.rm = TRUE)
                   total       SE
DaysPhysHlthBad 7.65e+08 35784824
svyquantile(x = ~DaysPhysHlthBad, design = NHANES_design, na.rm = TRUE, 
            quantiles = 0.5)
                0.5
DaysPhysHlthBad   0
R ile Anket Verilerini Analiz Etme

Summarizing by group

svyby(formula = ~DaysPhysHlthBad, by = ~SmokeNow, 
      design = NHANES_design, 
      FUN = svymean, na.rm = TRUE, 
      row.names = FALSE)
  SmokeNow DaysPhysHlthBad        se
1       No        3.908984 0.1996290
2      Yes        4.951750 0.2346189
R ile Anket Verilerini Analiz Etme

Summarizing by group

svyby(formula = ~Age, by = ~SmokeNow, 
             design = NHANES_design, 
             FUN = svymean, na.rm = TRUE, 
             keep.names = FALSE)
  SmokeNow      Age        se
1       No 54.57933 0.6249442
2      Yes 42.76574 0.4087738
R ile Anket Verilerini Analiz Etme

Let's practice!

R ile Anket Verilerini Analiz Etme

Preparing Video For Download...