diff --git a/docs/404.html b/docs/404.html index bbbd62b..cd6d600 100644 --- a/docs/404.html +++ b/docs/404.html @@ -68,7 +68,7 @@ srvyr - 0.3.8 + 0.3.9 diff --git a/docs/CODE_OF_CONDUCT.html b/docs/CODE_OF_CONDUCT.html index 7c0bc91..36e01fa 100644 --- a/docs/CODE_OF_CONDUCT.html +++ b/docs/CODE_OF_CONDUCT.html @@ -68,7 +68,7 @@ srvyr - 0.3.8 + 0.3.9 diff --git a/docs/articles/extending-srvyr.html b/docs/articles/extending-srvyr.html index b8802e6..a70e1a6 100644 --- a/docs/articles/extending-srvyr.html +++ b/docs/articles/extending-srvyr.html @@ -32,7 +32,7 @@ srvyr - 0.3.8 + 0.3.9 @@ -95,7 +95,7 @@

Extending srvyr

Greg Freedman Ellis

-

2020-03-09

+

2020-05-05

Source: vignettes/extending-srvyr.Rmd @@ -243,19 +243,23 @@

# With our new function survey_gini(srvyr_eusilc$variables$eqincome, .svy = group_by(srvyr_eusilc, rb090)) -#> rb090 __SRVYR_COEF__ _se -#> 1 male 0.2578983 0.002617279 -#> 2 female 0.2702080 0.002892713 - -# And finally, the more typical way through summarize -srvyr_eusilc %>% - group_by(rb090) %>% - summarize(eqincome = survey_gini(eqincome)) -#> # A tibble: 2 x 3 -#> rb090 eqincome eqincome_se -#> <fct> <dbl> <dbl> -#> 1 male 0.258 0.00262 -#> 2 female 0.270 0.00289 +#> Warning: The `add` argument of `group_by()` is deprecated as of dplyr 1.0.0. +#> Please use the `.add` argument instead. +#> This warning is displayed once every 8 hours. +#> Call `lifecycle::last_warnings()` to see where this warning was generated. +#> rb090 __SRVYR_COEF__ _se +#> male male 0.2578983 0.002617279 +#> female female 0.2702080 0.002892713 + +# And finally, the more typical way through summarize +srvyr_eusilc %>% + group_by(rb090) %>% + summarize(eqincome = survey_gini(eqincome)) +#> # A tibble: 2 x 3 +#> rb090 eqincome eqincome_se +#> <fct> <dbl> <dbl> +#> 1 male 0.258 0.00262 +#> 2 female 0.270 0.00289 diff --git a/docs/articles/index.html b/docs/articles/index.html index 243146f..d295041 100644 --- a/docs/articles/index.html +++ b/docs/articles/index.html @@ -68,7 +68,7 @@ srvyr - 0.3.8 + 0.3.9 diff --git a/docs/articles/srvyr-database.html b/docs/articles/srvyr-database.html index 6ef5be8..7669c1c 100644 --- a/docs/articles/srvyr-database.html +++ b/docs/articles/srvyr-database.html @@ -32,7 +32,7 @@ srvyr - 0.3.8 + 0.3.9 @@ -95,7 +95,7 @@

Databases in srvyr

Greg Freedman Ellis

-

2020-03-09

+

2020-05-05

Source: vignettes/srvyr-database.Rmd @@ -145,7 +145,7 @@

summarize(hicov = mean(hicov))
## # A tibble: 2 x 2
 ##     sex hicov
-##   <int> <dbl>
+## * <int> <dbl>
 ## 1     1  1.14
 ## 2     2  1.10
acs_m_db %>% 
@@ -171,7 +171,7 @@ 

summarize(hicov = mean(hicov == 1))

## # A tibble: 2 x 2
 ##     sex hicov
-##   <int> <dbl>
+## * <int> <dbl>
 ## 1     1 0.858
 ## 2     2 0.895
# Works in RSQlite, but didn't in the now defunct MonetDB
@@ -199,33 +199,31 @@ 

