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

Jump to navigation
Jump to search

Gittenburg (talk | contribs) (Die Seite wurde neu angelegt: „;Two-sample t-test using normal approximation Messages are frequently sent from a sender to either receiver 1 or receiver 2. For both re- ceivers, several time…“) |
Gittenburg (talk | contribs) |
||

(3 intermediate revisions by the same user not shown) | |||

Line 1: | Line 1: | ||

;Two-sample t-test using normal approximation | ;Two-sample t-test using normal approximation | ||

Messages are frequently sent from a sender to either receiver 1 or receiver 2. For both | 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 <code>waitingtimes2.Rdata</code>. | ||

:(a) Plot both data sets. Is their distribution approximately bell-shaped? | :(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). | :(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 <code>t.test()</code> | :(c) Compare your result to the output of <code>t.test()</code> | ||

== Lösungsvorschlag von [[Benutzer:Gittenburg|Gittenburg]] == | |||

--[[Benutzer:Gittenburg|Gittenburg]] 11:18, 3. Dez. 2019 (CET) | |||

a) | |||

<syntaxhighlight lang=r> | |||

load('waitingtimes2.Rdata') | |||

par(mfrow=c(2,1)) | |||

x = wt[[1]] | |||

y = wt[[2]] | |||

hist(x) | |||

hist(y) | |||

</syntaxhighlight> | |||

b) | |||

<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> |

## Latest revision as of 12:18, 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 von Gittenburg[edit]

--Gittenburg 11:18, 3. Dez. 2019 (CET)

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