Difference between revisions of "TU Wien:Statistik und Wahrscheinlichkeitstheorie UE (Bura)/Übungen 2019W/8.2"

From VoWi
Jump to navigation Jump to search
Line 12: Line 12:
load('waitingtimes2.Rdata')
load('waitingtimes2.Rdata')
par(mfrow=c(2,1))
par(mfrow=c(2,1))
hist(unlist(wt[1]))
x = wt[[1]]
hist(unlist(wt[2]))
y = wt[[2]]
hist(x)
hist(y)
</syntaxhighlight>
</syntaxhighlight>


b) TBD
b)  


c) TBD
<syntaxhighlight lang=r>
semx = sd(x)^2/length(x)
semy = sd(y)^2/length(y)
 
t = (mean(x) - mean(y))/sqrt(semx + semy)
t
 
pnorm(t)*2
</syntaxhighlight>
 
c)
<syntaxhighlight lang=r>
t.test(x,y)
</syntaxhighlight>

Revision as of 12:17, 3 December 2019

Two-sample t-test using normal approximation

Messages are frequently sent from a sender to either receiver 1 or receiver 2. For both receivers, several times for the transfer were measured (in seconds) and stored in the file waitingtimes2.Rdata.

(a) Plot both data sets. Is their distribution approximately bell-shaped?
(b) Test the null-hypothesis of equal mean transfer times for both receivers on the 1%-level with a two sample t-test (using the normal approximation).
(c) Compare your result to the output of t.test()

Lösungsvorschlag

a)

load('waitingtimes2.Rdata')
par(mfrow=c(2,1))
x = wt[[1]]
y = wt[[2]]
hist(x)
hist(y)

b)

semx = sd(x)^2/length(x)
semy = sd(y)^2/length(y)

t = (mean(x) - mean(y))/sqrt(semx + semy)
t

pnorm(t)*2

c)

t.test(x,y)