acs_m %>% 
   group_by(agecat = cut(agep, c(0, 19, 35, 50, 65, 200))) %>%
   summarize(hicov = mean(hicov == 1))
-
## Warning: Factor `agecat` contains implicit NA, consider using
-## `forcats::fct_explicit_na`
## # A tibble: 6 x 2
 ##   agecat   hicov
-##   <fct>    <dbl>
+## * <fct>    <dbl>
 ## 1 (0,19]   0.908
 ## 2 (19,35]  0.795
 ## 3 (35,50]  0.837
 ## 4 (50,65]  0.873
 ## 5 (65,200] 0.992
 ## 6 <NA>     0.953
-
# acs_m_db %>% 
-#   group_by(agecat = cut(agep, c(0, 19, 35, 50, 65, 200))) %>%
-#   summarize(hicov = mean(hicov == 1))
-#
-# > Error in .local(conn, statement, ...) :
-# > Unable to execute statement....
-# > ...
-
-acs_m_db %>% 
-  mutate(agecat = ifelse(agep < 19, "0-18", 
-                         ifelse(agep >= 19 & agep < 35, "19-34", 
-                                ifelse(agep >= 35 & agep < 50, "35-49", 
-                                       ifelse(agep >= 50 & agep < 65, "50-64", 
-                                              ifelse(agep >= 65, "65+", NA)))))) %>%
-  group_by(agecat) %>% 
-  summarize(hicov = mean(hicov))
+
# acs_m_db %>% 
+#   group_by(agecat = cut(agep, c(0, 19, 35, 50, 65, 200))) %>%
+#   summarize(hicov = mean(hicov == 1))
+#
+# > Error in .local(conn, statement, ...) :
+# > Unable to execute statement....
+# > ...
+
+acs_m_db %>% 
+  mutate(agecat = ifelse(agep < 19, "0-18", 
+                         ifelse(agep >= 19 & agep < 35, "19-34", 
+                                ifelse(agep >= 35 & agep < 50, "35-49", 
+                                       ifelse(agep >= 50 & agep < 65, "50-64", 
+                                              ifelse(agep >= 65, "65+", NA)))))) %>%
+  group_by(agecat) %>% 
+  summarize(hicov = mean(hicov))
## # Source:   lazy query [?? x 2]
 ## # Database: sqlite 3.30.1 [:memory:]
 ##   agecat hicov
@@ -241,18 +239,18 @@ 

Srvyr Setup

Srvyr commands are nearly identical to old. The only difference for setup is that you need a variable that uniquely identifies each row in the database (uid).

-
acs_m_db_svy <- acs_m_db %>% 
-  as_survey_rep(
-    weight = pwgtp,
-    repweights = matches("pwgtp[0-9]+") ,
-    scale = 4 / 80,
-    rscales = rep(1 , 80),
-    mse = TRUE,
-    type = "JK1", 
-    variables = -c(matches("^pwgtp"))
-  )
-
-acs_m_db_svy
+
acs_m_db_svy <- acs_m_db %>% 
+  as_survey_rep(
+    weight = pwgtp,
+    repweights = matches("pwgtp[0-9]+") ,
+    scale = 4 / 80,
+    rscales = rep(1 , 80),
+    mse = TRUE,
+    type = "JK1", 
+    variables = -c(matches("^pwgtp"))
+  )
+
+acs_m_db_svy
## Call: Called via srvyr
 ## Unstratified cluster jacknife (JK1) with 80 replicates and MSE variances.
 ## Sampling variables:
@@ -277,7 +275,7 @@ 

## (int), pwgtp78 (int), pwgtp79 (int), pwgtp80 (int), agep (int), hicov (int), ## sex (int), st (chr), rt (chr)

Because srvyr stores the survey variables locally, the srvyr object takes up much more memory than the dplyr one. However, this object would not grow in size if you added more data variables to your survey, so if your survey is very wide, it will save a lot space.

-
object.size(acs_m_db_svy)
+
object.size(acs_m_db_svy)
## 8391408 bytes

