Skip to content

Commit

Permalink
Corrected inclusion from ER to FMOV
Browse files Browse the repository at this point in the history
  • Loading branch information
GNilsonne committed Jul 11, 2016
1 parent 2fac974 commit b71f236
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions Analyses_of_demographic_data_and_rating_scales.R
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,8 @@ t.test(IRIdiff2 ~ Treatment, data = demData[demData$Included_EP == TRUE, ])

# Analyse effect of oxazepam on rated state anxiety
# Make dataframe for mixed-effects model
STAISData <- rbind(demData[, c("Subject", "Treatment", "Wave", "Included_EP", "Included_ER", "STAI.S", "STAI.S.Scrambled")], demData[, c("Subject", "Treatment", "Wave", "Included_EP", "Included_ER", "STAI.S", "STAI.S.Scrambled")])
STAISData <- STAISData[STAISData$Included_EP == T | STAISData$Included_ER == T, ] # Remove participants not included in this experiment
STAISData <- rbind(demData[, c("Subject", "Treatment", "Wave", "Included_EP", "Included_FMOV", "STAI.S", "STAI.S.Scrambled")], demData[, c("Subject", "Treatment", "Wave", "Included_EP", "Included_FMOV", "STAI.S", "STAI.S.Scrambled")])
STAISData <- STAISData[STAISData$Included_EP == T | STAISData$Included_FMOV == T, ] # Remove participants not included in this experiment
STAISData$FirstOrSecond <- c(rep.int(1, 0.5*length(STAISData$Subject)), rep.int(2, 0.5*length(STAISData$Subject)))
STAISData$STAIS <- NA # Make new column for STAI-S rating, then fill it with values for the first and second ratings, respectively
STAISData$STAIS[STAISData$FirstOrSecond == 1] <- STAISData$STAI.S[STAISData$FirstOrSecond == 1]
Expand Down Expand Up @@ -288,7 +288,7 @@ dev.off()

# Analyse participants' guesses of treatment group membership
demData$Guessed.group <- factor(demData$Guessed.group, levels = c("Placebo", "Likely_placebo", "Equivocal", "Likely_oxa", "Oxazepam"), ordered = TRUE)
demData$Guessed.group[demData$Included_EP == 0 & demData$Included_ER == 0] <- NA
demData$Guessed.group[demData$Included_EP == 0 & demData$Included_FMOV == 0] <- NA

pdf("Fig_Blinding.pdf", width = 4, height = 4)
barplot(t(matrix(c(table(demData$Guessed.group[demData$Treatment == "Placebo"]), table(demData$Guessed.group[demData$Treatment == "Oxazepam"])), nr = 5)),
Expand Down
4 changes: 2 additions & 2 deletions Analyses_of_reaction_times.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ demDataURL <- getURL("https://raw.githubusercontent.com/GNilsonne/Data-and-analy
demData <- read.csv(text = demDataURL)

# Merge data, retain only included participants
RTData <- merge(RTData, demData[, c("Subject", "Included_EP", "Included_ER")], by = "Subject")
RTData <- RTData[(RTData$Included_EP == TRUE | RTData$Included_ER == TRUE), ]
RTData <- merge(RTData, demData[, c("Subject", "Included_EP", "Included_FMOV")], by = "Subject")
RTData <- RTData[(RTData$Included_EP == TRUE | RTData$Included_FMOV == TRUE), ]

# Inverse transform
RTData$Inv_RT <- 1/RTData$ResponseTime_ms
Expand Down

0 comments on commit b71f236

Please sign in to comment.