unweighted

0th

Percentile

Calculate the an unweighted summary statistic from a survey

Calculate unweighted summaries from a survey dataset, just as on a normal data.frame with summarise.

Usage
unweighted(x, .svy = current_svy(), ...)
Arguments
x

A variable or expression

.svy

A tbl_svy object. When called from inside a summarize function the default automatically sets the survey to the current survey.

...

Ignored

Aliases
  • unweighted
Examples
# NOT RUN {
library(survey)
library(dplyr)
data(api)

dstrata <- apistrat %>%
  as_survey_design(strata = stype, weights = pw)

dstrata %>%
  summarise(api99_unw = unweighted(mean(api99)),
            n = unweighted(n()))

dstrata %>%
  group_by(stype) %>%
  summarise(api_diff_unw = unweighted(mean(api00 - api99)))

# }
Documentation reproduced from package srvyr, version 0.3.5, License: GPL-2 | GPL-3

Community examples

Looks like there are no examples yet.