Download presentation
Presentation is loading. Please wait.
1
Biostatistics: Methods and Applications
Prof. Weidong Tian Prof. Hong Zhang Prof. Ruoyu Luo Tel: Office: 2320 East Guanghua Building
2
Review of Last Week’s talk
Hypothesis testing Type I vs. Type II error One sample test
3
Your decision Reality Defendant is innocent Defendant is guilty
He is innocent (H0) 1-α β He is guilty (Ha) α 1-β type I error: rejecting H0 when H0 is correct. type II error: rejecting Ha when Ha is correct. Power of the test: accepting Ha when Ha is correct. α: significance level.
4
Minimizing type I error increases type II error
5
Type II error is also determined by the difference of two population mean
6
The biomarker is effective
ROC The biomarker is effective The biomarker is very effective
7
Critical region, critical value, significance level and P-value
Critical region: the null hypothesis is rejected when a calculated value of the test statistic lies within the region Critical value: the value which determines the boundary of the critical region Significance level(α): the size of a critical region, and the probability of the type I error P-value: the probability of obtaining a test statistic at least as extreme as the one that was actually observed, assuming that the null hypothesis is true. When the p-value is less than the significance level α, which is often 0.05 or 0.01, the null hypothesis is rejected, and the result is considered "statistically significant".
8
Two-tailed vs. one-tailed test
9
α/2: area of the critical region
critical value Z-test t-test Z=-3
10
We have talked about hypothesis test of one sample.
In practice, we often need to compare one group to another in order to make inference about the differences between two samples. How can we extend the one sample test to two sample test?
11
Outline Test of two paired samples (related, e.g., “before treatment” and “after treatment”) Test of two independent samples (independent, e.g., “women” and “men”) Sample size for two samples
12
Test of two paired samples
Problem: We are interested in testing whether the performance of students on analyzing statistical problems is improved after drinking a cup of coffee. Solution: suppose the distribution of the performance follows a normal distribution with N(μ,σ) we randomly sample a number of students, and give each of them a cup of tea; then, we evaluate their performance, and compute μ’. H0: μ= μ’, Ha: μ’ >= μ.
13
Test of two paired samples
Questions: How many students should we sample given the confidence level (α) and the power of the test (1-β), suppose the variance are the same.
14
Test of two paired samples
From our last homework suppose μ’-μ=0.5 We need to sample 1752 students
15
Test of two paired samples
Instead of randomly sampling a number of students, and evaluating their performance after drinking a cup of coffee, we evaluate the performance difference of a number of students before and after drinking a cup of coffee H0: μ= 0, Ha: μ > 0. It is expected that the variation between students’ performance difference will be significantly lower than that of the performance among students.
16
Test of two paired samples
before Now under the same condition before Now We need to sample 22 students
17
Test of two paired samples
Using paired samples can significantly reduce the variance between random samples Using paired samples can significantly reduce the number of samples to be tested Using paired samples can reduce the confounding variables Using paired samples can improve the power of the test Test of two paired samples can be simplified to the test of one sample
18
Test of two paired samples
The central limit of theorem applies to the two paired samples simulation before after
19
Test of two paired samples
The central limit of theorem applies to the two paired samples n=100 n=30
20
Test of two paired samples - example
17 girls being treated for anorexia were weighed before and after treatment. Difference scores were calculated for each participant. Change in weight
21
Test of two paired samples - example
22
Test of two paired samples - example
95% confidence interval
23
Test of two paired samples - example
Standard error
24
Test of two paired samples - example
Standard error
25
Test of two paired samples - example
Standard error
26
Test of two paired samples - example
Effect size: When a difference is statistically significant, it does not necessarily mean that it is big, important, or helpful in decision-making. It simply means you can be confident that there is a difference. Sometimes when sample size is large, you can detect the significance of the difference, though the difference may be small. Effect size helps you to determine the meaningfulness of the difference, and can be compared across different studies.
27
We have talked about the test of paired samples.
In practice, we are often faced with comparing two samples that are not related with each other. Test of two independent samples is the most widely used statistical test of all time. It is simple, straightforward, easy to use, and adaptable to a broad range of situations.
28
Problems: We are interested in determining whether a newly found plant hormone can enhance plant growth. Strategy: Randomly select 20 Arabidoposis seeds, and divide them into two groups each with 10 seeds. Grow them under conditions that are identical in every respect except one: The seeds from Group A are grown in normal condition (Control), while those from Group B are grown in normal + hormone condition (Case). Measure the height of the plants in two groups at different time. Compare the mean height between two groups. Make conclusion.
29
Problems: We are interested in determining whether two strains of mice, A and B, differ with respect to their ability to learn to avoid an aversive stimulus Strategy: Randomly sample Na mice from strain A and Nb mice from strain B. Following a standard aversive- conditioning procedure, measuring for each one how well and quickly the avoidance behavior is acquired. Compare the difference of mean response behavior between group A and B. Make conclusion.
30
t-test for two independent samples
Assumptions: Both populations are normally distributed Samples are randomly and independently drawn If both populations are not normal, need large sample sizes
31
t-test for two independent samples
Goal: Evaluate the mean difference between two populations (or between two treatment conditions). For paired samples, we can compute the difference scores. For independent samples, we cannot compute the difference scores.
32
t-test for two independent samples
paired t-test t-test of independent samples =0 how to estimate?
33
t-test for two independent samples
Let’s first look at the variance of For two independent samples:
34
t-test for two independent samples
are the two population variances
35
t-test for two independent samples
The easiest case: If However, usually σ is unknown How to estimate σ? Sample variance can be used to estimate population variance How can we best uses these two estimates?
36
t-test for two independent samples
Solution: use the average of the two sample variance as the estimate. However, because the two samples may not have the same size, we need to take into account the sample size, and give more weight to the one with larger size.
37
t-test for two independent samples
Pooled average: the weighted average of the two sample variances degree of freedom Bessel’s correction Recall unbiased estimation
38
t-test for two independent samples
39
t-test for two independent samples
Steps for calculating a test statistic calculate calculate pooled variance calculate standard error calculate T and d.f. calculate confidence interval, p-value, etc.
40
Example 1: Bumpus’s Data on Natural Selection
Two groups of sparrows are researched by the scientists with: One group survived in the storm; The other died in the storm. Questions of interest: Do the lengths of arm bone tend to be different for survivors than for those that died? If so, how large is the difference?
41
Example 1: Bumpus’s Data on Natural Selection
Perished Survived Average 0.7380 SD 0.0235 0.0198 n 24 35 Assumption : two groups follow the normal distribution, with equal variance.
42
Example 1: Bumpus’s Data on Natural Selection
Steps for calculating a test statistic calculate calculate pooled variance calculate standard error
43
Example 1: Bumpus’s Data on Natural Selection
Calculate T and d.f.
44
Example 1: Bumpus’s Data on Natural Selection
Reject the hypothesis that there is any difference
45
Example 1: Bumpus’s Data on Natural Selection
confidence interval p-value
46
Example 2: Blood pressure of children
To investigate the question of whether the children of city A and city B have the same systolic blood pressure, a random sample of n = 10 children was selected from each city and their blood pressures measured.
47
Example 2: Blood pressure of children
difference of sample means, df, and t critical value pooled variance
48
Example 2: Blood pressure of children
confidence interval p-value
49
Example 3: Independent Random Samples from Two Populations of Serum Uric Acid Values
50
Example 3: Independent Random Samples from Two Populations of Serum Uric Acid Values
51
When variances are unknown, test of variance have to be performed before conducting t-test of two independent samples
52
Assumption: both population follow normal distribution
Recall F-distribution about two variance Assumption: both population follow normal distribution
53
F-test for two variances
hypothesis Test statistic
54
F-test for two variances
Example Purpose: To investigate the variations in tree diameters from the north and south tract in Thomas County, Georgia are similar to each other or not? Solution: Take random samples of 25 trees from each half, and perform the F-test North 27.8, 14.5, 39.1, 3.2, 58.8, 55.5, 25, 5.4, 19, 30.6, 15.1, 3.6, 38.4, 15, 2.2, 14.2, 44.2, 25.7, 11.2, 46.8, 36.9, 54.1, 10.2, 2.5, 13.8 South 44.4, 26.1, 50.4, 23.3, 39.5, 51, 48.1, 47.2, 40.3, 37.4, 36.8, 21.7, 35.7, 32, 40.4, 12.8, 5.6, 44.3, 52.9, 38, 2.6, 44.6, 45.5, 29.1, 18.7
55
F-test for two variances
df sample variance F statistic F critical values
56
F-test for two variances
Accept the null hypothesis that the two variance are the same
57
F-test for two variances
Perform t-test to examine the difference between mean Reject the null hypothesis that the two means are the same
58
What if F-test finds that the two variance are different?
How can we test the difference between means?
59
Recall what we have learnt in the previous slides
t-test of independent samples these two variances are unknown, and unequal Estimate from sample variance For t-distribution, we need to know the degree of freedom
60
For two independent samples with equal variance
The degrees of freedom are not known exactly but can be estimated using the Welch-Satterthwaite approximation For two independent samples with unequal variance
61
Case study: the effects of lead exposure on the psychological and neurological well-being of children Experiment design: A group of children who lived near a lead smelter in El Paso, Texas, were identified and their blood levels of lead were measured. Children are identified into two groups (exposed: blood-lead levels >= 40 ug/mL, and control). Two important outcome variables were studied the number of finger-wrist taps in the dominant hand (for neurological function). the Wechsler full-scale IQ score.
62
Ld72: blood lead level measured in 1972
Iqf: IQ score maxfwt: finger-wrist taps Exposed: Ld73 >=40 OR LD72 >= 40 Control: Ld73 <40 AND LD72 < 40
63
1. read data (lead level, fwt scores, iq scores)
2. identify exposed and control group matrix exposed and control will save the index of children that satisfy the exposed and control lead level, respectively
65
3. collect fwt and iq scores from exposed and control group
fwt_exposed: matrix that saves the fwt scores of children from the lead exposed group 4. determine sample statistic (mean, variance) 5. determine sample size
66
6. test of variance Critical value of F statistic df
69
7. calculate pooled variance
70
7. calculate t-statistic
8. calculate t-critical value
71
9. calculate p-value
73
10. make conclusions (1): lead exposed and control group have difference in fwt scores which reflects neurological functions (2): lead exposed and control group have no significant difference in iq scores
74
effect size one sample paired sample independent sample
75
Flowchart of two sample t-test
76
Treatment of outliers extreme studentized deviate (ESD)
An outlier is determined by ESD, sample size n, and the percentile p
77
No outliers for fwt data
Treatment of outliers n_exposed = 32 n_control = 60 ESD(32, 0.95) =(2.91, 2.98) ESD(60, 0.95) =(3.20) No outliers for fwt data
78
Treatment of outliers No outliers for iq data
ESD(32, 0.95) =(2.91, 2.98) ESD(60, 0.95) =(3.20) No outliers for iq data
79
Estimate sample size Suppose that the true distributions of both finger-wrist tapping scores and full-scale IQ scores are normal. How many children should be identified to have an 80% chance of detecting a significant difference using a two-sided test with α=0.05?(We anticipate that the size of control group should be 2 times the size of exposed size. )
80
We don’t know the population means and variances
Use sample means and variances as the estimates
81
k=2
82
Summary t-test Sample data Hypothesized population parameter
Sample variance Estimated standard error t-statistic one sample paired samples independent samples
Similar presentations
© 2025 SlidePlayer.com Inc.
All rights reserved.