Creating a typical t-test report
A typical student t-test report can include tables with Group Statistics and Independent Samples Test results.
In the following sections we will build these tables using Qlik Senset-test functions applied to two independent groups of samples, Observation and Comparison. The corresponding tables for these samples would look like this:
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
Type | 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 |
Loading the sample data
Do the following:
- Create a new app with a new sheet and open that sheet.
-
Enter the following in the data load editor:
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 '|');
In this load script, recno() is included because crosstable requires three arguments. So, recno() simply provides an extra argument, in this case an ID for each row. Without it, Comparison sample values would not be loaded.
- Click to load data.
Creating the Group Statistics table
Do the following:
-
In the data load editor, click to go to app view, and then click the sheet you created before.
This opens the sheet view.
- Click Edit sheet to edit the sheet.
-
From Charts, add a table, and from Fields, add the following expressions as measures:
Example expressions Label Expression N Count(Value) Mean Avg(Value) Standard Deviation Stdev(Value) Standard Error Mean Sterr(Value) -
Add Type as a dimension to the table.
- Click Sorting and move Type to the top of the sorting list.
Result:
A Group Statistics table for these samples would look like this:
Type | N | Mean | Standard Deviation | Standard Error Mean |
---|---|---|---|---|
Comparison | 20 | 11.95 | 14.61245 | 3.2674431 |
Observation | 20 | 27.15 | 12.507997 | 2.7968933 |
Creating the Two Independent Sample Student's T-test table
Do the following:
- Click Edit sheet to edit the sheet.
-
Add the following expression as a dimension to the table. =ValueList (Dual('Equal Variance not Assumed', 0), Dual('Equal Variance Assumed', 1))
-
From Charts add a table with the following expressions as measures:
Example expressions Label Expression 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)) Result:
Independent sample test Type 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