Reply To: reaction time results appear in different two columns

PennController for IBEX Forums Support reaction time results appear in different two columns Reply To: reaction time results appear in different two columns

#6301
Jeremy
Keymaster

Hi,

You will need to do some more transformations on your data frames. Here is what you can do:

# Set 'group' to non-null value for each participant
require(dplyr)
dashed_results <- dashed_results %>% 
  group_by(Time.results.were.received, MD5.hash.of.participant.s.IP.address) %>%
  mutate(group=max(group))

# Select fields from all_results, make them columns per item, and merge with dashed_results
require(tidyr)
fields <- c("yesnocorrect","scalecorrect","whicharticle")
correct_which_results <- subset(all_results, PennElementName%in%fields)
correct_which_results <- correct_which_results %>% 
  group_by(Time.results.were.received, MD5.hash.of.participant.s.IP.address, Item.number) %>%
  select(Time.results.were.received, MD5.hash.of.participant.s.IP.address, Item.number, PennElementName, Value) %>%
  spread(., PennElementName, Value)
dashed_results <- merge(dashed_results, correct_which_results,
      by=c("Time.results.were.received", "MD5.hash.of.participant.s.IP.address", "Item.number"))

You’ll still have some NAs for whicharticle because you didn’t seem to have that Scale for your filler items.

Jeremy

  • This reply was modified 4 years ago by Jeremy. Reason: replaced tmp with dashed_results