All Projects → gergness → Srvyr

gergness / Srvyr

R package to add 'dplyr'-like Syntax for Summary Statistics of Survey Data

Programming Languages

r
7636 projects

Labels

Projects that are alternatives of or similar to Srvyr

Pedsurvey
From Handcrafted to Deep Features for Pedestrian Detection: A Survey
Stars: ✭ 81 (-50.31%)
Mutual labels:  survey
Pypsy
psychometrics package, including MIRT(multidimension item response theory), IRT(item response theory),GRM(grade response theory),CAT(computerized adaptive testing), CDM(cognitive diagnostic model), FA(factor analysis), SEM(Structural Equation Modeling) .
Stars: ✭ 123 (-24.54%)
Mutual labels:  survey
Communitydetectioncodes
Some overlapping community detection algorithms (Until 2016). by Yulin Che (https://github.com/CheYulin) for the PhD qualification exam (survey on community detection algorithms)
Stars: ✭ 142 (-12.88%)
Mutual labels:  survey
Surveyproject
Survey Project Webapplication - development, sources & releases
Stars: ✭ 97 (-40.49%)
Mutual labels:  survey
Bird Recognition Review
A list of useful resources in the bird sound (song and calls) recognition, such as datasets, papers, links to open source projects and competitions
Stars: ✭ 116 (-28.83%)
Mutual labels:  survey
Opendatasurvey
The Open Data Survey application.
Stars: ✭ 131 (-19.63%)
Mutual labels:  survey
Formium
The headless form builder for the modern web.
Stars: ✭ 78 (-52.15%)
Mutual labels:  survey
Streetcomplete
Easy to use OpenStreetMap editor for Android
Stars: ✭ 2,456 (+1406.75%)
Mutual labels:  survey
Dwsurvey
Open Source Survey System. 最好用的开源问卷调查系统、表单系统。
Stars: ✭ 1,755 (+976.69%)
Mutual labels:  survey
Limesurvey
Limesurvey is the number one open-source survey software.
Stars: ✭ 1,918 (+1076.69%)
Mutual labels:  survey
Wq.app
💻📱 wq's app library: a JavaScript framework powering offline-first web & native apps for geospatial data collection, mobile surveys, and citizen science. Powered by Redux, React, Material UI and Mapbox GL.
Stars: ✭ 99 (-39.26%)
Mutual labels:  survey
Quick Survey
A tool for quick surveys, try it out. (No longer maintained).
Stars: ✭ 109 (-33.13%)
Mutual labels:  survey
Ie Survey
北航大数据高精尖中心张日崇研究团队对信息抽取领域的调研。包括实体识别,关系抽取,属性抽取等子任务,每类子任务分别对学术界和工业界进行调研。
Stars: ✭ 134 (-17.79%)
Mutual labels:  survey
Surveyjs react quickstart
React QuickStart Boilerplate - SurveyJS: Survey Library and Survey Creator
Stars: ✭ 88 (-46.01%)
Mutual labels:  survey
Stateofjs 2019
State of JS 2019 survey report website
Stars: ✭ 145 (-11.04%)
Mutual labels:  survey
Lodown
locally download and prepare publicly-available microdata
Stars: ✭ 79 (-51.53%)
Mutual labels:  survey
Forms
📝 Simple form & survey app for Nextcloud
Stars: ✭ 127 (-22.09%)
Mutual labels:  survey
Qualtrics
Download ⬇️ Qualtrics survey data directly into R!
Stars: ✭ 151 (-7.36%)
Mutual labels:  survey
Ml4code.github.io
Website for "A Survey of Machine Learning for Big Code and Naturalness"
Stars: ✭ 146 (-10.43%)
Mutual labels:  survey
Paper Survey
📚Survey of previous research and related works on machine learning (especially Deep Learning) in Japanese
Stars: ✭ 140 (-14.11%)
Mutual labels:  survey

srvyr

CRAN_Status_Badge R build status Travis-CI Build Status AppVeyor Build Status Coverage Status Documentation via pkgdown

srvyr brings parts of dplyr’s syntax to survey analysis, using the survey package.

srvyr focuses on calculating summary statistics from survey data, such as the mean, total or quantile. It allows for the use of many dplyr verbs, such as summarize, group_by, and mutate, the convenience of pipe-able functions, rlang’s style of non-standard evaluation and more consistent return types than the survey package.

You can try it out:

install.packages("srvyr")
# or for development version
# devtools::install_github("gergness/srvyr")

Example usage

First, describe the variables that define the survey’s structure with the function as_survey()with the bare column names of the names that you would use in functions from the survey package like survey::svydesign(), survey::svrepdesign() or survey::twophase().

library(srvyr, warn.conflicts = FALSE)
data(api, package = "survey")

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

Now many of the dplyr verbs are available.

  • mutate() adds or modifies a variable.
dstrata <- dstrata %>%
  mutate(api_diff = api00 - api99)
  • summarise() calculates summary statistics such as mean, total, quantile or ratio.
dstrata %>% 
  summarise(api_diff = survey_mean(api_diff, vartype = "ci"))
#>   api_diff api_diff_low api_diff_upp
#> 1 32.89252     28.79413     36.99091
  • group_by() and then summarise() creates summaries by groups.
dstrata %>% 
  group_by(stype) %>%
  summarise(api_diff = survey_mean(api_diff, vartype = "ci"))
#> # A tibble: 3 x 4
#>   stype api_diff api_diff_low api_diff_upp
#>   <fct>    <dbl>        <dbl>        <dbl>
#> 1 E        38.6         33.1          44.0
#> 2 H         8.46         1.74         15.2
#> 3 M        26.4         20.4          32.4
  • Functions from the survey package are still available:
my_model <- survey::svyglm(api99 ~ stype, dstrata)
summary(my_model)
#> 
#> Call:
#> svyglm(formula = api99 ~ stype, design = dstrata)
#> 
#> Survey design:
#> Called via srvyr
#> 
#> Coefficients:
#>             Estimate Std. Error t value Pr(>|t|)    
#> (Intercept)   635.87      13.34  47.669   <2e-16 ***
#> stypeH        -18.51      20.68  -0.895    0.372    
#> stypeM        -25.67      21.42  -1.198    0.232    
#> ---
#> Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#> 
#> (Dispersion parameter for gaussian family taken to be 16409.56)
#> 
#> Number of Fisher Scoring iterations: 2

What people are saying about srvyr

[srvyr] lets us use the survey library’s functions within a data analysis pipeline in a familiar way.

– Kieran Healy, in Data Visualization: A practical introduction

  1. Yay!

–Thomas Lumley, in the Biased and Inefficient blog

Contributing

I do appreciate bug reports, suggestions and pull requests! I started this as a way to learn about R package development, and am still learning, so you’ll have to bear with me. Please review the Contributor Code of Conduct, as all participants are required to abide by its terms.

If you’re unfamiliar with contributing to an R package, I recommend the guides provided by Rstudio’s tidyverse team, such as Jim Hester’s blog post or Hadley Wickham’s R packages book.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].