def prepareBEH(self, project, part, factors, labels, project_param): ''' standard Behavior processing ''' PP = PreProcessing(project = project, part = part, factor_headers = factors, factor_labels = labels) PP.create_folder_structure() PP.combine_single_subject_files(save = False) PP.select_data(project_parameters = project_param, save = False) #PP.filter_data(to_filter = to_filter, filter_crit = ' and correct == 1', cnd_sel = False, save = True) #PP.exclude_outliers(criteria = dict(dev_0 = '')) #PP.prep_JASP(agg_func = 'mean', voi = 'dev_0', data_filter = "", save = True) PP.save_data_file()
def prepareBEH(self, project, part, factors, labels, project_param, to_filter): ''' standard Behavior processing ''' PP = PreProcessing(project=project, part=part, factor_headers=factors, factor_labels=labels) PP.create_folder_structure() PP.combine_single_subject_files(save=False) PP.select_data(project_parameters=project_param, save=False) PP.filter_data(to_filter=to_filter, filter_crit=' and correct == 1', cnd_sel=False, save=True) PP.exclude_outliers(criteria=dict(RT='RT_filter == True', correct='')) PP.save_data_file()
def prepareRep(self, project, part, factors, labels, project_param): ''' standard Behavior processing ''' PP = PreProcessing(project=project, part=part, factor_headers=factors, factor_labels=labels) PP.create_folder_structure() PP.combine_single_subject_files(save=False) PP.select_data(project_parameters=project_param, save=False) PP.filter_data(to_filter=to_filter, filter_crit=' and search_resp == 1', cnd_sel=False, save=True) PP.exclude_outliers(criteria=dict(RT_search="RT_search_filter == True", search_resp="", memory_resp="")) # create JASP output pivot_data = PP.work_data.query("RT_search_filter == True") pivot = pivot_data.pivot_table(values='RT_search', index='subject_nr', columns=PP.factor_headers, aggfunc='mean') # limit analysis to load 1 headers = [ 'no-suppr_match', 'no-suppr_neutral', 'suppr_match', 'suppr_neutral', 'no' ] X = np.zeros((pivot.shape[0], len(headers))) X[:, 0] = np.stack((pivot['rel-match']['no'][1].values, pivot['rel-mis']['no'][1].values)).mean(axis=0) X[:, 1] = pivot['unrel']['no'][1].values X[:, 2] = np.stack((pivot['rel-match']['yes'][1].values, pivot['rel-mis']['yes'][1].values)).mean(axis=0) X[:, 3] = pivot['unrel']['yes'][1].values X[:, 4] = np.stack((pivot['no']['no'][1].values, pivot['no']['yes'][1].values)).mean(axis=0) np.savetxt(self.FolderTracker(['exp2', 'analysis'], filename='RT_JASP.csv'), X, delimiter=",", header=",".join(headers), comments='')