Bei dieser Namensähnlichkeit, muss man fast so ein Banner machen :)

TU Wien:Statistik und Wahrscheinlichkeitstheorie UE (Bura)/Übungen 2019W/8.1

Aus VoWi
Zur Navigation springen Zur Suche springen
Two-sample t-test

Create two independent samples from the normal distribution. The first sample of size 10 shall be taken from the N(0, 1)-distribution. The second sample of size 20 shall be taken from the N(-1, 1) distribution. Test the null hypothesis that the populations means are equal with a (two-sided) two-sample t-test on the 5%-significance level:

(a) Calculate the t-statistic (without t.test())
(b) Compare it to the output of t.test()
(c) Interpret the result of the test

Lösungsvorschlag von Gittenburg[Bearbeiten | Quelltext bearbeiten]

--Gittenburg 08:37, 3. Dez. 2019 (CET)

a)

first  = rnorm(10)
second = rnorm(20, mean=-1)
t = (mean(first) - mean(second))/sqrt(sd(first)^2/length(first) + sd(second)^2/length(second))

b)

t.test(first, second) liefert die selbe t-Statistik.

c)

TBD