@@ -285,12 +283,16 @@

Analysis

Analysis commands from srvyr are also similar to ones that work on local data.frames. The main differences come from the issues discussed above about explicitly creating variables difficulties in translating R commands, and variable types.

The following analysis is based on the asdfree analysis and shows some basic analysis on the total population, insurance coverage, age and sex.

-
# You can calculate the population of the united states #
-# by state
-acs_m_db_svy %>%
-  mutate(one = 1L) %>% # Note that because of weird behavior of MonetDB, need to use 1L not just 1
-  group_by(st) %>% 
-  summarize(count = survey_total(one))
+
# You can calculate the population of the united states #
+# by state
+acs_m_db_svy %>%
+  mutate(one = 1L) %>% # Note that because of weird behavior of MonetDB, need to use 1L not just 1
+  group_by(st) %>% 
+  summarize(count = survey_total(one))
+
## Warning: The `add` argument of `group_by()` is deprecated as of dplyr 1.0.0.
+## Please use the `.add` argument instead.
+## This warning is displayed once every 8 hours.
+## Call `lifecycle::last_warnings()` to see where this warning was generated.
## # A tibble: 2 x 3
 ##   st      count count_se
 ##   <chr>   <dbl>    <dbl>
diff --git a/docs/articles/srvyr-vs-survey.html b/docs/articles/srvyr-vs-survey.html
index 6e458b8..63f0968 100644
--- a/docs/articles/srvyr-vs-survey.html
+++ b/docs/articles/srvyr-vs-survey.html
@@ -32,7 +32,7 @@
       
 
         srvyr
-        0.3.8
+        0.3.9
       
     
@@ -96,7 +96,7 @@

srvyr compared to the survey package

Greg Freedman

-

2020-03-09

+

2020-05-05

Source: vignettes/srvyr-vs-survey.Rmd @@ -122,7 +122,7 @@

labels = c("<20%", "20+%"))) %>% group_by(stype, hs_grad_pct) %>% summarize(api_diff = weighted.mean(api00 - api99, pw), - n = n()) + n = n()) ggplot(data = out, aes(x = stype, y = api_diff, group = hs_grad_pct, fill = hs_grad_pct)) + geom_bar(stat = "identity", position = "dodge") + @@ -164,7 +164,7 @@

strat_design_survey$variables$api_diff <- strat_design_survey$variables$api00 - strat_design_survey$variables$api99 names(strat_design_survey$variables)[names(strat_design_survey$variables) == "api.stu"] <- "api_students" -

Note that arrange() is not available, because the srvyr object expects to stay in the same order. Nor are two-table verbs such as full_join(), bind_rows(), etc. available to srvyr objects either because they may have implications on the survey design. If you need to use these functions, you should use them earlier in your analysis pipeline, when the objects are still stored as data.frames.

+

Note that arrange() is not available, because the srvyr object expects to stay in the same order. Nor are two-table verbs such as full_join(), bind_rows(), etc. available to srvyr objects either because they may have implications on the survey design. If you need to use these functions, you should use them earlier in your analysis pipeline, when the objects are still stored as data.frames.

@@ -201,14 +201,18 @@

group_by(stype) %>% summarize(api_increase = survey_total(api_diff >= 0), api_decrease = survey_total(api_diff < 0))

+
## Warning: The `add` argument of `group_by()` is deprecated as of dplyr 1.0.0.
+## Please use the `.add` argument instead.
+## This warning is displayed once every 8 hours.
+## Call `lifecycle::last_warnings()` to see where this warning was generated.
## # A tibble: 3 x 5
 ##   stype api_increase api_increase_se api_decrease api_decrease_se
 ##   <fct>        <dbl>           <dbl>        <dbl>           <dbl>
 ## 1 E            4067.           119.         354.            119. 
 ## 2 H             498.            49.4        257.             49.4
 ## 3 M             998.            19.9         20.4            19.9
