Code Monkey home page Code Monkey logo

readi-scrub's People

Contributors

aksaeri avatar bjsmith avatar mnoetel avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

aksaeri

readi-scrub's Issues

Checkbox question attributes missing

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

Wave 5 error with the less than or equal to character

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.

Check that bar_fogg items are numbered 1-11, 66, 77, 88

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

Wave 2 manipulation checks differ between ORU and MASTER

image

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].

Check SWB4 fixes to value labels work

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.

Check that info_need_w2_ checkboxes are numbered 1-14

As with W1, I have manually renumbered the info_need_w2 checkboxes that appear in:

  • Wave 2 ORU
  • Wave 2 MASTER
  • Wave 3 ORU
  • Wave 3 MASTER

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.

Check restoration of ORU W1 (d1) intervention doesn't break anything

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

Check that the Wave 1 info_need checkboxes are numbered 1-11

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.

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.