MulaiMulai sekarang secara gratis

Summarizing with svytotal()

We can also estimate counts with svytotal(). The syntax is given by:

svytotal(x = ~interaction(Var1, Var2), 
         design = design,
         na.rm = TRUE)

For each combination of the two variables, we get an estimate of the total and the standard error.

Latihan ini adalah bagian dari kursus

Analyzing Survey Data in R

Lihat Kursus

Latihan interaktif praktis

Cobalah latihan ini dengan menyelesaikan kode contoh berikut.

# Estimate the totals for combos of Depressed and HealthGen
tab_totals <- svy___(x = ~interaction(___, ___),
                     design = NHANES_design,
                     na.rm = TRUE)

# Print table of totals
___
Edit dan Jalankan Kode