-
# Using survey
-svyby(~api_diff >= 0, ~stype, strat_design_survey, svytotal)
+
# Using survey
+svyby(~api_diff >= 0, ~stype, strat_design_survey, svytotal)
##   stype api_diff >= 0FALSE api_diff >= 0TRUE se.api_diff >= 0FALSE
 ## E     E             353.68           4067.32             119.17185
 ## H     H             256.70            498.30              49.37208
@@ -222,22 +226,22 @@ 

Proportions by group

You can also calculate the proportion or count in each group of a factor or character variable by leaving x empty in survey_mean() or survey_total().

-
# Using srvyr
-srs_design_srvyr %>%
-  group_by(awards) %>%
-  summarize(proportion = survey_mean(),
-            total = survey_total())
+
# Using srvyr
+srs_design_srvyr %>%
+  group_by(awards) %>%
+  summarize(proportion = survey_mean(),
+            total = survey_total())
## # A tibble: 2 x 5
 ##   awards proportion proportion_se total total_se
 ##   <fct>       <dbl>         <dbl> <dbl>    <dbl>
 ## 1 No           0.38        0.0338 2354.     210.
 ## 2 Yes          0.62        0.0338 3840.     210.
-
# Using survey
-svymean(~awards, srs_design_survey)
+
# Using survey
+svymean(~awards, srs_design_survey)
##           mean     SE
 ## awardsNo  0.38 0.0338
 ## awardsYes 0.62 0.0338
-
svytotal(~awards, srs_design_survey)
+
svytotal(~awards, srs_design_survey)
##            total     SE
 ## awardsNo  2353.7 209.65
 ## awardsYes 3840.3 209.65
@@ -246,18 +250,18 @@

Unweighted calculations

Finally, the unweighted() function can act as an escape hatch to calculate unweighted calculations on the dataset.

-
# Using srvyr
-strat_design_srvyr %>%
-  group_by(stype) %>%
-  summarize(n = unweighted(n()))
+
# Using srvyr
+strat_design_srvyr %>%
+  group_by(stype) %>%
+  summarize(n = unweighted(n()))
## # A tibble: 3 x 2
 ##   stype     n
 ##   <fct> <int>
 ## 1 E       100
 ## 2 H        50
 ## 3 M        50
-
# Using survey
-svyby(~api99, ~stype, strat_design_survey, unwtd.count)
+
# Using survey
+svyby(~api99, ~stype, strat_design_survey, unwtd.count)
##   stype counts se
 ## E     E    100  0
 ## H     H     50  0
@@ -268,21 +272,21 @@ 

Back to the example

So now, we have all the tools needed to create the first graph and add error bounds. Notice that the data manipulation code is nearly identical to the dplyr code, with a little extra set up, and replacing weighted.mean() with survey_mean.

-
strat_design <- apistrat %>%
-  as_survey_design(strata = stype, fpc = fpc, weight  = pw)
-
-out <- strat_design %>%
-  mutate(hs_grad_pct = cut(hsg, c(0, 20, 100), include.lowest = TRUE,
-                           labels = c("<20%", "20+%"))) %>%
-  group_by(stype, hs_grad_pct) %>%
-  summarize(api_diff = survey_mean(api00 - api99, vartype = "ci"),
-            n = unweighted(n()))
-
-ggplot(data = out, aes(x = stype, y = api_diff, group = hs_grad_pct, fill = hs_grad_pct,
-                       ymax = api_diff_upp, ymin = api_diff_low)) +
-  geom_bar(stat = "identity", position = "dodge") +
-  geom_errorbar(position = position_dodge(width = 0.9), width = 0.1) +
-  geom_text(aes(y = 0, label = n), position = position_dodge(width = 0.9), vjust = -1)
+
strat_design <- apistrat %>%
+  as_survey_design(strata = stype, fpc = fpc, weight  = pw)
+
+out <- strat_design %>%
+  mutate(hs_grad_pct = cut(hsg, c(0, 20, 100), include.lowest = TRUE,
+                           labels = c("<20%", "20+%"))) %>%
+  group_by(stype, hs_grad_pct) %>%
+  summarize(api_diff = survey_mean(api00 - api99, vartype = "ci"),
+            n = unweighted(n()))
+
+ggplot(data = out, aes(x = stype, y = api_diff, group = hs_grad_pct, fill = hs_grad_pct,
+                       ymax = api_diff_upp, ymin = api_diff_low)) +
+  geom_bar(stat = "identity", position = "dodge") +
+  geom_errorbar(position = position_dodge(width = 0.9), width = 0.1) +
+  geom_text(aes(y = 0, label = n), position = position_dodge(width = 0.9), vjust = -1)

