adding deff to sryvyr

How to add deff to the following?

as_survey_design(ids=grappe_no,fpc=fpc, weights=HH_weight_normalized)

  table <- bogodogo_weightedpointcoverage_srvyr  %>%
  group_by(covered) %>%
  summarize(proportion=survey_prop(vartype="ci", level=.95),
            total=survey_total(na.rm=TRUE))
as_survey_design(ids=grappe_no,fpc=fpc, weights=HH_weight_normalized)

  table <- bogodogo_weightedpointcoverage_srvyr  %>%
  group_by(covered) %>%
  summarize(proportion=survey_prop(vartype="ci", level=.95, deff=TRUE),
            total=survey_total(na.rm=TRUE, deff=TRUE))

This doesn't display the deff in the table below -

mudug_weightedpointcoverage_srvyr <- df_child_level_mudug_point_coverage_SAM %>%
as_survey_design(ids=grappe_no,fpc=fpc, weights=HH_weight_normalized)

  table <- mudug_weightedpointcoverage_srvyr  %>%
  group_by(covered_SAM) %>%
  summarize(proportion=survey_prop(vartype="ci", level=.95),
            total=survey_total(na.rm=TRUE,deff=TRUE))             
  
  table <- table %>% select(-starts_with("total_"))


gt(table)  |>
 gt::cols_label(covered_SAM = "Covered",
  proportion = "Point coverage",
  proportion_low = "Lower Bound- 95% CI",
  proportion_upp="Upper Bound- 95% CI",
  #deff="Design effect",
  total = "Count") |> 
  tab_spanner("Proportion", contains("prop")) |> 
  tab_spanner("Total", contains("total")) |> 
  fmt_percent(contains("prop"), drop_trailing_zeros = T) |> 
  cols_width(proportion:total ~ px(75))

It seems you left out the deff=TRUE argument in the survey_prop function. You should end up with something on your table with a variable called proportion_deff if you add that argument.

It returns NA- my proportion is with characters, is this a problem with DEFF?

Please share a reproducible example of your data. FAQ: What's a reproducible example (`reprex`) and how do I create one? FAQ: How to do a minimal reproducible example ( reprex ) for beginners

In particular pay attention to how you can share the data.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.