Code Monkey home page Code Monkey logo

svmkr's People

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

acozzubo

svmkr's Issues

Would be really nice to have a module of standard variable codings

The SurveyMonkey research team has a set of standard variable coding practices. It would be great to institutionalize those into our R package.

For example, a function that looks for the usual SurveyMonkey Age question in the columns of a dataframe and then codes it into the Pew generations. Something like this (but accounts for present year):

svy_df$Age <- cut(as.numeric(svy_df$`What is your age?`), 
                  breaks=c(-Inf, 26, 42, 59, Inf),
                  labels=c("18-26 (Gen-Z)","27-42 (Millennial)","43-58 (Gen X)","59+ (Boomer)"))
attr(svy_df$Income, "label") <- "Age (4) / Pew Generation" ## needed to show up in banners

A provisional list of such variables to code would be:

  • Which gender best describes you? (gender_non_binary)
  • age3 (age3)
  • Age 6 (age6)
  • Race 5 (racethn5)
  • Pew Generations 2022 (generations)
  • Education 2 (educ2)
  • Income groups (income3)
  • Party3 (party3)

See 2022 procedures doc for more info

Add more population weighting targets

Updated TODOs Jun 16 2023

Functionality:

  • have an option to specify keep.margins and remove.margins to keep/remove margins in the passed-in target
  • auto.map option if it makes sense, i.e. allow user to turn off auto-mapping dataframe columns to population variables
  • have an option to save a custom target distribution, or list of dataframes that the user is created, e.g. save_target

Specific distributions to save out the target files in inst/extdata/targets -- drawing from all the files we've created already from various projects -- and then also to turn into functions (in order of priority):

  • us_smallbiz_acs_23 (or something similar) for the small business weights that Zoe created
  • us_aapi_acs_19 (or something similar) for the weights we use for AAPI Data
  • tx_acs_19, ma_acs_19, etc. etc. for each state gen pop
  • us_acs_teens_19 or something similar for US teens (these weights should be on the dashboard backend folders somewhere)

Refactor how survey responses are downloaded

It would be nicer to have a more consistent interface for the survey downloading that mirrors the qdoc survey creation interface:

  • download_qdoc: does what fetch_survey_obj() does but turns into a qdoc object
  • download_responses: takes either ID or qdoc (with ID parameter) and returns dataframe as parse_survey() works
  • backwards compatibility with fetch_survey_obj and parse_survey

Support for "Other" / "None of the Above" options in multiple-choice questions

We need to have some QDOC tag that the user can use to specify an explicit "Other" and "None of the above" options. Relevant code in make_survey.R.

There's a way to specify this in the Developer API, just need to:

  • have qdoc.question be able to parse a particular tag (maybe a :Other subtype) for Other and similarly for NOTA
  • incorporate this into the vignette
  • have it hook up to the developer API

Have option to copy+paste QDOC contents into Import form

There's already an option to import questions into a survey -- have an option that dumps a QDOC into a format compatible with this.

Screenshot 2023-04-27 at 10 39 53 AM

Can only import multiple choice and text box questions -- maybe should make this clear in the text outputted.

Add t-test / p-values into banner cells

Request from Zewei.

For example, we could add stars or bolden numbers within a particular block if they are significant in a pairwise test.

Will need to think through the exact design, generalizability, etc.

Multi-answer matrix question drops out

If a particular column in a multi-answer matrix question is never selected, it drops out of the dataset returned by parse_survey() altogether.

Can either fix this in process_matrix() or in the fetch_survey_obj() stage (probably less work for current release to do the former).

Test out whether different themes work on uploading the survey

upload_qdoc can take a theme_id parameter. It would be great if we could test out uploading the same survey using different theme IDs and seeing that this feature works.

It would also be great to know what the theme number is for our usual research insights surveys (check out one of our recent research team surveys and then try looking at the dev docs to see if theres a list of theme numbers or see if there's a theme number on the SurveyMonkey platform itself when creating a survey...).

If there is, it would be nice to have theme_id in upload_qdoc automatically set to that!

Error in paging by `start_created_at`

Server returns a 504 error either immediately or after a little while.

  • Try removing format_date() for start_created_at in parse_survey()
  • Try paging like we're paging in the API patch script I created on the SVMK server bypassing the API and just manually checking for response dates.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.