@@ -292,8 +296,8 @@

Using survey functions on srvyr objects

Because srvyr objects are just survey objects with some extra structure, all of the functions from survey will still work with them. If you need to calculate something beyond simple summary statistics, you can use survey functions.

-
glm <- svyglm(api00 ~ ell + meals + mobility, design = strat_design)
-summary(glm)
+
glm <- svyglm(api00 ~ ell + meals + mobility, design = strat_design)
+summary(glm)
## 
 ## Call:
 ## svyglm(formula = api00 ~ ell + meals + mobility, design = strat_design)
@@ -319,18 +323,18 @@ 

Standard evaluation

Srvyr now supports the standard evaluation conventions introduced in dplyr version 0.7 and rlang. If you’d like to use a function programmatically, you can use the functions from rlang like rlang::quo() or rlang::sym() to capture the expression and rlang::!! to unquote it. All of these functions are re-exported by srvyr, so you don’t need to load the rlang library to use them.

Here’s a quick example, but please see the dplyr vignette vignette("programming", package = "dplyr") for more details.

-
fpc_var <- sym("fpc")
-srs_design_srvyr <- apisrs %>% as_survey_design(fpc = !!fpc_var)
-
-grouping_var <- sym("stype")
-api_diff <- quo(api00 - api99)
-
-srs_design_srvyr %>%
-  group_by(!!grouping_var) %>% 
-  summarize(
-    api_increase = survey_total((!!api_diff) >= 0),
-    api_decrease = survey_total((!!api_diff) < 0)
-  )
+
fpc_var <- sym("fpc")
+srs_design_srvyr <- apisrs %>% as_survey_design(fpc = !!fpc_var)
+
+grouping_var <- sym("stype")
+api_diff <- quo(api00 - api99)
+
+srs_design_srvyr %>%
+  group_by(!!grouping_var) %>% 
+  summarize(
+    api_increase = survey_total((!!api_diff) >= 0),
+    api_decrease = survey_total((!!api_diff) < 0)
+  )
## # A tibble: 3 x 5
 ##   stype api_increase api_increase_se api_decrease api_decrease_se
 ##   <fct>        <dbl>           <dbl>        <dbl>           <dbl>
@@ -343,9 +347,9 @@ 

Scoped functions

Srvyr has also been able to take advantage of the new-ish dplyr “scoped” variants of the main manipulation functions like summarize_at(). These functions allow you to quickly calculate summary statistics for multiple variables. For example:

-
# Calculate survey mean for all variables that have names starting with "api"
-strat_design %>%
-  summarize_at(vars(starts_with("api")), survey_mean)
+
# Calculate survey mean for all variables that have names starting with "api"
+strat_design %>%
+  summarize_at(vars(starts_with("api")), survey_mean)
## # A tibble: 1 x 6
 ##   api00 api00_se api99 api99_se api.stu api.stu_se
 ##   <dbl>    <dbl> <dbl>    <dbl>   <dbl>      <dbl>
