# Tworzenie typowego raportu dotyczącego testu t-test

Typowy raport dotyczący testu t-test Studenta może obejmować tabele z wynikami dla grup Group Statistics i Independent Samples Test. W następujących sekcjach takie tabele zostaną utworzone za pomocą funkcji QlikViewt-test zastosowanych w odniesieniu do dwóch niezależnych grup prób: Observation i Comparison. Odpowiednie tabele dla tych prób wyglądałyby następująco:

Group Statistics

Przykładowe dane wyjściowe tabeli 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

Przykładowa tabela wyników 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 |

## Ładowanie danych z próby

Wykonaj następujące czynności:

1. Utwórz nowy dokument.

2. Wybierz na pasku narzędzi opcję Edytuj skrypt i wprowadź następujący kod do skryptu:

   `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 '|');`

   W tym skrypcie ładowania uwzględniona jest funkcjarecno(), ponieważ tabelacrosstable wymaga trzech argumentów. Funkcja recno() zapewnia zatem dodatkowy argument (w tym przypadku ID dla każdego wiersza). Bez tego argumentu przykładowe wartości Comparison nie zostałyby załadowane.

3. Zapisz skrypt i kliknij przycisk Przeładuj, aby załadować dane.

## Tworzenie tabeli Group Statistics

Wykonaj następujące czynności:

1. Dodaj w arkuszu tabelę prostą i wybierz wymiar Type.

2. Dodaj następujące wyrażenia:

   Wyrażenia do dodania

   | Etykieta | Wyrażenie |
   | --- | --- |
   | N | Count(Value) |
   | Mean | Avg(Value) |
   | Standard Deviation | Stdev(Value) |
   | Standard Error Mean | Sterr(Value) |

3. Upewnij się, że Type u góry listy sortowania.

**Wynik:**

Tabela Group Statistics dla tych prób wyglądałaby następująco:

Przykładowe dane wyjściowe tabeli 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 |

## Tworzenie tabeli Two Independent Sample Student's T-test

Wykonaj następujące czynności:

1. Dodaj w arkuszu tabelę.

2. Dodaj do tabeli jako wymiar następujący wymiar wyliczany. `=ValueList (Dual('Equal Variance not Assumed', 0), Dual('Equal Variance Assumed', 1))`

3. Dodaj następujące wyrażenia:

   Wyrażenia do dodania

   | Etykieta | Wyrażenie |
   | --- | --- |
   | 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)) |

**Wynik:**

Tabela Independent Sample Test dla tych prób wyglądałaby następująco:

Przykładowa tabela wyników 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 |