建立一般 t-test 報表
                一般的學生 t-test 報表可能包含具有 Group Statistics 和 Independent Samples Test 結果的表格。以下章節中將使用套用到兩個獨立樣本群組 Observation 和 Comparison 的 QlikViewt-test 函數,進而建置三個表格。這些樣本的對應表格看起來應像這樣:
Group Statistics
| Type | N | Mean | Standard Deviation | Standard Error Mean | 
|---|---|---|---|---|
| Comparison | 20 | 11.95 | 14.61245 | 3.2674431 | 
| Observation | 20 | 27.15 | 12.507997 | 2.7968933 | 
Independent Sample Test
| - | t | df | Sig. (2-tailed) | Mean Difference | Standard Error Difference | 95% Confidence Interval of the Difference (Lower) | 95% Confidence Interval of the Difference (Upper) | 
|---|---|---|---|---|---|---|---|
| Equal Variance not Assumed | 3.534 | 37.116717335823 | 0.001 | 15.2 | 4.30101 | 6.48625 | 23.9137 | 
| Equal Variance Assumed | 3.534 | 38 | 0.001 | 15.2 | 4.30101 | 6.49306 | 23.9069 | 
載入樣本資料
請執行下列動作:
- 建立新的文件。
 - 
                        
選取工具列中的編輯指令碼,然後將以下內容輸入指令碼:
Table1:
crosstable LOAD recno() as ID, * inline [
Observation|Comparison
35|2
40|27
12|38
15|31
21|1
14|19
46|1
10|34
28|3
48|1
16|2
30|3
32|2
48|1
31|2
22|1
12|3
39|29
19|37
25|2 ] (delimiter is '|');
此載入指令碼中包含 recno(),因為 crosstable 需要三個引數。因此 recno() 只需提供一個額外引數,在這種情況下,每列需要一個識別碼。若沒有,則不會載入 Comparison 樣本值。
 - 儲存指令碼,並按一下重新載入以載入資料。
 
建立 Group Statistics 表格
請執行下列動作:
- 
                        
在工作表上新增一個連續表,並選取 Type 作為維度。
 - 
                        
新增以下運算式:
要新增的運算式 標籤 運算式 N Count(Value) Mean Avg(Value) Standard Deviation Stdev(Value) Standard Error Mean Sterr(Value)  - 確認 Type 位於排序清單頂端。
 
結果:
這些樣本的 Group Statistics 表格看起來應像這樣:
| Type | N | Mean | Standard Deviation | Standard Error Mean | 
|---|---|---|---|---|
| Comparison | 20 | 11.95 | 14.61245 | 3.2674431 | 
| Observation | 20 | 27.15 | 12.507997 | 2.7968933 | 
建立 Two Independent Sample Student's T-test 表格
請執行下列動作:
- 在工作表上新增一個表格。
 - 
                        
將以下計算維度作為維度新增至表格。 =ValueList (Dual('Equal Variance not Assumed', 0), Dual('Equal Variance Assumed', 1))
 - 
                        
新增以下運算式:
要新增的運算式 標籤 運算式 conf if(ValueList (Dual('Equal Variance not Assumed', 0), Dual('Equal Variance Assumed', 1)),TTest_conf(Type, Value),TTest_conf(Type, Value, 0)) t if(ValueList (Dual('Equal Variance not Assumed', 0), Dual('Equal Variance Assumed', 1)),TTest_t(Type, Value),TTest_t(Type, Value, 0)) df if(ValueList (Dual('Equal Variance not Assumed', 0), Dual('Equal Variance Assumed', 1)),TTest_df(Type, Value),TTest_df(Type, Value, 0)) Sig. (2-tailed) if(ValueList (Dual('Equal Variance not Assumed', 0), Dual('Equal Variance Assumed', 1)),TTest_sig(Type, Value),TTest_sig(Type, Value, 0)) Mean Difference TTest_dif(Type, Value) Standard Error Difference if(ValueList (Dual('Equal Variance not Assumed', 0), Dual('Equal Variance Assumed', 1)),TTest_sterr(Type, Value),TTest_sterr(Type, Value, 0)) 95% Confidence Interval of the Difference (Lower) if(ValueList (Dual('Equal Variance not Assumed', 0), Dual('Equal Variance Assumed', 1)),TTest_lower(Type, Value,(1-(95)/100)/2),TTest_lower(Type, Value,(1-(95)/100)/2, 0)) 95% Confidence Interval of the Difference (Upper) if(ValueList (Dual('Equal Variance not Assumed', 0), Dual('Equal Variance Assumed', 1)),TTest_upper(Type, Value,(1-(95)/100)/2),TTest_upper(Type, Value,(1-(95)/100)/2, 0))  
結果:
這些樣本的 Independent Sample Test 表格看起來應像這樣:
| - | t | df | Sig. (2-tailed) | Mean Difference | Standard Error Difference | 95% Confidence Interval of the Difference (Lower) | 95% Confidence Interval of the Difference (Upper) | 
|---|---|---|---|---|---|---|---|
| Equal Variance not Assumed | 3.534 | 37.116717335823 | 0.001 | 15.2 | 4.30101 | 6.48625 | 23.9137 | 
| Equal Variance Assumed | 3.534 | 38 | 0.001 | 15.2 | 4.30101 | 6.49306 | 23.9069 |