mnoetel / readi-scrub Goto Github PK
View Code? Open in Web Editor NEWFor READI SCRUB project cleaning code and dashboard
License: Creative Commons Zero v1.0 Universal
For READI SCRUB project cleaning code and dashboard
License: Creative Commons Zero v1.0 Universal
Hey @bjsmith I know this is an interesting variable but can you please remove it from the dashboard? Doing so means we can have the data updates more given our funding arrangements.
Somewhere between cleaning boxes and merging to saved attributes all the attributes for the boxes disappear
saved_attributes$w4_wkex_trans_int_9
d6_boxes$w4_wkex_trans_int_9
I get the following error when trying to import the wave 5 version of latest_open_science_data.RDS
Warning messages:
1: In readRDS(path) :
input string '≤ 5,000 people' cannot be translated to UTF-8, is it valid in 'US-ASCII'?
It is related to the inhabitants column.
I edited the inhab_labels variable on lines 1321 to 1325 of the cleaning code script to avoid that character, like:
inhab_labels <- "5,000 people or less (1)
o 5,001 - 20,000 (2)
o 20,001 - 100,000 (3)
o 100,001 - 500,000 (4)
o 500,000 people or more (5)"
But I don't know if this will fix the problem and it might even break it, if the original qualtrics file has the less than character and if inhab_labels
needs to match it.
There's three items that say "click 3/7", if participants fail these, remove them from the data
There should be only 1 variable in the bound dataset, SWB4.
I have manually changed the coding of every fogg item across all waves and versions of the survey.
Label | suffix_number |
---|---|
I didn't know about it | 1 |
I don't remember to do it | 2 |
I don't know how to do it | 3 |
I don't have the resources to do it | 4 |
No one else is doing it | 5 |
I don't want to do it | 6 |
I don't have control over whether it happens | 7 |
I don't think it makes a difference to the spread of COVID-19 | 8 |
I don't have a habit or routine to help me do it | 9 |
It’s awkward to do it | 10 |
I forgot to do it in the moment | 11 |
Other - please specify | 66 |
None of these | 77 |
Prefer not to answer | 88 |
Note that only bar_fogg_ffd (wave 4 oru) will have 10, 11 or 66. items 7, 8, 9 were added in Wave 3 (oru/master).
full list for reference:
Wave 2 MASTER | x | x | x | x | x |
---|---|---|---|---|---|
num | Handwash | cover | touch | distance | stayhome |
1 | I didn't know about it | I didn't know about it | I didn't know about it | I didn't know about it | I didn't know about it |
2 | I don't remember to do it | I don't remember to do it | I don't remember to do it | I don't remember to do it | I don't remember to do it |
3 | I don't know how to do it | I don't know how to do it | I don't know how to do it | I don't know how to do it | I don't know how to do it |
4 | I don't have the resources to do it | I don't have the resources to do it | I don't have the resources to do it | I don't have the resources to do it | I don't have the resources to do it |
5 | No one else is doing it | No one else is doing it | No one else is doing it | No one else is doing it | No one else is doing it |
6 | I don't want to do it | I don't want to do it | I don't want to do it | I don't want to do it | I don't want to do it |
77 | None of these | None of these | None of these | None of these | None of these |
88 | Prefer not to answer | Prefer not to answer | Prefer not to answer | Prefer not to answer | Prefer not to answer |
Wave 2 ORU | |||||
num | Handwash | cover | touch | distance | stayhome |
1 | I didn't know about it | I didn't know about it | I didn't know about it | I didn't know about it | I didn't know about it |
2 | I don't remember to do it | I don't remember to do it | I don't remember to do it | I don't remember to do it | I don't remember to do it |
3 | I don't know how to do it | I don't know how to do it | I don't know how to do it | I don't know how to do it | I don't know how to do it |
4 | I don't have the resources to do it | I don't have the resources to do it | I don't have the resources to do it | I don't have the resources to do it | I don't have the resources to do it |
5 | No one else is doing it | No one else is doing it | No one else is doing it | No one else is doing it | No one else is doing it |
6 | I don't want to do it | I don't want to do it | I don't want to do it | I don't want to do it | I don't want to do it |
77 | None of these | None of these | None of these | None of these | None of these |
88 | Prefer not to answer | Prefer not to answer | Prefer not to answer | Prefer not to answer | Prefer not to answer |
Wave 3 MASTER | |||||
num | Handwash | App | Distance | Stay home | Facemask |
1 | I didn't know about it | I didn't know about it | I didn't know about it | I didn't know about it | I didn't know about it |
2 | I don't remember to do it | I don't remember to do it | I don't remember to do it | I don't remember to do it | I don't remember to do it |
3 | I don't know how to do it | I don't know how to do it | I don't know how to do it | I don't know how to do it | I don't know how to do it |
4 | I don't have the resources to do it | I don't have the resources to do it | I don't have the resources to do it | I don't have the resources to do it | I don't have the resources to do it |
5 | No one else is doing it | No one else is doing it | No one else is doing it | No one else is doing it | No one else is doing it |
6 | I don't want to do it | I don't want to do it | I don't want to do it | I don't want to do it | I don't want to do it |
7 | I don't have control over whether it happens | I don't have control over whether it happens | I don't have control over whether it happens | I don't have control over whether it happens | I don't have control over whether it happens |
8 | I don't think it makes a difference to the spread of COVID-19 | I don't think it makes a difference to the spread of COVID-19 | I don't think it makes a difference to the spread of COVID-19 | I don't think it makes a difference to the spread of COVID-19 | I don't think it makes a difference to the spread of COVID-19 |
9 | I don't have a habit or routine to help me do it | I don't have a habit or routine to help me do it | I don't have a habit or routine to help me do it | I don't have a habit or routine to help me do it | I don't have a habit or routine to help me do it |
77 | None of these | None of these | None of these | None of these | None of these |
88 | Prefer not to answer | Prefer not to answer | Prefer not to answer | Prefer not to answer | Prefer not to answer |
Wave 3 ORU | |||||
num | Handwash | Distance | stayhome | app | |
1 | I didn't know about it | I didn't know about it | I didn't know about it | I didn't know about it | |
2 | I don't remember to do it | I don't remember to do it | I don't remember to do it | I don't remember to do it | |
3 | I don't know how to do it | I don't know how to do it | I don't know how to do it | I don't know how to do it | |
4 | I don't have the resources to do it | I don't have the resources to do it | I don't have the resources to do it | I don't have the resources to do it | |
5 | No one else is doing it | No one else is doing it | No one else is doing it | No one else is doing it | |
6 | I don't want to do it | I don't want to do it | I don't want to do it | I don't want to do it | |
7 | I don't have control over whether it happens | I don't have control over whether it happens | I don't have control over whether it happens | I don't have control over whether it happens | |
8 | I don't think it makes a difference to the spread of COVID-19 | I don't think it makes a difference to the spread of COVID-19 | I don't think it makes a difference to the spread of COVID-19 | I don't think it makes a difference to the spread of COVID-19 | |
9 | I don't have a habit or routine to help me do it | I don't have a habit or routine to help me do it | I don't have a habit or routine to help me do it | I don't have a habit or routine to help me do it | |
77 | None of these | None of these | None of these | None of these | |
88 | Prefer not to answer | Prefer not to answer | Prefer not to answer | Prefer not to answer | |
Wave 4 ORU | |||||
num | wash hands | distance | stayhome | app | ffd |
1 | I didn't know about it | I didn't know about it | I didn't know about it | I didn't know about it | I didn't know about it |
2 | I don't remember to do it | I don't remember to do it | I don't remember to do it | I don't remember to do it | I don't remember to do it |
3 | I don't know how to do it | I don't know how to do it | I don't know how to do it | I don't know how to do it | I don't know how to do it |
4 | I don't have the resources to do it | I don't have the resources to do it | I don't have the resources to do it | I don't have the resources to do it | I don't have the resources to do it |
5 | No one else is doing it | No one else is doing it | No one else is doing it | No one else is doing it | No one else is doing it |
6 | I don't want to do it | I don't want to do it | I don't want to do it | I don't want to do it | I don't want to do it |
7 | I don't have control over whether it happens | I don't have control over whether it happens | I don't have control over whether it happens | I don't have control over whether it happens | I don't have control over whether it happens |
8 | I don't think it makes a difference to the spread of COVID-19 | I don't think it makes a difference to the spread of COVID-19 | I don't think it makes a difference to the spread of COVID-19 | I don't think it makes a difference to the spread of COVID-19 | I don't think it makes a difference to the spread of COVID-19 |
9 | I don't have a habit or routine to help me do it | I don't have a habit or routine to help me do it | I don't have a habit or routine to help me do it | I don't have a habit or routine to help me do it | I don't have a habit or routine to help me do it |
10 | It’s awkward to do it | ||||
11 | I forgot to do it in the moment | ||||
66 | Other - please specify | ||||
77 | None of these | None of these | None of these | None of these | None of these |
88 | Prefer not to answer | Prefer not to answer | Prefer not to answer | Prefer not to answer | Prefer not to answer |
For some reason the two manipulation checks differ beween ORU and MASTER recruitment.
This has implications for the manipulation checking code in cleaning, see
d$manip_check_info <- grepl("tracking", d$manipulation_check)
d$manip_check_safe <- grepl("protected", d$manipulation_check)
d$manip_check_no_safe <- grepl("long-term", d$manipulation_check)
d$manip_check_aut <- grepl("activate", d$manipulation_check)
d$manip_check_cont <- grepl("must", d$manipulation_check)
...
d$autonomy_manip_check_passed <- (d$aut_int & d$manip_check_aut & !d$manip_check_cont) |
(!d$aut_int & !d$manip_check_aut & d$manip_check_cont)
d$safety_manip_check_passed <- (d$safe_int & d$manip_check_safe & !d$manip_check_no_safe) |
(!d$safe_int & !d$manip_check_safe & d$manip_check_no_safe)
d$intentions_total <- d$intentions_download + d$intentions_share + d$intentions_share
manip_check_items <- grepl("manip_check", names(d))
d[d$wave != 2, manip_check_items] <- NA
Note that with the new checkboxes, the manip check items in the image above have been renamed to manipulation_check_[1-5].
SWB4 has had "select choice" as its value labels. I have fixed this in qualtrics across every wave to now code 0-10. Check I haven't inadvertently broken anything.
See email for info -
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-170147765-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-170147765-1');
</script>
Step 3 here: https://shiny.rstudio.com/articles/google-analytics.html
As with W1, I have manually renumbered the info_need_w2 checkboxes that appear in:
to be numbered 1-14. This means we should be able to delete the following code
d$info_need_w2_government_tv <- grepl("Government-funded television channels", d$info_need_w2)
attr(d$info_need_w2_government_tv, "label") <- "Government-funded television channels"
d$info_need_w2_government_radio <- grepl("Government-funded radio stations", d$info_need_w2)
attr(d$info_need_w2_government_radio, "label") <- "Government-funded radio channels"
d$info_need_w2_commercial_radio <- grepl("Commercial radio stations", d$info_need_w2)
attr(d$info_need_w2_commercial_radio, "label") <- "Commercial radio stations"
d$info_need_w2_commercial_tv <- grepl("Commercial television stations", d$info_need_w2)
attr(d$info_need_w2_commercial_tv, "label") <- "Commercial television stations"
d$info_need_w2_commercial_online <- grepl("Commercial online news", d$info_need_w2)
attr(d$info_need_w2_commercial_online, "label") <- "Commercial online news"
d$info_need_w2_newspapers <- grepl("Daily or weekly newspapers", d$info_need_w2)
attr(d$info_need_w2_newspapers, "label") <- "Daily or weekly newspapers"
d$info_need_w2_family_friends <- grepl("Family and friends", d$info_need_w2)
attr(d$info_need_w2_family_friends, "label") <- "Family and friends"
d$info_need_w2_coworkers <- grepl("Co-workers", d$info_need_w2)
attr(d$info_need_w2_coworkers, "label") <- "Co-workers"
d$info_need_w2_healthcare <- grepl("Consultation with health care workers", d$info_need_w2)
attr(d$info_need_w2_healthcare, "label") <- "Consultation with health care workers"
d$info_need_w2_authority_websites <- grepl("Government or health authority websites", d$info_need_w2)
attr(d$info_need_w2_authority_websites, "label") <- "Government or health authority websites"
d$info_need_w2_search_engines <- grepl("Search engines", d$info_need_w2)
attr(d$info_need_w2_search_engines, "label") <- "Search engines"
d$info_need_w2_social_media <- grepl("Social media", d$info_need_w2)
attr(d$info_need_w2_social_media, "label") <- "Social media"
info_need_items <- grepl("info_need_w2", names(d))
d[is.na(d$info_need_w2), info_need_items] <- NA
d <- dplyr::select(d, -info_need_w2)
info_need_w2_14_text should be retained by itself as a text item.
create dataset from csvs
create dataset from qualtrics files
fix variables that don't match before running the rest of the cleaning code
Access attempts to view "Snapshot" data are met with the following error message. "Error: An error has occurred. Check your logs or contact the app author for clarification." This message appears whether the dashboard is accessed through the https://www.scrubcovid19.org/pages/dashboard.html, or directly at https://noetel.shinyapps.io/covid/.
ORU Wave 1 (d1) intervention was deleted in Qualtrics and I have restored, check this doesn't break anything
From a previous version of the export
pledge_sum master_export_2020_06_19 oru_export_2020_06_19 0 506 5462 1 3 0 2 15 0 3 77 0 4 33 0 5 488 0
you can see that the oru export had no pledge data, this was beacuse it had its intervention removed and a draft "v2" intervention included about SDT. I have undeleted the old intervention (brought back into survey flow) and so it should now be parsed
I have renumbered the ORU and MASTER info_need checkboxes from 1-11.
This should mean you can delete
d$info_need_symptoms <- grepl("Symptoms", d$info_need)
d$info_need_stories <- grepl("stories", d$info_need)
d$info_need_science <- grepl("Scientific", d$info_need)
d$info_need_actions <- grepl("personally", d$info_need)
d$info_need_risk_group <- grepl("group", d$info_need)
d$info_need_education <- grepl("education", d$info_need)
d$info_need_travel <- grepl("travel", d$info_need)
d$info_need_my_risk <- grepl("personal risk", d$info_need)
d$info_need_testing <- grepl("tested", d$info_need)
d$info_need_none <- grepl("don", d$info_need)
info_need_items <- grepl("info_need_", names(d))
info_need_items <- xor(info_need_items, grepl("info_need_w2", names(d)))
d[is.na(d$info_need), info_need_items] <- NA
d <- dplyr::select(d, -info_need)
as they will automatically work from the extraction of d1_boxes and d2_boxes.
there should still remain info_need_11_text; this should be kept.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.