diff --git a/docs/articles/srvyr-vs-survey_files/figure-html/unnamed-chunk-1-1.png b/docs/articles/srvyr-vs-survey_files/figure-html/unnamed-chunk-1-1.png
index 9f1f3bd..f420534 100644
Binary files a/docs/articles/srvyr-vs-survey_files/figure-html/unnamed-chunk-1-1.png and b/docs/articles/srvyr-vs-survey_files/figure-html/unnamed-chunk-1-1.png differ
diff --git a/docs/articles/srvyr-vs-survey_files/figure-html/unnamed-chunk-10-1.png b/docs/articles/srvyr-vs-survey_files/figure-html/unnamed-chunk-10-1.png
index eecbf78..d92a9f9 100644
Binary files a/docs/articles/srvyr-vs-survey_files/figure-html/unnamed-chunk-10-1.png and b/docs/articles/srvyr-vs-survey_files/figure-html/unnamed-chunk-10-1.png differ
diff --git a/docs/authors.html b/docs/authors.html
index 208eb38..a4cd7bc 100644
--- a/docs/authors.html
+++ b/docs/authors.html
@@ -68,7 +68,7 @@
       
 
         srvyr
-        0.3.8
+        0.3.9
       
     
diff --git a/docs/index.html b/docs/index.html index e897819..7b077ac 100644 --- a/docs/index.html +++ b/docs/index.html @@ -34,7 +34,7 @@ srvyr - 0.3.8 + 0.3.9 diff --git a/docs/news/index.html b/docs/news/index.html index 610e1ce..c026fa7 100644 --- a/docs/news/index.html +++ b/docs/news/index.html @@ -68,7 +68,7 @@ srvyr - 0.3.8 + 0.3.9 @@ -132,6 +132,14 @@

Changelog

Source: NEWS.md +
+

+srvyr 0.3.9 2020-05-04 +

+ +

srvyr 0.3.8 2020-03-07 @@ -270,6 +278,7 @@

Contents

diff --git a/docs/reference/as_survey_design.html b/docs/reference/as_survey_design.html index f350d4d..e07fa39 100644 --- a/docs/reference/as_survey_design.html +++ b/docs/reference/as_survey_design.html @@ -70,7 +70,7 @@ srvyr - 0.3.8 + 0.3.9

diff --git a/docs/reference/as_survey_rep.html b/docs/reference/as_survey_rep.html index 0a1d89a..f176598 100644 --- a/docs/reference/as_survey_rep.html +++ b/docs/reference/as_survey_rep.html @@ -70,7 +70,7 @@ srvyr - 0.3.8 + 0.3.9 diff --git a/docs/reference/as_survey_twophase.html b/docs/reference/as_survey_twophase.html index 27bfe7f..cc8554e 100644 --- a/docs/reference/as_survey_twophase.html +++ b/docs/reference/as_survey_twophase.html @@ -74,7 +74,7 @@ srvyr - 0.3.8 + 0.3.9 diff --git a/docs/reference/as_tibble.html b/docs/reference/as_tibble.html index 797ffa3..eae0e89 100644 --- a/docs/reference/as_tibble.html +++ b/docs/reference/as_tibble.html @@ -70,7 +70,7 @@ srvyr - 0.3.8 + 0.3.9 diff --git a/docs/reference/cascade.html b/docs/reference/cascade.html index 6847228..7e941f2 100644 --- a/docs/reference/cascade.html +++ b/docs/reference/cascade.html @@ -71,7 +71,7 @@ srvyr - 0.3.8 + 0.3.9 @@ -174,12 +174,14 @@

