Presentation is loading. Please wait.

Presentation is loading. Please wait.

2014.3.18 1 Medical Statistics Medical Statistics Tao Yuchun Tao Yuchun 7

Similar presentations


Presentation on theme: "2014.3.18 1 Medical Statistics Medical Statistics Tao Yuchun Tao Yuchun 7"— Presentation transcript:

1 2014.3.18 1 Medical Statistics Medical Statistics Tao Yuchun Tao Yuchun 7 http://cc.jlu.edu.cn/ms.html

2 2014.3.18 2 Statistical inference Statistical inference 3. t test and Z test

3 2014.3.18 3 3.1 t test (1) Comparing to a given population mean (One-sample t test) (One-sample t test) See Example 6-1 and Example 6-2 in last class.See Example 6-1 and Example 6-2 in last class. ( see 2014MedicalStatistics6.ppt) ( see 2014MedicalStatistics6.ppt) The formula of the test statistic for one-sampleThe formula of the test statistic for one-sample t test is: t test is: here μ is a given population mean.

4 2014.3.18 4 One-sample t test is also called the t test for one completely randomized group of data under completely randomized design design. Question: What is completely randomizedQuestion: What is completely randomized design? design? Design for the individuals to be observed are completely randomly selected from the population.

5 2014.3.18 5 (2) Comparison for Paired Data (Paired-Samples t test) (Paired-Samples t test) Paired-Samples t test is also called the t test for randomized paired design data under randomized paired design. Question: What is randomized pairedQuestion: What is randomized paired design? design? Design for the similar individuals in terms of several important features are paired and two individuals of any pair are randomly assigned to receive two treatments respectively.

6 2014.3.18 6 Example 7-1:Example 7-1: 8 patients with hypertension were treated with a medicine and the Diastolic Blood Pressure (DBP) was measured before and after the treatment. Comparing the effects of the medicine on decreasing DBP. Data list in the table below.

7 2014.3.18 7 t > t 0.05,7 =2.365, P < 0.05, H 0 is rejected at significance level α=0.05. The medicine can be thought as effectiveness, it can reduce DBP. You can see “exp7-1.xls”.

8 2014.3.18 8 The formula of the test statistic for -The formula of the test statistic for paired- sample t test is: sample t test is: here and S d refer to the mean and SD of the variable “difference”.

9 2014.3.18 9 (3) Comparison between two sample means (Independent-Samples t test) means (Independent-Samples t test) Independent-Samples t test is also called the t test for comparing two means based on two completely randomized groups of data under completely randomized design design. Example 7-2:Example 7-2: Two groups of rats were fed by different food. One contains high protein, another contains low protein. Comparing the effects of different food on increasing weight. Data list in the table sees next page.

10 2014.3.18 10 pooled estimation of sample variance First, you should calculate the (called pooled estimation of sample variance):

11 2014.3.18 11 You can see “exp7-2.xls”.

12 2014.3.18 12 υ=n 1 +n 2 -2=12+7-2=17 Checked two sides t α,ν = t 0.05,17 =2.110, now t=1.891 0.05, the null hypothesis is not rejected at the significance level α=0.05. There is not different for the population mean of increasing weight between two groups of rats fed different food containing different protein.

13 2014.3.18 13 The formula of the test statistic for - samples t test is: The formula of the test statistic for independent- samples t test is: here S c 2 is pooled estimation of sample variance. This t test is for assumption of the variances This t test is for assumption of the variances of two populations being equal. of two populations being equal.

14 2014.3.18 14  two groups  The t test is a statistical method for comparing differences between two groups. a continuous dependent The t test requires a continuous dependent variable variable on which the groups are being compared. normally The t test assumes that the variable is normally distributed distributed in the populations from which the samples are drawn and that the samples have equivalent variances equivalent variances.   The t test is particularly useful in experimental and quasi-experimental designs in which an experimental and a control group are compared.

15 2014.3.18 15 If t ≥t α,ν, then P ≤α , reject H 0 at If t ≥t α,ν, then P ≤α , reject H 0 at significance levelα=0.05. significance levelα=0.05. If t < t α,ν, then P > α , accept H 0 at If t < t α,ν, then P > α , accept H 0 at significance levelα=0.05. significance levelα=0.05. You can findt α,ν in Student’s t table ! You can find t α,ν in Student’s t table ! tinv(α,ν) You may also use Excel’s function tinv(α,ν) to get it. Remember it for Two-sided ! One-sided tinv(2α,ν) just use tinv(2α,ν) ! Question: How do I draw a conclusionQuestion: How do I draw a conclusion by any t test ? by any t test ?

16 2014.3.18 16 3.2 Z test (1) Comparing to a given population mean for a big sample (One-sample Z test) for a big sample (One-sample Z test) The formula of the test statistic for one-sampleThe formula of the test statistic for one-sample Z test is: Z test is: Z distribution is N(0,1).

17 2014.3.18 17 big means sample size n ≥ 50. big means sample size n ≥ 50. One-sample Z test is same as one-sample t test in steps of hypothesis testing, but you need to check Z limit value instead of t α,ν. Two sides: One side: The example omitted.

18 2014.3.18 18 (2) Comparison between two big sample means (Two-Samples Z test) means (Two-Samples Z test) big means two sample size all n ≥ 50. big means two sample size all n ≥ 50. The formula of the test statistic for two-samplesThe formula of the test statistic for two-samples Z test is: Z test is:

19 2014.3.18 19 Two-samples Z test is same as independent-samples t test in steps of hypothesis testing, but you need to check Z limit value instead of t α,ν. Two sides: One side: The example omitted. Question: How do I draw a conclusionQuestion: How do I draw a conclusion by any Z test ? by any Z test ?

20 2014.3.18 20 If Z ≥Z α, then P ≤α , reject H 0 at If Z ≥Z α, then P ≤α , reject H 0 at significance levelα=0.05. significance levelα=0.05. If Z < Z α, then P > α , accept H 0 at If Z < Z α, then P > α , accept H 0 at significance levelα=0.05. significance levelα=0.05. Z α in your heart ! I remember it ! Z 0.05 =1.96, Z 0.01 =2.58 ! Two-sided !

21 2014.3.18 21 3.3 Attention for Hypothesis Testing aWhat does P-value mean? a. What does P-value mean? P-value is the area of the tail(s) in the distribution of the test statistic beyond the value(s) of the test statistic calculated based on the sample. If the null hypothesis is rejected, the probability of mistake = P-value -- A smaller P-value implies the better quality of your rejection. If the null hypothesis is not rejected, the bigger P-value implies the better quality of your acceptation.

22 2014.3.18 22 bWhat does the significance level α mean? b. What does the significance level α mean? α shows the quality of the inference. If you reject the null hypothesis, the probability of making mistake is limited by α. cWhat are type I error and type II error? c. What are type I error and type II error? type I error: When H 0 is true, but you rejected it. It denotes with α, the same as the level of a test. type II error: When H 0 is not true, but you accepted it. It denotes with β, which is not very easy to get accurately.

23 2014.3.18 23 C You should know Hypothesis Testing is a very important method in statistics ! (http://en.wikipedia.org/wiki/Forbidden_City)


Download ppt "2014.3.18 1 Medical Statistics Medical Statistics Tao Yuchun Tao Yuchun 7"

Similar presentations


Ads by Google