• No results found

Aim of the lab

N/A
N/A
Protected

Academic year: 2021

Share "Aim of the lab"

Copied!
3
0
0

Loading.... (view fulltext now)

Full text

(1)

L AB 3 - SOLUTIONS

Aim of the lab

- Hypothesis Testing

- Test about one population mean

Test about one population mean

1. Suppose we know that the national average of birth weight is 3200 grams. We want to test whether our study population (bwt) is different from the national average.

I. Define the null and alternative hypotheses H

O

:  = 3200

H

A

:  ≠ 3200

II. Decide the level of the test (usually 5%) The type I (alpha) error to .05.

III. Suppose your sampled birth weight (bwt) is contained in the dataset lowbwt.dta

. su bwt

Variable | Obs Mean Std. Dev. Min Max ---+--- bwt | 189 2944.656 729.0224 709 4990

IV. Calculate the test statistic and the p-value.

. display (2944.6- 3200)/ ( 729/sqrt(189) ) -4.8164191

Since this is less than -1.96, then we reject the null hypothesis. (note: we would also reject if this was greater than +1.96.)

. display 2*normal( (2944.6 - 3200)/ (729/sqrt(189)) ) 1.462e-06

The p-value is < 0.001.

V. Draw the conclusions in the context of the problem

We reject the null hypothesis that the population mean birth weight is 3200.

Check your calculations with the output of the command ttest (help ttest).

. ttest bwt = 3200

1

(2)

One-sample t test

--- Variable | Obs Mean Std. Err. Std. Dev. [95% Conf. Interval]

---+--- bwt | 189 2944.656 53.02858 729.0224 2840.049 3049.264 --- mean = mean(bwt) t = -4.8152 Ho: mean = 3200 degrees of freedom = 188 Ha: mean < 3200 Ha: mean != 3200 Ha: mean > 3200 Pr(T < t) = 0.0000 Pr(|T| > |t|) = 0.0000 Pr(T > t) = 1.0000 . ci bwt

Variable | Obs Mean Std. Err. [95% Conf. Interval]

---+--- bwt | 189 2944.656 53.02858 2840.049 3049.264

The 95% confidence interval does not include 3200.

2. What sample size do we need to have a power of 90% of detecting an alternative value of 3200 grams for a two-sided test of H0: μ = 2945 at the 5% level?

Formula in Slide 95

n ≥ ( (1.96+ 1.28) * (729/(2945-3200)) ) ^2

. di ( (1.96+ 1.28) * (729/(2945-3200)) ) ^2 85.795541

3. Suppose you are interested in testing whether the mean benzene concentration in cigars is the same as in cigarettes. You know that the mean concentration of benzene in cigarettes is 81 μg/g tobacco but you don’t know the mean

concentration in cigars. However, you find that a random sample of seven cigars has a mean benzene concentration of 151 μg/g. Assume the distribution of benzene in cigars is approximately normal with known standard deviation of 9 μg/g. Perform an appropriate hypothesis test at the 0.05 level of significance.

I. State the null hypothesis H

O

:  = 81

II. State the alternative hypothesis H

A

:  ≠ 81

III. Is a one-sided or two-sided test more appropriate?

Two-sided, because it does not imply an intended direction.

IV. Calculate your test statistic. What is the distribution of your test statistic?

0

151 81

20.58 9

7 z x

n

 

  

. This follows a t-distribution (small sample).

2

(3)

V. Do you reject or not reject the null hypothesis?

We will reject since the test statistic is greater than invttail(6, 0.025) = 2.45.

VI. Calculate and interpret the p-value of your test statistic . di ttail(6, 20.58)*2

8.562e-07

VII. What is your conclusion?

There is significant evidence at the .05 level that the concentration of benzene is different than in cigarettes. It is significantly higher.

Check your calculations with the output of the command ttest (help ttest).

. ttesti 7 151 9 81 One-sample t test

--- | Obs Mean Std. Err. Std. Dev. [95% Conf. Interval]

---+--- x | 7 151 3.40168 9 142.6764 159.3236 --- mean = mean(x) t = 20.5781 Ho: mean = 81 degrees of freedom = 6 Ha: mean < 81 Ha: mean != 81 Ha: mean > 81 Pr(T < t) = 1.0000 Pr(|T| > |t|) = 0.0000 Pr(T > t) = 0.0000

3

References

Related documents

Generally, a transition from primary raw materials to recycled materials, along with a change to renewable energy, are the most important actions to reduce greenhouse gas emissions

För att uppskatta den totala effekten av reformerna måste dock hänsyn tas till såväl samt- liga priseffekter som sammansättningseffekter, till följd av ökad försäljningsandel

Samtliga regioner tycker sig i hög eller mycket hög utsträckning ha möjlighet att bidra till en stärkt regional kompetensförsörjning och uppskattar att de fått uppdraget

Generella styrmedel kan ha varit mindre verksamma än man har trott De generella styrmedlen, till skillnad från de specifika styrmedlen, har kommit att användas i större

I regleringsbrevet för 2014 uppdrog Regeringen åt Tillväxtanalys att ”föreslå mätmetoder och indikatorer som kan användas vid utvärdering av de samhällsekonomiska effekterna av

a) Inom den regionala utvecklingen betonas allt oftare betydelsen av de kvalitativa faktorerna och kunnandet. En kvalitativ faktor är samarbetet mellan de olika

Närmare 90 procent av de statliga medlen (intäkter och utgifter) för näringslivets klimatomställning går till generella styrmedel, det vill säga styrmedel som påverkar

• Utbildningsnivåerna i Sveriges FA-regioner varierar kraftigt. I Stockholm har 46 procent av de sysselsatta eftergymnasial utbildning, medan samma andel i Dorotea endast