Examp as_survey_design(strata = stype, weights = pw) dstrata_grp <- dstrata %>% - group_by(stype) - + group_by(stype)
#> Warning: The `add` argument of `group_by()` is deprecated as of dplyr 1.0.0. +#> Please use the `.add` argument instead. +#> This warning is displayed once every 8 hours. +#> Call `lifecycle::last_warnings()` to see where this warning was generated.
dstrata_grp %>% cascade(api99 = survey_mean(api99), api00 = survey_mean(api00), - api_diff = survey_mean(api00 - api99))
#> # A tibble: 4 x 7 + api_diff = survey_mean(api00 - api99))
#> # A tibble: 4 x 7 #> stype api99 api99_se api00 api00_se api_diff api_diff_se #> <fct> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> #> 1 E 636. 13.3 674. 12.5 38.6 2.76 diff --git a/docs/reference/collect.html b/docs/reference/collect.html index b002329..d6af91b 100644 --- a/docs/reference/collect.html +++ b/docs/reference/collect.html @@ -74,7 +74,7 @@ srvyr - 0.3.8 + 0.3.9
diff --git a/docs/reference/current_svy.html b/docs/reference/current_svy.html index 03524fd..b8982f1 100644 --- a/docs/reference/current_svy.html +++ b/docs/reference/current_svy.html @@ -74,7 +74,7 @@ srvyr - 0.3.8 + 0.3.9 diff --git a/docs/reference/dplyr_single.html b/docs/reference/dplyr_single.html index db2c71d..e3b7930 100644 --- a/docs/reference/dplyr_single.html +++ b/docs/reference/dplyr_single.html @@ -70,7 +70,7 @@ srvyr - 0.3.8 + 0.3.9 diff --git a/docs/reference/get_var_est.html b/docs/reference/get_var_est.html index a4b9211..6547c59 100644 --- a/docs/reference/get_var_est.html +++ b/docs/reference/get_var_est.html @@ -75,7 +75,7 @@ srvyr - 0.3.8 + 0.3.9 diff --git a/docs/reference/group_by.html b/docs/reference/group_by.html index be603c0..4b7ad8f 100644 --- a/docs/reference/group_by.html +++ b/docs/reference/group_by.html @@ -73,7 +73,7 @@ srvyr - 0.3.8 + 0.3.9 diff --git a/docs/reference/groups.html b/docs/reference/groups.html index 289d83c..2085a6b 100644 --- a/docs/reference/groups.html +++ b/docs/reference/groups.html @@ -73,7 +73,7 @@ srvyr - 0.3.8 + 0.3.9 @@ -157,7 +157,7 @@

Arg

See also

-

groups for information.

+

groups for information.

diff --git a/docs/reference/pipe.html b/docs/reference/pipe.html index b25ee02..7783048 100644 --- a/docs/reference/pipe.html +++ b/docs/reference/pipe.html @@ -70,7 +70,7 @@ srvyr - 0.3.8 + 0.3.9 diff --git a/docs/reference/rlang-tidyeval.html b/docs/reference/rlang-tidyeval.html index 54c3256..828cafc 100644 --- a/docs/reference/rlang-tidyeval.html +++ b/docs/reference/rlang-tidyeval.html @@ -73,7 +73,7 @@ srvyr - 0.3.8 + 0.3.9 diff --git a/docs/reference/set_survey_vars.html b/docs/reference/set_survey_vars.html index 32d88d8..4c440c3 100644 --- a/docs/reference/set_survey_vars.html +++ b/docs/reference/set_survey_vars.html @@ -75,7 +75,7 @@ srvyr - 0.3.8 + 0.3.9 diff --git a/docs/reference/srvyr-se-deprecated.html b/docs/reference/srvyr-se-deprecated.html index 1480dfa..49315b8 100644 --- a/docs/reference/srvyr-se-deprecated.html +++ b/docs/reference/srvyr-se-deprecated.html @@ -74,7 +74,7 @@ srvyr - 0.3.8 + 0.3.9 diff --git a/docs/reference/srvyr.html b/docs/reference/srvyr.html index 0b5b120..aba71e6 100644 --- a/docs/reference/srvyr.html +++ b/docs/reference/srvyr.html @@ -73,7 +73,7 @@ srvyr - 0.3.8 + 0.3.9 diff --git a/docs/reference/summarise.html b/docs/reference/summarise.html index 0fa0624..246d204 100644 --- a/docs/reference/summarise.html +++ b/docs/reference/summarise.html @@ -70,7 +70,7 @@ srvyr - 0.3.8 + 0.3.9 diff --git a/docs/reference/summarise_all.html b/docs/reference/summarise_all.html index 06fe68f..b6d308a 100644 --- a/docs/reference/summarise_all.html +++ b/docs/reference/summarise_all.html @@ -71,7 +71,7 @@ srvyr - 0.3.8 + 0.3.9 diff --git a/docs/reference/survey_mean.html b/docs/reference/survey_mean.html index 9b072dc..96d7e4b 100644 --- a/docs/reference/survey_mean.html +++ b/docs/reference/survey_mean.html @@ -73,7 +73,7 @@ srvyr - 0.3.8 + 0.3.9 diff --git a/docs/reference/survey_quantile.html b/docs/reference/survey_quantile.html index cc31ef5..8ec9957 100644 --- a/docs/reference/survey_quantile.html +++ b/docs/reference/survey_quantile.html @@ -72,7 +72,7 @@ srvyr - 0.3.8 + 0.3.9 diff --git a/docs/reference/survey_ratio.html b/docs/reference/survey_ratio.html index e7163d6..544513d 100644 --- a/docs/reference/survey_ratio.html +++ b/docs/reference/survey_ratio.html @@ -72,7 +72,7 @@ srvyr - 0.3.8 + 0.3.9 diff --git a/docs/reference/survey_tally.html b/docs/reference/survey_tally.html index b258dd2..38e284f 100644 --- a/docs/reference/survey_tally.html +++ b/docs/reference/survey_tally.html @@ -74,7 +74,7 @@ srvyr - 0.3.8 + 0.3.9 @@ -140,7 +140,7 @@

