--- title: "007_LookAnalysis_eR_10_1_21" author: "Katharine Aveni" date: "October 1, 2021" output: html_document --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) ``` #Load Libraries & Data ```{r load libraries and data} #load Data viewer tab-separated sample report; set . and NA as missing value marker #replace argument after "read.table" with your txt file dat007Look <- read.table("C:\\Users\\katie\\OneDrive\\Desktop\\10_17_19_LookAt_SentenceDur_Extended.txt", header = T, sep = "\t", na.strings = c(".", "NA")) #load required packages library("Matrix") library("plyr") library("dplyr") library("tidyr") library("lme4") library("ggplot2") library("eyetrackingR") ``` # Create and clean required columns ##Subject & IA column relabeling ```{r Subject & IA column relabeling} #rename column "RECORDING_SESSION_LABEL" to "Subject" names(dat007Look)[names(dat007Look) == "RECORDING_SESSION_LABEL"] <- "Subject" #label IAs consistently dat007Look$RIGHT_INTEREST_AREA_ID[dat007Look$RIGHT_INTEREST_AREA_LABEL %in% c("DIS_ACTIONRELATED_IA")] <- 3 #label trials consistently dat007Look$trial_name[dat007Look$trial_name=="ExpB_Item_A" | dat007Look$audiofile=="EB_helmet.wav"] <- "ExpB_Item 1" dat007Look$trial_name[dat007Look$trial_name %in% c("ExpB_Item_B")] <- "ExpB_Item 2" dat007Look$trial_name[dat007Look$trial_name %in% c("ExpB_Item_C")] <- "ExpB_Item 3" dat007Look$trial_name[dat007Look$trial_name %in% c("ExpB_Item_D")] <- "ExpB_Item 4" dat007Look$trial_name[dat007Look$trial_name %in% c("ExpB_Item_E")] <- "ExpB_Item 5" dat007Look$trial_name[dat007Look$trial_name %in% c("ExpB_Item_F")] <- "ExpB_Item 6" dat007Look$trial_name[dat007Look$trial_name %in% c("ExpB_Item_G")] <- "ExpB_Item 7" dat007Look$trial_name[dat007Look$trial_name %in% c("ExpB_Item_H")] <- "ExpB_Item 8" dat007Look$trial_name[dat007Look$trial_name %in% c("ExpB_Item_I")] <- "ExpB_Item 9" dat007Look$trial_name[dat007Look$trial_name %in% c("ExpB_Item_J")] <- "ExpB_Item 10" dat007Look$trial_name[dat007Look$trial_name %in% c("ExpB_Item_K")] <- "ExpB_Item 11" dat007Look$trial_name[dat007Look$trial_name %in% c("ExpB_Item_L")] <- "ExpB_Item 12" dat007Look$trial_name[dat007Look$trial_name %in% c("ExpB_Item_M")] <- "ExpB_Item 13" dat007Look$trial_name[dat007Look$trial_name %in% c("ExpB_Item_N")] <- "ExpB_Item 14" dat007Look$trial_name[dat007Look$trial_name %in% c("ExpB_Item_O")] <- "ExpB_Item 15" dat007Look$trial_name[dat007Look$trial_name %in% c("ExpB_Item_P")] <- "ExpB_Item 16" dat007Look$trial_name[dat007Look$trial_name %in% c("ExpB_Item_Q")] <- "ExpB_Item 17" dat007Look$trial_name[dat007Look$trial_name %in% c("ExpB_Item_R")] <- "ExpB_Item 18" dat007Look$trial_name[dat007Look$trial_name %in% c("ExpB_Item_S")] <- "ExpB_Item 19" dat007Look$trial_name[dat007Look$trial_name %in% c("ExpB_Item_T")] <- "ExpB_Item 20" length(unique(dat007Look$trial_name)) list(unique(dat007Look$trial_name)) ``` ##MARK SAMPLES WHERE TRACKLOSS OCCURS, creating new TrackLoss column Trackloss defined as missing values for right gaze x & y and left gaze x & y. Used is.na function bc previously set to read "." as missing data marker. If . still appears in data, use Juweiriya's version of this code ```{r Trackloss} dat007Look %>% mutate(TrackLoss = ifelse(is.na(dat007Look$RIGHT_GAZE_X) & is.na(dat007Look$RIGHT_GAZE_Y) & is.na(dat007Look$LEFT_GAZE_X) & is.na(dat007Look$RIGHT_GAZE_Y), TRUE, FALSE)) -> dat007Look ``` ##MAKE AOI COLUMNS ```{r} #check what IAS appear unique(dat007Look$RIGHT_INTEREST_AREA_LABEL) #Creates columns with T/F values for each IA for each sample (TRUE if that IA is being looked at & not missing) dat007Look %>% mutate(Outside = ifelse((is.na(RIGHT_INTEREST_AREA_LABEL) & is.na(LEFT_INTEREST_AREA_LABEL)), TRUE, FALSE)) %>% mutate(Target = ifelse((RIGHT_INTEREST_AREA_LABEL =="TARGET_IA" & !is.na(RIGHT_INTEREST_AREA_LABEL)) | (LEFT_INTEREST_AREA_LABEL =="TARGET_IA" & !is.na(LEFT_INTEREST_AREA_LABEL)), TRUE, FALSE)) %>% mutate(Dis1 = ifelse((RIGHT_INTEREST_AREA_LABEL == "DIS_ACTIONRELATED_IA" & !is.na(RIGHT_INTEREST_AREA_LABEL)) | (LEFT_INTEREST_AREA_LABEL == "DIS_ACTIONRELATED_IA" & !is.na(LEFT_INTEREST_AREA_LABEL)), TRUE, FALSE)) %>% mutate(Dis2 = ifelse((RIGHT_INTEREST_AREA_LABEL == "DIS_AGENTRELATED_IA" & !is.na(RIGHT_INTEREST_AREA_LABEL)) | (LEFT_INTEREST_AREA_LABEL == "DIS_AGENTRELATED_IA" & !is.na(LEFT_INTEREST_AREA_LABEL)), TRUE, FALSE)) %>% mutate(Dis3 = ifelse((RIGHT_INTEREST_AREA_LABEL == "DIS_UNRELATED_IA" & !is.na(RIGHT_INTEREST_AREA_LABEL)) | (LEFT_INTEREST_AREA_LABEL == "DIS_UNRELATED_IA" & !is.na(LEFT_INTEREST_AREA_LABEL)), TRUE, FALSE)) -> dat007Look #additionally recodes looks to cross IA or question block IA as outside dat007Look$Outside[(dat007Look$RIGHT_INTEREST_AREA_LABEL == "CROSS" & !is.na(dat007Look$RIGHT_INTEREST_AREA_LABEL)) | (dat007Look$LEFT_INTEREST_AREA_LABEL == "CROSS" & !is.na(dat007Look$LEFT_INTEREST_AREA_LABEL)) ] <- TRUE # dat007Look$Outside[(dat007Look$RIGHT_INTEREST_AREA_LABEL == "RECTANGLE_INTERESTAREA" & !is.na(dat007Look$RIGHT_INTEREST_AREA_LABEL)) | # (dat007Look$LEFT_INTEREST_AREA_LABEL == "RECTANGLE_INTERESTAREA" & !is.na(dat007Look$LEFT_INTEREST_AREA_LABEL)) ] <- TRUE #Create and fill out group column dat007Look %>% mutate(Group = ifelse(Subject == "007_06" | Subject =="007_08"| Subject =="007_10"| Subject =="007_13"| Subject =="007_19"| Subject =="007_29"| Subject =="007_34"| Subject =="007_35"| Subject =="007_36"| Subject =="007_37"| Subject =="007_41"| Subject =="007_43"| Subject =="007_44"| Subject =="007_45"| Subject =="007_49"| Subject =="007_51"| Subject =="007_52"| Subject =="007_54"| Subject =="007_55"| Subject =="007_56"| Subject =="007_60"| Subject =="007_61"| Subject =="007_63"| Subject =="007_69"| Subject =="007_71", "CONTROL", "PD")) -> dat007Look ``` # Select rows of interest These parameters select AVT non-practice trials only & no question trials. Excludes 007_32 due to closing eyes; 37 due to trackloss; 01 pilot ```{r} #filter in desired trial types dat007Look <- dat007Look[ which(dat007Look$blockgroup==3),] dat007Look <- dat007Look[ which(dat007Look$attnquestion==0),] dat007Look <- dat007Look[ which(dat007Look$Subject != "007_01"),] dat007Look <- dat007Look[ which(dat007Look$Subject != "007_32"),] dat007Look <- dat007Look[ which(dat007Look$Subject != "007_37"),] ``` # Check number of subjects and trials per subject ```{r} # subjects length(unique(dat007Look$Subject)) # trials ddply(dat007Look, c("Subject"), summarize, N=length(unique(TRIAL_LABEL))) length(unique(dat007Look$trial_name)) #uncomment this section to view individual trials present in data #ddply(dat007Look, c("Subject"), summarize, (unique(TRIAL_LABEL))) ``` # Make Eyetracking R Data ```{r} datLookER <- make_eyetrackingr_data(dat007Look, participant_column = "Subject", trial_column = "TRIAL_INDEX", time_column = "TIMESTAMP", trackloss_column = "TrackLoss", aoi_columns = c('Target','Dis1', 'Dis2', 'Dis3'), treat_non_aoi_looks_as_missing = TRUE ) datLookER %>% mutate(UniqueTrial = paste(datLookER$Subject, datLookER$trial_name, sep = '_'))-> datLookER ``` #Set the exported IP to timestamp of 0. Begins right at the presentation of article sound, therefore includes initial ~200ms where looks are not driven by the played sound. ```{r} look_window_plus <- subset_by_window(datLookER, rezero = TRUE, remove = TRUE, window_start_col = "IP_START_TIME", window_end_col = "IP_END_TIME") ``` #Create time sequence for cleaning pre-anticipatory looks (includes initial 200ms) ```{r} #create time sequence look_time_seq_plus <-make_time_sequence_data(look_window_plus, time_bin_size = 50, predictor_columns = c("Group", "trial_name", "audiofile", "UniqueTrial"), aois = c("Target", "Dis1", "Dis2", "Dis3") ) #sent_time_seq[ which(sent_time_seq$TimeBin < 10),] -> sent_time_seq_mini #sent_time_seq_mini <- sent_time_seq_mini[ , -which(names(sent_time_seq_mini) %in% c("ot1","ot2", "ot3","ot4", "ot5","ot6", "ot7"))] #sent_time_seq_mini <- sent_time_seq_mini [ sent_time_seq_mini$Subject %in% c("007_02","007_03", "007_06"), ] ``` #Identify trials where Ss primarily looked to target in 50ms preceeding sentence onset Do this before removing trials for trackloss (?) ```{r} #trials to exclude/model: rows where time bin = 3 (149-200ms based on full sentence window) & AOI = target & Prop > .4999 #create a dataframe containing just time bin 3 for pre-anticipated trials in original data frame trials_reference <- look_time_seq_plus[ which(look_time_seq_plus$TimeBin == 3),] #label which of those rows were pre-anticipated (proportion looks to target >.49999) trials_reference %>% mutate(pre_anticipated = ifelse(trials_reference$AOI=="Target" & trials_reference$TimeBin == 3 & trials_reference$Prop > .49999, TRUE, FALSE)) -> trials_reference #remove trials in look_window_plus where UniqueTrial ID matches any UniqueTrial ID in pre_anticipated trials # Then you use that subset of the data as a reference, and alter the original data by adding a new column (e.g., "drop2", but could be whatever) that, for every participant-trial id, looks up that id in the lookup data and assigns the value in "drop" to the new column. look_window_plus <- look_window_plus %>% mutate(to_remove = trials_reference$pre_anticipated[ match(unlist(look_window_plus$UniqueTrial), trials_reference$UniqueTrial)]) #drop "to remove" items filter(look_window_plus, look_window_plus$to_remove==FALSE) -> look_window_plus_clean filter(look_window_plus, look_window_plus$to_remove==TRUE) -> removed_samples ``` ```{r See pre-anticipated trials for early subjects, eval=FALSE, echo=FALSE} # Next: OPTIONAL, get list of pre-anticipated trials for subset of subjects (used to find non-anticipated trials to use as the bases for interpolating trials later on) pre_anticipated_trials <- look_time_seq_plus[which(look_time_seq_plus$AOI=="Target" & look_time_seq_plus$TimeBin == 3 & look_time_seq_plus$Prop > .49999),] pre_anticipated_trials_earlySs <- pre_anticipated_trials[ which(pre_anticipated_trials$Subject == "007_02" | pre_anticipated_trials$Subject =="007_03"| pre_anticipated_trials$Subject =="007_04"| pre_anticipated_trials$Subject =="007_05"| pre_anticipated_trials$Subject =="007_06"),] write.csv(pre_anticipated_trials_Look_earlySs, file = "earlySs_anticipated_look_trials.csv") ``` Finds 241 trials (out of 960). 25.1% of trials began with looks primarily to target # Zoom in to sentence window duration (966ms) adjusted by 200. adds 50ms to allow extension of target analysis window Rezeros as well, so all times are now saccade-adjusted. No need for further adjustments. ```{r} look_window <- subset_by_window(look_window_plus, #OR look_window_plus_clean window_start_time = 200, window_end_time = 1216, rezero = TRUE, remove = TRUE) ``` # Assess and Clean Trackloss ```{r} # analyze amount of trackloss by subjects and trials (trackloss <- trackloss_analysis(data = look_window)) #remove trials with trackloss greater than threshold (here, 25%) look_window_clean <- clean_by_trackloss(data = look_window, trial_prop_thresh = .25) #re-assess trackloss following cleaning trackloss_clean <- trackloss_analysis(data = look_window_clean) #prints mean trackloss by participants following cleaning of trials >threshold loss (trackloss_clean_subjects <- unique(trackloss_clean[, c('Subject','TracklossForParticipant')])) # get mean% samples contributed per trial, with SD mean(1 - trackloss_clean_subjects$TracklossForParticipant) sd(1- trackloss_clean_subjects$TracklossForParticipant) # See number of (non-lossy) trials contributed by subject in the NumTrials column (final_summary <- describe_data(look_window_clean, 'Target', 'Subject')) #see mean/SD of trials remaining after cleaning mean(final_summary$NumTrials) sd(final_summary$NumTrials) ``` ###Trackloss set to 25%, subjects 32 & 37 removed, pre-anticipated trials removed, based on look window: 25 trials removed for trackloss. Retains 98.11% of trials? saccades? (2.03%). Mean remaining trials is 13.21, sd 2.71. Highest remaining % of trackloss is 8.3% (subject 51) Lowest # of remaining trials is 4 (again subject 51, unclear whether driven mainly by trackloss or predictive looks). #Save this file as base set of trials for subsequent window analyses ```{r Save eyetrackingR data cleaned for target-initial trials and trackloss} #saveRDS(look_window_clean, file = "007_Look_data_clean.rds") saveRDS(look_window_clean, file = "007_Look_data_clean_alltrials.rds") ``` saved 4/27/21. version without all trials saved 3/30/20 ```{r load clean, interpolated verb time sequence} #look_window_clean <- readRDS("007_Look_data_clean.rds", refhook = NULL) look_window_clean <- readRDS("007_Look_data_clean_alltrials.rds", refhook = NULL) #load required packages library("Matrix") library("plyr") library("dplyr") library("tidyr") library("lme4") library(lmerTest) library("ggplot2") library("eyetrackingR") library(sjstats) ``` # Make and Plot Time Sequence ##Full sentence window ```{r} #create time sequence look_time_seq <-make_time_sequence_data(look_window_clean, time_bin_size = 50, predictor_columns = c("Group", "trial_name", "list") ) ``` #Interpolate values for set 9 trials for subjects 2-6. 007_02: list 9 007_03: list 10 007_04: list 10 007_05: list 1 007_06: list 2 ```{r Create vectors for interpolated trials (problem trials)} # store vectors for: original trial info; props for each bin in surrounding 2 trials; averaged new trial. #SUBJECT 007_05 #interpolate trial Q/17 `i_05_16` <- subset(look_time_seq, Subject == "007_05" & trial_name == "ExpB_Item 16", select = c("Prop")) `i_05_15` <- subset(look_time_seq, Subject == "007_05" & trial_name == "ExpB_Item 15", select = c("Prop")) look_time_seq[which(look_time_seq$Subject == "007_05" & look_time_seq$trial_name == "ExpB_Item 17"), "Prop"] <- ((`i_05_16` + `i_05_15`)/2) #interpolate trial J/10 `i_05_8` <- subset(look_time_seq, Subject == "007_05" & trial_name == "ExpB_Item 8", select = c("Prop")) `i_05_14` <- subset(look_time_seq, Subject == "007_05" & trial_name == "ExpB_Item 14", select = c("Prop")) look_time_seq[which(look_time_seq$Subject == "007_05" & look_time_seq$trial_name == "ExpB_Item 10"), "Prop"] <- ((`i_05_8` + `i_05_14`)/2) #SUBJECT 02 #interpolate trial J/10 `i_02_4` <- subset(look_time_seq, Subject == "007_02" & trial_name == "ExpB_Item 4", select = c("Prop")) `i_02_16` <- subset(look_time_seq, Subject == "007_02" & trial_name == "ExpB_Item 16", select = c("Prop")) look_time_seq[which(look_time_seq$Subject == "007_02" & look_time_seq$trial_name == "ExpB_Item 10"), "Prop"] <- ((`i_02_4` + `i_02_16`)/2) #interpolate trial Q/17 `i_02_15` <- subset(look_time_seq, Subject == "007_02" & trial_name == "ExpB_Item 15", select = c("Prop")) `i_02_5` <- subset(look_time_seq, Subject == "007_02" & trial_name == "ExpB_Item 5", select = c("Prop")) look_time_seq[which(look_time_seq$Subject == "007_02" & look_time_seq$trial_name == "ExpB_Item 17"), "Prop"] <- ((`i_02_15` + `i_02_5`)/2) #SUBJECT 06 #interpolate trial Q/17 `i_06_15` <- subset(look_time_seq, Subject == "007_06" & trial_name == "ExpB_Item 15", select = c("Prop")) `i_06_11` <- subset(look_time_seq, Subject == "007_06" & trial_name == "ExpB_Item 11", select = c("Prop")) look_time_seq[which(look_time_seq$Subject == "007_06" & look_time_seq$trial_name == "ExpB_Item 17"), "Prop"] <- ((`i_06_15` + `i_06_11`)/2) #SUBJECT 04 #interpolate trial J/10 `i_04_12` <- subset(look_time_seq, Subject == "007_04" & trial_name == "ExpB_Item 12", select = c("Prop")) `i_04_6` <- subset(look_time_seq, Subject == "007_04" & trial_name == "ExpB_Item 6", select = c("Prop")) look_time_seq[which(look_time_seq$Subject == "007_04" & look_time_seq$trial_name == "ExpB_Item 10"), "Prop"] <- ((`i_04_12` + `i_04_6`)/2) ``` ```{r Save interpolated data file} #save the cleaned file to run in verb/object window analysis scripts. Or plot/analyse overall sentence below. #saveRDS(look_time_seq, file = "007_Look_data_clean_interpolated.rds") saveRDS(look_time_seq, file = "007_Look_data_clean_interpolated_alltrials.rds") ``` ```{r Load previously cleaned data} #look_time_seq <- readRDS("007_Look_data_clean_interpolated.rds", refhook = NULL) look_time_seq <- readRDS("007_Look_data_clean_interpolated_alltrials.rds", refhook = NULL) look_time_seq$Group <- as.factor(look_time_seq$Group) look_time_seq$AOI <- as.factor(look_time_seq$AOI) look_time_seq$list <- as.factor(look_time_seq$list) #load required packages library(Matrix) library(plyr) library(dplyr) library(tidyr) library(lme4) library(lmerTest) library(ggplot2) library(eyetrackingR) ``` #final prep for plotting/modeling ```{r final prep for plotting/modeling} #create column for natural quadratic time polynomial, if using; and to convert looks to binomial look_time_seq %>% mutate(Time2 = Time^2) %>% mutate(BiProp = ifelse(Prop > .5, 1, 0)) -> look_time_seq #center groupvariable/use sum contrasts contrasts(look_time_seq$Group) <- c(-.5, .5) #change order of levels in AOI factor in order to change plot default levels(as.factor(look_time_seq$AOI)) look_time_seq$AOI <- factor(look_time_seq$AOI, levels = c("Target", "Dis1", "Dis2", "Dis3")) #create dataframe with average proportions from each subject, splits AOIs into different columns look_time_seq %>% filter(!is.na(Prop)) %>% group_by(Subject, AOI, Time, Group) %>% summarise(MeanProp = mean(Prop), y=sum(Prop), N=length(Prop), Time=min(Time)) ->look_time_seq_avg #add new column that converts probabilities to logits look_time_seq_avg$Logit <- qlogis(look_time_seq_avg$MeanProp) ``` Added manually group-centered data (PD -> .5, Cx -> -.5), but outputs look the same. r automatically centers categoricals, so better to use in case of uneven n across? # visualize time results ```{r} tiff("Z:\\LCAN_Internal\\LCAN_007_LangPrediction_QRP\\Analyses\\ET_Data\\Results\\Look_plot_8_13_21.tiff", units="in", width=12, height=7.5, res=300) print(ggplot(look_time_seq, aes(x = Time, y = BiProp, col= AOI)) + stat_summary(geom="line", size = 2) + stat_summary(fun.data = mean_se, geom = "errorbar", aes(color=paste("mean_se", AOI)))+ theme_minimal() + theme(legend.position="NULL", legend.box = "horizontal") + theme(legend.text=element_text(size=rel(1.2))) + expand_limits(x = 1300) + facet_grid(. ~ Group) + geom_vline(xintercept=391) + annotate(geom="text", x=540, y=.97, label="[target]'", color="black", size=6.5) + annotate(geom="text", x=170, y=.97, label="'Look at the", color="gray58", size=6.5) + annotate(geom="text", x=1190, y=.04, label="Distractors", color="gray58", size=6.5) + annotate(geom="text", x=1150, y=.9, label="Target", color="black", size=6.5) + scale_color_manual(labels = c("Target", "Distractor 1", "Distractor 2", "Distractor 3"), values=c('gray85','gray68','gray48', 'gray85', 'gray68','gray48', 'black', 'black' )) + labs(title="Non-Predictive Sentences", x ="Time (ms)", y = "Proportion of Trials") + theme(strip.text.x = element_text(size = 18, colour = "black", angle = 0)) + theme(text = element_text(size=18))) dev.off() ``` ```{r visualize baseline sentence results logit scale} tiff("Z:\\LCAN_Internal\\LCAN_007_LangPrediction_QRP\\Analyses\\ET_Data\\Results\\Look_plot_logit_11_17.tiff", units="in", width=12, height=7.5, res=300) print(ggplot(look_time_seq_avg, aes(x = Time, y = Logit, col= AOI)) + stat_summary(geom="line", size = 2) + stat_summary(fun.data = mean_se, geom = "errorbar", aes(color=paste("mean_se", AOI)))+ theme_minimal() + theme(legend.position="NULL", legend.box = "horizontal") + theme(legend.text=element_text(size=rel(1.2))) + expand_limits(x = 1300) + facet_grid(. ~ Group) + geom_vline(xintercept=391) + annotate(geom="text", x=540, y=1.8, label="[target]'", color="black", size=6.5) + annotate(geom="text", x=170, y=1.8, label="'Look at the", color="gray58", size=6.5) + annotate(geom="text", x=1190, y=-3, label="Distractors", color="gray58", size=6.5) + annotate(geom="text", x=1150, y=2, label="Target", color="black", size=6.5) + scale_color_manual(labels = c("Target", "Distractor 1", "Distractor 2", "Distractor 3"), values=c('gray85','gray68','gray48', 'gray85', 'gray68','gray48', 'black', 'black' )) + labs(title="Baseline Sentences", x ="Time (ms)", y = "Log odds of fixations on each AOI") + theme(strip.text.x = element_text(size = 18, colour = "black", angle = 0)) + theme(text = element_text(size=18))) dev.off() ``` ```{r Test whether lines differ from chance in beginning of look window} # #subset and test dis1 # look_time_seq_early_dis1 <- look_time_seq[which(look_time_seq$TimeBin==0 & look_time_seq$AOI =="Dis1"),] # # look_time_seq_early_dis1_PD <- look_time_seq[which(look_time_seq$TimeBin==0 & look_time_seq$AOI =="Dis1" & look_time_seq$Group == "PD"),] # look_time_seq_early_dis1_Cx <- look_time_seq[which(look_time_seq$TimeBin==0 & look_time_seq$AOI =="Dis1" & look_time_seq$Group == "CONTROL"),] # t.test(look_time_seq_early_dis1_PD$BiProp, mu=.333) #0.1135 # t.test(look_time_seq_early_dis1_Cx$BiProp, mu=.333) #0.6373 # # #subset and test dis2 # look_time_seq_early_dis2 <- look_time_seq[which(look_time_seq$TimeBin==0 & look_time_seq$AOI =="Dis2"),] # t.test(look_time_seq_early_dis2$BiProp, mu=.333) # # look_time_seq_early_dis2_PD <- look_time_seq[which(look_time_seq$TimeBin==0 & look_time_seq$AOI =="Dis2" & look_time_seq$Group == "PD"),] # look_time_seq_early_dis2_Cx <- look_time_seq[which(look_time_seq$TimeBin==0 & look_time_seq$AOI =="Dis2" & look_time_seq$Group == "CONTROL"),] # t.test(look_time_seq_early_dis2_PD$BiProp, mu=.333) #0.2894 # t.test(look_time_seq_early_dis2_Cx$BiProp, mu=.333) #0.08396 # mean(look_time_seq_early_dis2_Cx$BiProp) #0.2885 # # #subset and test dis3 # look_time_seq_early_dis3 <- look_time_seq[which(look_time_seq$TimeBin==0 & look_time_seq$AOI =="Dis3"),] # t.test(look_time_seq_early_dis3$BiProp, mu=.333) # # look_time_seq_early_dis3_PD <- look_time_seq[which(look_time_seq$TimeBin==0 & look_time_seq$AOI =="Dis3" & look_time_seq$Group == "PD"),] # look_time_seq_early_dis3_Cx <- look_time_seq[which(look_time_seq$TimeBin==0 & look_time_seq$AOI =="Dis3" & look_time_seq$Group == "CONTROL"),] # # t.test(look_time_seq_early_dis3_PD$BiProp, mu=.333) #0.4778 # t.test(look_time_seq_early_dis3_Cx$BiProp, mu=.333) #0.5456 ```