@@ -38,6 +38,7 @@ def __init__(self, audio_condition1_data, audio_condition2_data, web_condition1_
3838 self .descriptive_data = pd .DataFrame ({})
3939
4040 self .evaluate_scores ()
41+ self .make_descriptive_statistics ()
4142
4243 def evaluate_scores (self ):
4344 #self.calculate_significance(pd.concat([self.web1_data['SUS Score'],self.audio2_data['SUS Score']]), pd.concat([self.audio1_data['SUS Score'],self.web2_data['SUS Score']]), is_within_subject=False)
@@ -47,6 +48,9 @@ def evaluate_scores(self):
4748 SUS_between_condition2_stat , SUS_between_condition2_p = self .calculate_significance (self .audio2_data ['SUS Score' ], self .web2_data ['SUS Score' ], is_within_subject = False )
4849 SUS_between_condition1_stat , SUS_between_condition1_p = self .calculate_significance (self .audio1_data ['SUS Score' ], self .web1_data ['SUS Score' ], is_within_subject = False )
4950
51+ Quiz_between_baseline_audio_stat , Quiz_between_baseline_audio_p = self .calculate_significance (self .audio1_data ['Quiz Score' ], self .quiz_data ['Quiz Score' ], is_within_subject = False )
52+ Quiz_between_baseline_web_stat , Quiz_between_baseline_web_p = self .calculate_significance (self .web1_data ['Quiz Score' ], self .quiz_data ['Quiz Score' ], is_within_subject = False )
53+
5054 Quiz_within_audio_stat , Quiz_within_audio_p = self .calculate_significance (self .audio2_data ['Quiz Score' ], self .audio1_data ['Quiz Score' ], is_within_subject = True )
5155 Quiz_within_web_stat , Quiz_within_web_p = self .calculate_significance (self .web2_data ['Quiz Score' ], self .web1_data ['Quiz Score' ], is_within_subject = True )
5256 Quiz_between_condition2_stat , Quiz_between_condition2_p = self .calculate_significance (self .audio2_data ['Quiz Score' ], self .web2_data ['Quiz Score' ], is_within_subject = False )
@@ -64,21 +68,67 @@ def evaluate_scores(self):
6468
6569 self .significance_data = pd .DataFrame ({
6670 "Test" : ["SUS within audio" , "SUS within web" , "SUS between condition 2" , "SUS between condition 1" ,
71+ "Quiz between baseline audio" , "Quiz between baseline web" ,
6772 "Quiz within audio" , "Quiz within web" , "Quiz between condition 2" , "Quiz between condition 1" ,
6873 "IOS robot within audio" , "IOS robot within web" , "IOS robot between condition 2" , "IOS robot between condition 1" ,
6974 "IOS group within audio" , "IOS group within web" , "IOS group between condition 2" , "IOS group between condition 1" ],
7075 "Statistic" : [SUS_within_audio_stat , SUS_within_web_stat , SUS_between_condition2_stat , SUS_between_condition1_stat ,
76+ Quiz_between_baseline_audio_stat , Quiz_between_baseline_web_stat ,
7177 Quiz_within_audio_stat , Quiz_within_web_stat , Quiz_between_condition2_stat , Quiz_between_condition1_stat ,
7278 IOS_robot_within_audio_stat , IOS_robot_within_web_stat , IOS_robot_between_condition2_stat , IOS_robot_between_condition1_stat ,
7379 IOS_group_within_audio_stat , IOS_group_within_web_stat , IOS_group_between_condition2_stat , IOS_group_between_condition1_stat ],
7480 "p-value" : [SUS_within_audio_p , SUS_within_web_p , SUS_between_condition2_p , SUS_between_condition1_p ,
81+ Quiz_between_baseline_audio_p , Quiz_between_baseline_web_p ,
7582 Quiz_within_audio_p , Quiz_within_web_p , Quiz_between_condition2_p , Quiz_between_condition1_p ,
7683 IOS_robot_within_audio_p , IOS_robot_within_web_p , IOS_robot_between_condition2_p , IOS_robot_between_condition1_p ,
7784 IOS_group_within_audio_p , IOS_group_within_web_p , IOS_group_between_condition2_p , IOS_group_between_condition1_p ]
7885 })
7986
8087 def make_descriptive_statistics (self ,):
81- print (self .audio1_data ['IOS Robot Score' ].describe ())
88+ #describe Quiz Score
89+ quiz_describe = self .quiz_data ['Quiz Score' ].describe ()
90+ quiz_audio1_describe = self .audio1_data ['Quiz Score' ].describe ()
91+ quiz_audio2_describe = self .audio2_data ['Quiz Score' ].describe ()
92+ quiz_web1_describe = self .web1_data ['Quiz Score' ].describe ()
93+ quiz_web2_describe = self .web2_data ['Quiz Score' ].describe ()
94+
95+ #describe SUS Score
96+ sus_audio1_describe = self .audio1_data ['SUS Score' ].describe ()
97+ sus_audio2_describe = self .audio2_data ['SUS Score' ].describe ()
98+ sus_web1_describe = self .web1_data ['SUS Score' ].describe ()
99+ sus_web2_describe = self .web2_data ['SUS Score' ].describe ()
100+
101+ #describe IOS Robot Score
102+ ios_robot_audio1_describe = self .audio1_data ['IOS Robot Score' ].describe ()
103+ ios_robot_audio2_describe = self .audio2_data ['IOS Robot Score' ].describe ()
104+ ios_robot_web1_describe = self .web1_data ['IOS Robot Score' ].describe ()
105+ ios_robot_web2_describe = self .web2_data ['IOS Robot Score' ].describe ()
106+
107+ #describe IOS Group Score
108+ ios_group_audio1_describe = self .audio1_data ['IOS Group Score' ].describe ()
109+ ios_group_audio2_describe = self .audio2_data ['IOS Group Score' ].describe ()
110+ ios_group_web1_describe = self .web1_data ['IOS Group Score' ].describe ()
111+ ios_group_web2_describe = self .web2_data ['IOS Group Score' ].describe ()
112+
113+ self .descriptive_data = pd .concat ([quiz_describe .to_frame (name = "Online Quiz" ),
114+ quiz_audio1_describe .to_frame (name = "Audio Condition 1 Quiz" ),
115+ quiz_audio2_describe .to_frame (name = "Audio Condition 2 Quiz" ),
116+ quiz_web1_describe .to_frame (name = "Web Condition 1 Quiz" ),
117+ quiz_web2_describe .to_frame (name = "Web Condition 2 Quiz" ),
118+ sus_audio1_describe .to_frame (name = "Audio Condition 1 SUS" ),
119+ sus_audio2_describe .to_frame (name = "Audio Condition 2 SUS" ),
120+ sus_web1_describe .to_frame (name = "Web Condition 1 SUS" ),
121+ sus_web2_describe .to_frame (name = "Web Condition 2 SUS" ),
122+ ios_robot_audio1_describe .to_frame (name = "Audio Condition 1 IOS Robot" ),
123+ ios_robot_audio2_describe .to_frame (name = "Audio Condition 2 IOS Robot" ),
124+ ios_robot_web1_describe .to_frame (name = "Web Condition 1 IOS Robot" ),
125+ ios_robot_web2_describe .to_frame (name = "Web Condition 2 IOS Robot" ),
126+ ios_group_audio1_describe .to_frame (name = "Audio Condition 1 IOS Group" ),
127+ ios_group_audio2_describe .to_frame (name = "Audio Condition 2 IOS Group" ),
128+ ios_group_web1_describe .to_frame (name = "Web Condition 1 IOS Group" ),
129+ ios_group_web2_describe .to_frame (name = "Web Condition 2 IOS Group" ),
130+ self .descriptive_data ],
131+ axis = 1 )
82132
83133 def make_quiz_histogram (self , data : pd .Series ):
84134 # Compute min and max
@@ -103,11 +153,9 @@ def get_quiz_and_sus_data_and_ios(self, data, study):
103153 def calculate_significance (self , data1 , data2 , is_within_subject ):
104154 if is_within_subject :
105155 stat , p_value = stats .wilcoxon (data1 , data2 , alternative = "greater" )
106- print (f"Wilcoxon signed-rank test statistic: { stat } , p-value: { p_value } " )
107156 return stat , p_value
108157 else :
109158 stat , p_value = stats .mannwhitneyu (data1 , data2 , alternative = "greater" )
110- print (f"Mann-Whitney U test statistic: { stat } , p-value: { p_value } " )
111159 return stat , p_value
112160
113161
@@ -123,9 +171,10 @@ def calculate_significance(self, data1, data2, is_within_subject):
123171 # dir_list = os.listdir(path)
124172
125173 eval = StudyEvaluation (audio_1_condition , audio_2_condition , web_1_condition , web_2_condition , data_raw ) #dir_list
126- print (eval .make_descriptive_statistics ())
127- print (eval .significance_data )
174+ print (eval .descriptive_data )
128175
176+ eval .significance_data .to_csv ("significance_data.csv" )
177+ eval .descriptive_data .to_csv ("descriptive_data.csv" )
129178 # print(eval.log_eval.button_dict, eval.log_eval.df)
130179
131180 #eval.log_eval.df.sort_values(by=["VP"], inplace=True)
0 commit comments