Count/tally survey weighted observations by group

-

Analogous to tally and count, calculates the survey weighted +

Analogous to tally and count, calculates the survey weighted count of observations. survey_tally will call survey_total empty (resulting in the count of each group) or on wt if it is specified (resulting in the survey weighted total of wt). survey_count is similar, but calls group_by diff --git a/docs/reference/survey_total.html b/docs/reference/survey_total.html index 52b182a..2fc8ee9 100644 --- a/docs/reference/survey_total.html +++ b/docs/reference/survey_total.html @@ -72,7 +72,7 @@ srvyr - 0.3.8 + 0.3.9

diff --git a/docs/reference/survey_var.html b/docs/reference/survey_var.html index a6a711a..8ce82ec 100644 --- a/docs/reference/survey_var.html +++ b/docs/reference/survey_var.html @@ -72,7 +72,7 @@ srvyr - 0.3.8 + 0.3.9 diff --git a/docs/reference/svychisq.html b/docs/reference/svychisq.html index de24a3a..f512e70 100644 --- a/docs/reference/svychisq.html +++ b/docs/reference/svychisq.html @@ -70,7 +70,7 @@ srvyr - 0.3.8 + 0.3.9 diff --git a/docs/reference/tbl_svy.html b/docs/reference/tbl_svy.html index 09defd3..95b709f 100644 --- a/docs/reference/tbl_svy.html +++ b/docs/reference/tbl_svy.html @@ -72,7 +72,7 @@ srvyr - 0.3.8 + 0.3.9 @@ -152,7 +152,7 @@

Methods

tbl_df implements these methods from dplyr.

-
select or rename

Select or rename variables in a survey's dataset.

+
select or rename

Select or rename variables in a survey's dataset.

mutate or transmute

Modify and create variables in a survey's dataset.

group_by and summarise

Get descriptive statistics from survey.

diff --git a/docs/reference/tbl_vars.html b/docs/reference/tbl_vars.html index ea0785d..71faccd 100644 --- a/docs/reference/tbl_vars.html +++ b/docs/reference/tbl_vars.html @@ -70,7 +70,7 @@ srvyr - 0.3.8 + 0.3.9 diff --git a/docs/reference/unweighted.html b/docs/reference/unweighted.html index 5da09b1..cac48b0 100644 --- a/docs/reference/unweighted.html +++ b/docs/reference/unweighted.html @@ -71,7 +71,7 @@ srvyr - 0.3.8 + 0.3.9 @@ -179,7 +179,7 @@

Examp dstrata %>% summarise(api99_unw = unweighted(mean(api99)), - n = unweighted(n()))
#> # A tibble: 1 x 2 + n = unweighted(n()))
#> # A tibble: 1 x 2 #> api99_unw n #> <dbl> <int> #> 1 625. 200