SlideShare a Scribd company logo
1 of 26
Download to read offline
Workshop on Analysis of Clinical Studies – Can Tho University of Medicine and Pharmacy – April 2012
Comparing two groups:
continuous data
Tuan V. Nguyen
Professor and NHMRC Senior Research Fellow
Garvan Institute of Medical Research
University of New South Wales
Sydney, Australia
Workshop on Analysis of Clinical Studies – Can Tho University of Medicine and Pharmacy – April 2012
What we are going to learn …
•  Some examples
•  Estimation and test of hypothesis
•  R analysis
•  Interpretation
Workshop on Analysis of Clinical Studies – Can Tho University of Medicine and Pharmacy – April 2012
Lan T Ho-Pham , et al obesity 2010
Difference between US and Viet women
Workshop on Analysis of Clinical Studies – Can Tho University of Medicine and Pharmacy – April 2012
Vitamin D in Vietnamese men and women
•  Vitamin D (25-hydroxyvitamin D)
Men Women
N 222 336
Mean 28.57 23.79
SD (standard
deviation)
8.94 7.86
•  Is there real difference between men and women?
Workshop on Analysis of Clinical Studies – Can Tho University of Medicine and Pharmacy – April 2012
Inference for 2-sample means
•  Estimation and test of hypothesis
Assumptions:
•  The two samples are independent
•  The two sample sizes are large. That is, n1 > 30 and
n2 > 30
•  Both samples are simple random  samples
Workshop on Analysis of Clinical Studies – Can Tho University of Medicine and Pharmacy – April 2012
Estimation: sample and population
Sample Population
Men Women Men Women
N 222 (n1) 336 (n2) Infinite Infinite
Mean 28.57 (x1) 23.79 (x2) m1 = ? m2 = ?
SD (standard
deviation)
8.94 (s1) 7.86 (s2) s1 = ? s2 = ?
Workshop on Analysis of Clinical Studies – Can Tho University of Medicine and Pharmacy – April 2012
Estimation: sample and population
Sample Population
Men Women Men Women
N 222 (n1) 336 (n2) Infinite Infinite
Mean 28.57 (x1) 23.79 (x2) m1 = ? m2 = ?
SD (standard
deviation)
8.94 (s1) 7.86 (s2) s1 = ? s2 = ?
Difference d = x1 – x 1 d = m1 – m2
Status Known Unknown
Workshop on Analysis of Clinical Studies – Can Tho University of Medicine and Pharmacy – April 2012
•  “Is there real difference between men and women”
means whether d = 0.
•  We want to estimate the sampling variability around d
Sample Population
Men Women Men Women
N 222 (n1) 336 (n2) Infinite Infinite
Mean 28.57 (x1) 23.79 (x2) m1 = ? m2 = ?
SD (standard
deviation)
8.94 (s1) 7.86 (s2) s1 = ? s2 = ?
Difference d = x1 – x 1 d = m1 – m2
Status Known Unknown
Workshop on Analysis of Clinical Studies – Can Tho University of Medicine and Pharmacy – April 2012
Estimation
•  We need to estimate d and standard deviation of d
(denoted by s)
s = n1 n2
+
s1
.
!2
2
2
•  95% confidence interval of d is approximately:
d + 1.96 s
Workshop on Analysis of Clinical Studies – Can Tho University of Medicine and Pharmacy – April 2012
Test of hypothesis
Null hypothesis
Ho : !1 = !2
Alternative hypothesis
H1 : !1 ! !2
Question: if Ho is true, what is the chance that we
observed the data as reported? è P-value
Workshop on Analysis of Clinical Studies – Can Tho University of Medicine and Pharmacy – April 2012
Test of hypothesis
•  Set alpha = 0.05 or 0.01
•  Calculate a statistic
•  Compare the statistic with the null distrribution
Fail to reject H0
Reject H0
Reject H0
t = - 2.575 t = 2.575
!1 - !! = 0
or t = 0
Workshop on Analysis of Clinical Studies – Can Tho University of Medicine and Pharmacy – April 2012
Test statistic
t =
Difference
SD of difference
=
Signal
Noise
(x1 - x2)
t =
n1 n2
+
s1
.
!2
2
2
Workshop on Analysis of Clinical Studies – Can Tho University of Medicine and Pharmacy – April 2012
Test statistic
(x1 - x2)
t =
n1 n2
+
s1
.
!2
2
2
!! and !!!! 	

If!!! and !!!!!are not known,
use s1 and s2 in their places. provided that
both samples are large.!	

P-value: Use the computed value of the test
statistic t, and find the P-value
Workshop on Analysis of Clinical Studies – Can Tho University of Medicine and Pharmacy – April 2012
Using R
setwd("C:/Documents and Settings/Tuan/My Documents/
_Current Projects/_Vietnam/Huong/Vitamin D")
vd = read.csv("vitaminD.csv", header=T, na.strings=" ")
attach(vd)
library(psych)
describe.by(vitd, sex)
t = t.test(vitd ~ sex)
print(t)
Workshop on Analysis of Clinical Studies – Can Tho University of Medicine and Pharmacy – April 2012
R outputs
> describe.by(vitd, sex)
group: 1
var n mean sd median trimmed mad min max range skew kurtosis se
1 1 222 28.57 8.94 28.29 28.45 8.46 4 59.87 55.87 0.17 0.66 0.6
--------------------------------------------------------------------------
group: 2
var n mean sd median trimmed mad min max range skew kurtosis se
1 1 336 23.79 7.86 24.26 23.93 7.1 4 59.6 55.6 0.07 1.22 0.43
Workshop on Analysis of Clinical Studies – Can Tho University of Medicine and Pharmacy – April 2012
R output – t-test
> t = t.test(vitd ~ sex)
> print(t)
t = 6.4768, df = 430.332, p-value = 2.562e-10
alternative hypothesis: true difference in means is not equal
to 0
95 percent confidence interval:
3.326365 6.224809
Men Women Difference
and 95% CI
P-value
N 222 336 336
Mean 28.6 (8.9) 23.8 (7.9) 4.8
(3.3 – 6.2)
<0.0001
Workshop on Analysis of Clinical Studies – Can Tho University of Medicine and Pharmacy – April 2012
Interpretation
Men Women Difference
and 95% CI
P-value
N 222 336 336
Mean 28.6 (8.9) 23.8 (7.9) 4.8
(3.3 – 6.2)
<0.0001
25(OH)D in men was higher than that in women, with
average difference being 4.8 ng/mL (95% CI: 3.3 to
6.2 ng/mL; P < 0.0001).
Workshop on Analysis of Clinical Studies – Can Tho University of Medicine and Pharmacy – April 2012
se = (6.2-3.3)/(2*1.96)
d = rnorm(1000, mean=4.8, sd=se)
> hist(d, xlim=c(-2, 8))
Histogram of d
d
Frequency
-2 0 2 4 6 8
0
50
100
150
200
250
Workshop on Analysis of Clinical Studies – Can Tho University of Medicine and Pharmacy – April 2012
Transformation of data
> describe.by(xlap, sex)
group: 1
var n mean sd median trimmed mad min max range skew kurtosis se
1 1 100 0.45 0.31 0.35 0.41 0.26 0.02 1.57 1.55 1.4 2.15 0.03
------------------------------------------------------------
group: 2
var n mean sd median trimmed mad min max range skew kurtosis se
1 1 144 0.34 0.24 0.28 0.31 0.19 0.06 1.26 1.2 1.3 1.39 0.02
Workshop on Analysis of Clinical Studies – Can Tho University of Medicine and Pharmacy – April 2012
Histogram of xlap
xlap
Frequency
0.0 0.5 1.0 1.5
0
20
40
60
80
Histogram of log(xlap + 0.1)
log(xlap + 0.1)
Frequency
-2.5 -2.0 -1.5 -1.0 -0.5 0.0 0.5 1.0
0
20
40
60
80
> library(nortest)
> pearson.test(xlap)
Pearson chi-square normality test
data: xlap
P = 87.877, p-value = 6.145e-12
> pearson.test(log(xlap+0.1))
Pearson chi-square normality test
data: log(xlap + 0.1)
P = 20.7541, p-value = 0.1882
Workshop on Analysis of Clinical Studies – Can Tho University of Medicine and Pharmacy – April 2012
Analysis of transformeddata
> describe.by(log(xlap+0.1), sex)
group: 1
var n mean sd median trimmed mad min max range skew kurtosis se
1 1 100 -0.73 0.52 -0.8 -0.73 0.54 -2.1 0.51 2.61 0.08 -0.34 0.05
------------------------------------------------------------
group: 2
var n mean sd median trimmed mad min max range skew kurtosis se
1 1 144 -0.94 0.5 -0.97 -0.97 0.52 -1.82 0.31 2.13 0.3 -0.66 0.04
Workshop on Analysis of Clinical Studies – Can Tho University of Medicine and Pharmacy – April 2012
T-test on transformed data
> t.test(log(xlap+0.1) ~ sex)
data: log(xlap + 0.1) by sex
t = 3.216, df = 206.284, p-value = 0.001509
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
0.08306888 0.34626674
sample estimates:
mean in group 1 mean in group 2
-0.7300382 -0.9447060
Exp(-0.73+0.9447) = 1.234
Exp(0.083) = 1.086
Exp(0.346) = 1.413
Workshop on Analysis of Clinical Studies – Can Tho University of Medicine and Pharmacy – April 2012
Interpretation
Men Women Percentage
difference
and 95% CI
P-value
N 100 144
Mean 0.45 (0.31) 0.34 (0.24) 23% (8.6,
41.3)
0.0015
Compared with women, beta crosslap was 23% (95%
CI: 8.6 to 41.3%) higher in men , and the difference
was statistically significant (P = 0.001)
Workshop on Analysis of Clinical Studies – Can Tho University of Medicine and Pharmacy – April 2012
Non-parametric analysis
•  Wilcoxon’s rank sum test
> wilcox.test(xlap ~ sex)
Wilcoxon rank sum test with continuity correction
data: xlap by sex
W = 8890, p-value = 0.001834
alternative hypothesis: true location shift is not equal to 0
Workshop on Analysis of Clinical Studies – Can Tho University of Medicine and Pharmacy – April 2012
Non-parametric analysis
•  Permutation and median test
> library(coin)
> oneway_test(xlap ~ as.factor(sex))
Asymptotic 2-Sample Permutation Test
data: xlap by as.factor(sex) (1, 2)
Z = 3.1073, p-value = 0.001888
alternative hypothesis: true mu is not equal to 0
> median_test(xlap ~ as.factor(sex))
Asymptotic Median Test
data: xlap by as.factor(sex) (1, 2)
Z = -2.8579, p-value = 0.004265
alternative hypothesis: true mu is not equal to 0
Workshop on Analysis of Clinical Studies – Can Tho University of Medicine and Pharmacy – April 2012
Summary
•  Statistical tests:
–  T-test: comparing two groups, for continuous outcomes
–  Non-parametric tests: Wilcoxon, median, and permutation
tests
•  Assumptions: normal distribution, similar variance,
independence
•  Trasnformation of data if necessary

More Related Content

What's hot

Measures And Feedback
Measures And FeedbackMeasures And Feedback
Measures And FeedbackScott Miller
 
Measures and Feedback January 2011
Measures and Feedback January 2011Measures and Feedback January 2011
Measures and Feedback January 2011Scott Miller
 
7. Calculate samplesize for clinical trials
7. Calculate samplesize for clinical trials7. Calculate samplesize for clinical trials
7. Calculate samplesize for clinical trialsAzmi Mohd Tamil
 
Lecture_9_Sample_size_calculation_Summer_2016.pptx
Lecture_9_Sample_size_calculation_Summer_2016.pptxLecture_9_Sample_size_calculation_Summer_2016.pptx
Lecture_9_Sample_size_calculation_Summer_2016.pptxMostafizurrahman500195
 
Testing the hypothesis
Testing the hypothesisTesting the hypothesis
Testing the hypothesisJen Millan
 
Measures and Feedback (miller & schuckard, 2014)
Measures and Feedback (miller & schuckard, 2014)Measures and Feedback (miller & schuckard, 2014)
Measures and Feedback (miller & schuckard, 2014)Scott Miller
 
Utilizing the ORS in a Community Mental Health Clinic (student outcomes etc) ...
Utilizing the ORS in a Community Mental Health Clinic (student outcomes etc) ...Utilizing the ORS in a Community Mental Health Clinic (student outcomes etc) ...
Utilizing the ORS in a Community Mental Health Clinic (student outcomes etc) ...Scott Miller
 
Robust Methods for Health-related Quality-of-life Assessment
Robust Methods for Health-related  Quality-of-life AssessmentRobust Methods for Health-related  Quality-of-life Assessment
Robust Methods for Health-related Quality-of-life Assessmentdylanturner22
 
5. Calculate samplesize for case-control studies
5. Calculate samplesize for case-control studies5. Calculate samplesize for case-control studies
5. Calculate samplesize for case-control studiesAzmi Mohd Tamil
 
Comparative hospital performance: new data, borrowed methods, more targeted a...
Comparative hospital performance: new data, borrowed methods, more targeted a...Comparative hospital performance: new data, borrowed methods, more targeted a...
Comparative hospital performance: new data, borrowed methods, more targeted a...cheweb1
 
2010 smg training_cardiff_day1_session4_harbord
2010 smg training_cardiff_day1_session4_harbord2010 smg training_cardiff_day1_session4_harbord
2010 smg training_cardiff_day1_session4_harbordrgveroniki
 
Cutting diathermy and ordinary scalpel for skin incision in open surgery whic...
Cutting diathermy and ordinary scalpel for skin incision in open surgery whic...Cutting diathermy and ordinary scalpel for skin incision in open surgery whic...
Cutting diathermy and ordinary scalpel for skin incision in open surgery whic...ahmadalmraezy
 
9. Calculate samplesize for diagnostic study
9. Calculate samplesize for diagnostic study9. Calculate samplesize for diagnostic study
9. Calculate samplesize for diagnostic studyAzmi Mohd Tamil
 
4. Calculate samplesize for cross-sectional studies
4. Calculate samplesize for cross-sectional studies4. Calculate samplesize for cross-sectional studies
4. Calculate samplesize for cross-sectional studiesAzmi Mohd Tamil
 

What's hot (20)

Measures And Feedback
Measures And FeedbackMeasures And Feedback
Measures And Feedback
 
Measures and Feedback January 2011
Measures and Feedback January 2011Measures and Feedback January 2011
Measures and Feedback January 2011
 
7. Calculate samplesize for clinical trials
7. Calculate samplesize for clinical trials7. Calculate samplesize for clinical trials
7. Calculate samplesize for clinical trials
 
Lecture_9_Sample_size_calculation_Summer_2016.pptx
Lecture_9_Sample_size_calculation_Summer_2016.pptxLecture_9_Sample_size_calculation_Summer_2016.pptx
Lecture_9_Sample_size_calculation_Summer_2016.pptx
 
PS.Observational.SAS_Y.Duan
PS.Observational.SAS_Y.DuanPS.Observational.SAS_Y.Duan
PS.Observational.SAS_Y.Duan
 
Testing the hypothesis
Testing the hypothesisTesting the hypothesis
Testing the hypothesis
 
Measures and Feedback (miller & schuckard, 2014)
Measures and Feedback (miller & schuckard, 2014)Measures and Feedback (miller & schuckard, 2014)
Measures and Feedback (miller & schuckard, 2014)
 
Utilizing the ORS in a Community Mental Health Clinic (student outcomes etc) ...
Utilizing the ORS in a Community Mental Health Clinic (student outcomes etc) ...Utilizing the ORS in a Community Mental Health Clinic (student outcomes etc) ...
Utilizing the ORS in a Community Mental Health Clinic (student outcomes etc) ...
 
Robust Methods for Health-related Quality-of-life Assessment
Robust Methods for Health-related  Quality-of-life AssessmentRobust Methods for Health-related  Quality-of-life Assessment
Robust Methods for Health-related Quality-of-life Assessment
 
PMED: APPM Workshop: Overview of Methods for Subgroup Identification in Clini...
PMED: APPM Workshop: Overview of Methods for Subgroup Identification in Clini...PMED: APPM Workshop: Overview of Methods for Subgroup Identification in Clini...
PMED: APPM Workshop: Overview of Methods for Subgroup Identification in Clini...
 
JC
JCJC
JC
 
5. Calculate samplesize for case-control studies
5. Calculate samplesize for case-control studies5. Calculate samplesize for case-control studies
5. Calculate samplesize for case-control studies
 
Comparative hospital performance: new data, borrowed methods, more targeted a...
Comparative hospital performance: new data, borrowed methods, more targeted a...Comparative hospital performance: new data, borrowed methods, more targeted a...
Comparative hospital performance: new data, borrowed methods, more targeted a...
 
2010 smg training_cardiff_day1_session4_harbord
2010 smg training_cardiff_day1_session4_harbord2010 smg training_cardiff_day1_session4_harbord
2010 smg training_cardiff_day1_session4_harbord
 
Cutting diathermy and ordinary scalpel for skin incision in open surgery whic...
Cutting diathermy and ordinary scalpel for skin incision in open surgery whic...Cutting diathermy and ordinary scalpel for skin incision in open surgery whic...
Cutting diathermy and ordinary scalpel for skin incision in open surgery whic...
 
9. Calculate samplesize for diagnostic study
9. Calculate samplesize for diagnostic study9. Calculate samplesize for diagnostic study
9. Calculate samplesize for diagnostic study
 
Copenhagen 23.10.2008
Copenhagen 23.10.2008Copenhagen 23.10.2008
Copenhagen 23.10.2008
 
Twilight complex study
Twilight complex studyTwilight complex study
Twilight complex study
 
The Stepped Wedge study - Karla Hemming
The Stepped Wedge study - Karla HemmingThe Stepped Wedge study - Karla Hemming
The Stepped Wedge study - Karla Hemming
 
4. Calculate samplesize for cross-sectional studies
4. Calculate samplesize for cross-sectional studies4. Calculate samplesize for cross-sectional studies
4. Calculate samplesize for cross-sectional studies
 

Similar to Ct lecture 7. comparing two groups cont data

Ct lecture 13. more on linear regression analysis
Ct lecture 13. more on linear regression analysisCt lecture 13. more on linear regression analysis
Ct lecture 13. more on linear regression analysisHau Pham
 
Ct lecture 20. survival analysis (part 2)
Ct lecture 20. survival analysis (part 2)Ct lecture 20. survival analysis (part 2)
Ct lecture 20. survival analysis (part 2)Hau Pham
 
Ct lecture 12. simple linear regression analysis
Ct lecture 12. simple linear regression analysisCt lecture 12. simple linear regression analysis
Ct lecture 12. simple linear regression analysisHau Pham
 
Metanalysis Lecture
Metanalysis LectureMetanalysis Lecture
Metanalysis Lecturedrmomusa
 
Lecture 11 Paired t test.pptx
Lecture 11 Paired t test.pptxLecture 11 Paired t test.pptx
Lecture 11 Paired t test.pptxshakirRahman10
 
slides Testing of hypothesis.pptx
slides Testing  of  hypothesis.pptxslides Testing  of  hypothesis.pptx
slides Testing of hypothesis.pptxssuser504dda
 
t-test and one way ANOVA.ppt game.ppt
t-test and one way ANOVA.ppt game.pptt-test and one way ANOVA.ppt game.ppt
t-test and one way ANOVA.ppt game.pptMohammedAbdela7
 
Lecture 10 t –test for Two Independent Samples.pptx
Lecture 10 t –test for Two Independent Samples.pptxLecture 10 t –test for Two Independent Samples.pptx
Lecture 10 t –test for Two Independent Samples.pptxshakirRahman10
 
Test of significance (t-test, proportion test, chi-square test)
Test of significance (t-test, proportion test, chi-square test)Test of significance (t-test, proportion test, chi-square test)
Test of significance (t-test, proportion test, chi-square test)Ramnath Takiar
 
The health effects of eating contaminated fish
The health effects of eating contaminated fishThe health effects of eating contaminated fish
The health effects of eating contaminated fishService_supportAssignment
 
T Test Presentation.pptx
T Test Presentation.pptxT Test Presentation.pptx
T Test Presentation.pptxVishal Doke
 
inferentialstatistics-210411214248.pdf
inferentialstatistics-210411214248.pdfinferentialstatistics-210411214248.pdf
inferentialstatistics-210411214248.pdfChenPalaruan
 
Ct lecture 11. correlation analysis
Ct lecture 11. correlation analysisCt lecture 11. correlation analysis
Ct lecture 11. correlation analysisHau Pham
 
Statistical methods for the life sciences lb
Statistical methods for the life sciences lbStatistical methods for the life sciences lb
Statistical methods for the life sciences lbpriyaupm
 
Ct lecture 1. theory of measurements
Ct lecture 1. theory of measurementsCt lecture 1. theory of measurements
Ct lecture 1. theory of measurementsHau Pham
 
Chapter 7Hypothesis Testing ProceduresLearning.docx
Chapter 7Hypothesis Testing ProceduresLearning.docxChapter 7Hypothesis Testing ProceduresLearning.docx
Chapter 7Hypothesis Testing ProceduresLearning.docxmccormicknadine86
 

Similar to Ct lecture 7. comparing two groups cont data (20)

Ct lecture 13. more on linear regression analysis
Ct lecture 13. more on linear regression analysisCt lecture 13. more on linear regression analysis
Ct lecture 13. more on linear regression analysis
 
Ct lecture 20. survival analysis (part 2)
Ct lecture 20. survival analysis (part 2)Ct lecture 20. survival analysis (part 2)
Ct lecture 20. survival analysis (part 2)
 
Ct lecture 12. simple linear regression analysis
Ct lecture 12. simple linear regression analysisCt lecture 12. simple linear regression analysis
Ct lecture 12. simple linear regression analysis
 
Metanalysis Lecture
Metanalysis LectureMetanalysis Lecture
Metanalysis Lecture
 
Non parametric test
Non parametric testNon parametric test
Non parametric test
 
Lecture 11 Paired t test.pptx
Lecture 11 Paired t test.pptxLecture 11 Paired t test.pptx
Lecture 11 Paired t test.pptx
 
slides Testing of hypothesis.pptx
slides Testing  of  hypothesis.pptxslides Testing  of  hypothesis.pptx
slides Testing of hypothesis.pptx
 
t-test and one way ANOVA.ppt game.ppt
t-test and one way ANOVA.ppt game.pptt-test and one way ANOVA.ppt game.ppt
t-test and one way ANOVA.ppt game.ppt
 
Lecture 10 t –test for Two Independent Samples.pptx
Lecture 10 t –test for Two Independent Samples.pptxLecture 10 t –test for Two Independent Samples.pptx
Lecture 10 t –test for Two Independent Samples.pptx
 
Test of significance (t-test, proportion test, chi-square test)
Test of significance (t-test, proportion test, chi-square test)Test of significance (t-test, proportion test, chi-square test)
Test of significance (t-test, proportion test, chi-square test)
 
The health effects of eating contaminated fish
The health effects of eating contaminated fishThe health effects of eating contaminated fish
The health effects of eating contaminated fish
 
T Test Presentation.pptx
T Test Presentation.pptxT Test Presentation.pptx
T Test Presentation.pptx
 
Inferential statistics
Inferential statisticsInferential statistics
Inferential statistics
 
inferentialstatistics-210411214248.pdf
inferentialstatistics-210411214248.pdfinferentialstatistics-210411214248.pdf
inferentialstatistics-210411214248.pdf
 
Ct lecture 11. correlation analysis
Ct lecture 11. correlation analysisCt lecture 11. correlation analysis
Ct lecture 11. correlation analysis
 
Lab 1 intro
Lab 1 introLab 1 intro
Lab 1 intro
 
Statistical methods for the life sciences lb
Statistical methods for the life sciences lbStatistical methods for the life sciences lb
Statistical methods for the life sciences lb
 
Ct lecture 1. theory of measurements
Ct lecture 1. theory of measurementsCt lecture 1. theory of measurements
Ct lecture 1. theory of measurements
 
Test of significance
Test of significanceTest of significance
Test of significance
 
Chapter 7Hypothesis Testing ProceduresLearning.docx
Chapter 7Hypothesis Testing ProceduresLearning.docxChapter 7Hypothesis Testing ProceduresLearning.docx
Chapter 7Hypothesis Testing ProceduresLearning.docx
 

More from Hau Pham

2008_Plague-Slide_Ref SR20080097
2008_Plague-Slide_Ref SR200800972008_Plague-Slide_Ref SR20080097
2008_Plague-Slide_Ref SR20080097Hau Pham
 
Thuc hanh Dich Te Hoc Y Ha Noi 2003
Thuc hanh Dich Te Hoc Y Ha Noi 2003Thuc hanh Dich Te Hoc Y Ha Noi 2003
Thuc hanh Dich Te Hoc Y Ha Noi 2003Hau Pham
 
Lecture 3. planning data analysis
Lecture 3. planning data analysisLecture 3. planning data analysis
Lecture 3. planning data analysisHau Pham
 
Ct lecture 17. introduction to logistic regression
Ct lecture 17. introduction to logistic regressionCt lecture 17. introduction to logistic regression
Ct lecture 17. introduction to logistic regressionHau Pham
 
Ct lecture 16. model selection
Ct lecture 16. model selectionCt lecture 16. model selection
Ct lecture 16. model selectionHau Pham
 
Ct lecture 6. test of significance and test of h
Ct lecture 6. test of significance and test of hCt lecture 6. test of significance and test of h
Ct lecture 6. test of significance and test of hHau Pham
 
Ct lecture 5. descriptive analysis of categorical variables
Ct lecture 5. descriptive analysis of categorical variablesCt lecture 5. descriptive analysis of categorical variables
Ct lecture 5. descriptive analysis of categorical variablesHau Pham
 
Ct lecture 2. questionnaire deisgn
Ct lecture 2. questionnaire deisgnCt lecture 2. questionnaire deisgn
Ct lecture 2. questionnaire deisgnHau Pham
 
ThongKe Y-Sinh Hoc_Bài 1 một số kiến thức toán cơ bản
ThongKe Y-Sinh Hoc_Bài 1 một số kiến thức toán cơ bảnThongKe Y-Sinh Hoc_Bài 1 một số kiến thức toán cơ bản
ThongKe Y-Sinh Hoc_Bài 1 một số kiến thức toán cơ bảnHau Pham
 

More from Hau Pham (9)

2008_Plague-Slide_Ref SR20080097
2008_Plague-Slide_Ref SR200800972008_Plague-Slide_Ref SR20080097
2008_Plague-Slide_Ref SR20080097
 
Thuc hanh Dich Te Hoc Y Ha Noi 2003
Thuc hanh Dich Te Hoc Y Ha Noi 2003Thuc hanh Dich Te Hoc Y Ha Noi 2003
Thuc hanh Dich Te Hoc Y Ha Noi 2003
 
Lecture 3. planning data analysis
Lecture 3. planning data analysisLecture 3. planning data analysis
Lecture 3. planning data analysis
 
Ct lecture 17. introduction to logistic regression
Ct lecture 17. introduction to logistic regressionCt lecture 17. introduction to logistic regression
Ct lecture 17. introduction to logistic regression
 
Ct lecture 16. model selection
Ct lecture 16. model selectionCt lecture 16. model selection
Ct lecture 16. model selection
 
Ct lecture 6. test of significance and test of h
Ct lecture 6. test of significance and test of hCt lecture 6. test of significance and test of h
Ct lecture 6. test of significance and test of h
 
Ct lecture 5. descriptive analysis of categorical variables
Ct lecture 5. descriptive analysis of categorical variablesCt lecture 5. descriptive analysis of categorical variables
Ct lecture 5. descriptive analysis of categorical variables
 
Ct lecture 2. questionnaire deisgn
Ct lecture 2. questionnaire deisgnCt lecture 2. questionnaire deisgn
Ct lecture 2. questionnaire deisgn
 
ThongKe Y-Sinh Hoc_Bài 1 một số kiến thức toán cơ bản
ThongKe Y-Sinh Hoc_Bài 1 một số kiến thức toán cơ bảnThongKe Y-Sinh Hoc_Bài 1 một số kiến thức toán cơ bản
ThongKe Y-Sinh Hoc_Bài 1 một số kiến thức toán cơ bản
 

Recently uploaded

Call Girls Horamavu WhatsApp Number 7001035870 Meeting With Bangalore Escorts
Call Girls Horamavu WhatsApp Number 7001035870 Meeting With Bangalore EscortsCall Girls Horamavu WhatsApp Number 7001035870 Meeting With Bangalore Escorts
Call Girls Horamavu WhatsApp Number 7001035870 Meeting With Bangalore Escortsvidya singh
 
Call Girls Varanasi Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Varanasi Just Call 9907093804 Top Class Call Girl Service AvailableCall Girls Varanasi Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Varanasi Just Call 9907093804 Top Class Call Girl Service AvailableDipal Arora
 
Kesar Bagh Call Girl Price 9548273370 , Lucknow Call Girls Service
Kesar Bagh Call Girl Price 9548273370 , Lucknow Call Girls ServiceKesar Bagh Call Girl Price 9548273370 , Lucknow Call Girls Service
Kesar Bagh Call Girl Price 9548273370 , Lucknow Call Girls Servicemakika9823
 
Russian Escorts Girls Nehru Place ZINATHI 🔝9711199012 ☪ 24/7 Call Girls Delhi
Russian Escorts Girls  Nehru Place ZINATHI 🔝9711199012 ☪ 24/7 Call Girls DelhiRussian Escorts Girls  Nehru Place ZINATHI 🔝9711199012 ☪ 24/7 Call Girls Delhi
Russian Escorts Girls Nehru Place ZINATHI 🔝9711199012 ☪ 24/7 Call Girls DelhiAlinaDevecerski
 
VIP Call Girls Indore Kirti 💚😋 9256729539 🚀 Indore Escorts
VIP Call Girls Indore Kirti 💚😋  9256729539 🚀 Indore EscortsVIP Call Girls Indore Kirti 💚😋  9256729539 🚀 Indore Escorts
VIP Call Girls Indore Kirti 💚😋 9256729539 🚀 Indore Escortsaditipandeya
 
Call Girls Coimbatore Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Coimbatore Just Call 9907093804 Top Class Call Girl Service AvailableCall Girls Coimbatore Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Coimbatore Just Call 9907093804 Top Class Call Girl Service AvailableDipal Arora
 
Call Girls Colaba Mumbai ❤️ 9920874524 👈 Cash on Delivery
Call Girls Colaba Mumbai ❤️ 9920874524 👈 Cash on DeliveryCall Girls Colaba Mumbai ❤️ 9920874524 👈 Cash on Delivery
Call Girls Colaba Mumbai ❤️ 9920874524 👈 Cash on Deliverynehamumbai
 
Call Girl Coimbatore Prisha☎️ 8250192130 Independent Escort Service Coimbatore
Call Girl Coimbatore Prisha☎️  8250192130 Independent Escort Service CoimbatoreCall Girl Coimbatore Prisha☎️  8250192130 Independent Escort Service Coimbatore
Call Girl Coimbatore Prisha☎️ 8250192130 Independent Escort Service Coimbatorenarwatsonia7
 
Lucknow Call girls - 8800925952 - 24x7 service with hotel room
Lucknow Call girls - 8800925952 - 24x7 service with hotel roomLucknow Call girls - 8800925952 - 24x7 service with hotel room
Lucknow Call girls - 8800925952 - 24x7 service with hotel roomdiscovermytutordmt
 
Artifacts in Nuclear Medicine with Identifying and resolving artifacts.
Artifacts in Nuclear Medicine with Identifying and resolving artifacts.Artifacts in Nuclear Medicine with Identifying and resolving artifacts.
Artifacts in Nuclear Medicine with Identifying and resolving artifacts.MiadAlsulami
 
Call Girls Kochi Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Kochi Just Call 9907093804 Top Class Call Girl Service AvailableCall Girls Kochi Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Kochi Just Call 9907093804 Top Class Call Girl Service AvailableDipal Arora
 
Bangalore Call Girls Nelamangala Number 7001035870 Meetin With Bangalore Esc...
Bangalore Call Girls Nelamangala Number 7001035870  Meetin With Bangalore Esc...Bangalore Call Girls Nelamangala Number 7001035870  Meetin With Bangalore Esc...
Bangalore Call Girls Nelamangala Number 7001035870 Meetin With Bangalore Esc...narwatsonia7
 
The Most Attractive Hyderabad Call Girls Kothapet 𖠋 6297143586 𖠋 Will You Mis...
The Most Attractive Hyderabad Call Girls Kothapet 𖠋 6297143586 𖠋 Will You Mis...The Most Attractive Hyderabad Call Girls Kothapet 𖠋 6297143586 𖠋 Will You Mis...
The Most Attractive Hyderabad Call Girls Kothapet 𖠋 6297143586 𖠋 Will You Mis...chandars293
 
VIP Call Girls Tirunelveli Aaradhya 8250192130 Independent Escort Service Tir...
VIP Call Girls Tirunelveli Aaradhya 8250192130 Independent Escort Service Tir...VIP Call Girls Tirunelveli Aaradhya 8250192130 Independent Escort Service Tir...
VIP Call Girls Tirunelveli Aaradhya 8250192130 Independent Escort Service Tir...narwatsonia7
 
Call Girls Service Surat Samaira ❤️🍑 8250192130 👄 Independent Escort Service ...
Call Girls Service Surat Samaira ❤️🍑 8250192130 👄 Independent Escort Service ...Call Girls Service Surat Samaira ❤️🍑 8250192130 👄 Independent Escort Service ...
Call Girls Service Surat Samaira ❤️🍑 8250192130 👄 Independent Escort Service ...CALL GIRLS
 
♛VVIP Hyderabad Call Girls Chintalkunta🖕7001035870🖕Riya Kappor Top Call Girl ...
♛VVIP Hyderabad Call Girls Chintalkunta🖕7001035870🖕Riya Kappor Top Call Girl ...♛VVIP Hyderabad Call Girls Chintalkunta🖕7001035870🖕Riya Kappor Top Call Girl ...
♛VVIP Hyderabad Call Girls Chintalkunta🖕7001035870🖕Riya Kappor Top Call Girl ...astropune
 
Call Girls Nagpur Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Nagpur Just Call 9907093804 Top Class Call Girl Service AvailableCall Girls Nagpur Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Nagpur Just Call 9907093804 Top Class Call Girl Service AvailableDipal Arora
 
Night 7k to 12k Chennai City Center Call Girls 👉👉 7427069034⭐⭐ 100% Genuine E...
Night 7k to 12k Chennai City Center Call Girls 👉👉 7427069034⭐⭐ 100% Genuine E...Night 7k to 12k Chennai City Center Call Girls 👉👉 7427069034⭐⭐ 100% Genuine E...
Night 7k to 12k Chennai City Center Call Girls 👉👉 7427069034⭐⭐ 100% Genuine E...hotbabesbook
 
Top Rated Bangalore Call Girls Mg Road ⟟ 8250192130 ⟟ Call Me For Genuine Sex...
Top Rated Bangalore Call Girls Mg Road ⟟ 8250192130 ⟟ Call Me For Genuine Sex...Top Rated Bangalore Call Girls Mg Road ⟟ 8250192130 ⟟ Call Me For Genuine Sex...
Top Rated Bangalore Call Girls Mg Road ⟟ 8250192130 ⟟ Call Me For Genuine Sex...narwatsonia7
 
Bangalore Call Girls Hebbal Kempapura Number 7001035870 Meetin With Bangalor...
Bangalore Call Girls Hebbal Kempapura Number 7001035870  Meetin With Bangalor...Bangalore Call Girls Hebbal Kempapura Number 7001035870  Meetin With Bangalor...
Bangalore Call Girls Hebbal Kempapura Number 7001035870 Meetin With Bangalor...narwatsonia7
 

Recently uploaded (20)

Call Girls Horamavu WhatsApp Number 7001035870 Meeting With Bangalore Escorts
Call Girls Horamavu WhatsApp Number 7001035870 Meeting With Bangalore EscortsCall Girls Horamavu WhatsApp Number 7001035870 Meeting With Bangalore Escorts
Call Girls Horamavu WhatsApp Number 7001035870 Meeting With Bangalore Escorts
 
Call Girls Varanasi Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Varanasi Just Call 9907093804 Top Class Call Girl Service AvailableCall Girls Varanasi Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Varanasi Just Call 9907093804 Top Class Call Girl Service Available
 
Kesar Bagh Call Girl Price 9548273370 , Lucknow Call Girls Service
Kesar Bagh Call Girl Price 9548273370 , Lucknow Call Girls ServiceKesar Bagh Call Girl Price 9548273370 , Lucknow Call Girls Service
Kesar Bagh Call Girl Price 9548273370 , Lucknow Call Girls Service
 
Russian Escorts Girls Nehru Place ZINATHI 🔝9711199012 ☪ 24/7 Call Girls Delhi
Russian Escorts Girls  Nehru Place ZINATHI 🔝9711199012 ☪ 24/7 Call Girls DelhiRussian Escorts Girls  Nehru Place ZINATHI 🔝9711199012 ☪ 24/7 Call Girls Delhi
Russian Escorts Girls Nehru Place ZINATHI 🔝9711199012 ☪ 24/7 Call Girls Delhi
 
VIP Call Girls Indore Kirti 💚😋 9256729539 🚀 Indore Escorts
VIP Call Girls Indore Kirti 💚😋  9256729539 🚀 Indore EscortsVIP Call Girls Indore Kirti 💚😋  9256729539 🚀 Indore Escorts
VIP Call Girls Indore Kirti 💚😋 9256729539 🚀 Indore Escorts
 
Call Girls Coimbatore Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Coimbatore Just Call 9907093804 Top Class Call Girl Service AvailableCall Girls Coimbatore Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Coimbatore Just Call 9907093804 Top Class Call Girl Service Available
 
Call Girls Colaba Mumbai ❤️ 9920874524 👈 Cash on Delivery
Call Girls Colaba Mumbai ❤️ 9920874524 👈 Cash on DeliveryCall Girls Colaba Mumbai ❤️ 9920874524 👈 Cash on Delivery
Call Girls Colaba Mumbai ❤️ 9920874524 👈 Cash on Delivery
 
Call Girl Coimbatore Prisha☎️ 8250192130 Independent Escort Service Coimbatore
Call Girl Coimbatore Prisha☎️  8250192130 Independent Escort Service CoimbatoreCall Girl Coimbatore Prisha☎️  8250192130 Independent Escort Service Coimbatore
Call Girl Coimbatore Prisha☎️ 8250192130 Independent Escort Service Coimbatore
 
Lucknow Call girls - 8800925952 - 24x7 service with hotel room
Lucknow Call girls - 8800925952 - 24x7 service with hotel roomLucknow Call girls - 8800925952 - 24x7 service with hotel room
Lucknow Call girls - 8800925952 - 24x7 service with hotel room
 
Artifacts in Nuclear Medicine with Identifying and resolving artifacts.
Artifacts in Nuclear Medicine with Identifying and resolving artifacts.Artifacts in Nuclear Medicine with Identifying and resolving artifacts.
Artifacts in Nuclear Medicine with Identifying and resolving artifacts.
 
Call Girls Kochi Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Kochi Just Call 9907093804 Top Class Call Girl Service AvailableCall Girls Kochi Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Kochi Just Call 9907093804 Top Class Call Girl Service Available
 
Bangalore Call Girls Nelamangala Number 7001035870 Meetin With Bangalore Esc...
Bangalore Call Girls Nelamangala Number 7001035870  Meetin With Bangalore Esc...Bangalore Call Girls Nelamangala Number 7001035870  Meetin With Bangalore Esc...
Bangalore Call Girls Nelamangala Number 7001035870 Meetin With Bangalore Esc...
 
The Most Attractive Hyderabad Call Girls Kothapet 𖠋 6297143586 𖠋 Will You Mis...
The Most Attractive Hyderabad Call Girls Kothapet 𖠋 6297143586 𖠋 Will You Mis...The Most Attractive Hyderabad Call Girls Kothapet 𖠋 6297143586 𖠋 Will You Mis...
The Most Attractive Hyderabad Call Girls Kothapet 𖠋 6297143586 𖠋 Will You Mis...
 
VIP Call Girls Tirunelveli Aaradhya 8250192130 Independent Escort Service Tir...
VIP Call Girls Tirunelveli Aaradhya 8250192130 Independent Escort Service Tir...VIP Call Girls Tirunelveli Aaradhya 8250192130 Independent Escort Service Tir...
VIP Call Girls Tirunelveli Aaradhya 8250192130 Independent Escort Service Tir...
 
Call Girls Service Surat Samaira ❤️🍑 8250192130 👄 Independent Escort Service ...
Call Girls Service Surat Samaira ❤️🍑 8250192130 👄 Independent Escort Service ...Call Girls Service Surat Samaira ❤️🍑 8250192130 👄 Independent Escort Service ...
Call Girls Service Surat Samaira ❤️🍑 8250192130 👄 Independent Escort Service ...
 
♛VVIP Hyderabad Call Girls Chintalkunta🖕7001035870🖕Riya Kappor Top Call Girl ...
♛VVIP Hyderabad Call Girls Chintalkunta🖕7001035870🖕Riya Kappor Top Call Girl ...♛VVIP Hyderabad Call Girls Chintalkunta🖕7001035870🖕Riya Kappor Top Call Girl ...
♛VVIP Hyderabad Call Girls Chintalkunta🖕7001035870🖕Riya Kappor Top Call Girl ...
 
Call Girls Nagpur Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Nagpur Just Call 9907093804 Top Class Call Girl Service AvailableCall Girls Nagpur Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Nagpur Just Call 9907093804 Top Class Call Girl Service Available
 
Night 7k to 12k Chennai City Center Call Girls 👉👉 7427069034⭐⭐ 100% Genuine E...
Night 7k to 12k Chennai City Center Call Girls 👉👉 7427069034⭐⭐ 100% Genuine E...Night 7k to 12k Chennai City Center Call Girls 👉👉 7427069034⭐⭐ 100% Genuine E...
Night 7k to 12k Chennai City Center Call Girls 👉👉 7427069034⭐⭐ 100% Genuine E...
 
Top Rated Bangalore Call Girls Mg Road ⟟ 8250192130 ⟟ Call Me For Genuine Sex...
Top Rated Bangalore Call Girls Mg Road ⟟ 8250192130 ⟟ Call Me For Genuine Sex...Top Rated Bangalore Call Girls Mg Road ⟟ 8250192130 ⟟ Call Me For Genuine Sex...
Top Rated Bangalore Call Girls Mg Road ⟟ 8250192130 ⟟ Call Me For Genuine Sex...
 
Bangalore Call Girls Hebbal Kempapura Number 7001035870 Meetin With Bangalor...
Bangalore Call Girls Hebbal Kempapura Number 7001035870  Meetin With Bangalor...Bangalore Call Girls Hebbal Kempapura Number 7001035870  Meetin With Bangalor...
Bangalore Call Girls Hebbal Kempapura Number 7001035870 Meetin With Bangalor...
 

Ct lecture 7. comparing two groups cont data

  • 1. Workshop on Analysis of Clinical Studies – Can Tho University of Medicine and Pharmacy – April 2012 Comparing two groups: continuous data Tuan V. Nguyen Professor and NHMRC Senior Research Fellow Garvan Institute of Medical Research University of New South Wales Sydney, Australia
  • 2. Workshop on Analysis of Clinical Studies – Can Tho University of Medicine and Pharmacy – April 2012 What we are going to learn … •  Some examples •  Estimation and test of hypothesis •  R analysis •  Interpretation
  • 3. Workshop on Analysis of Clinical Studies – Can Tho University of Medicine and Pharmacy – April 2012 Lan T Ho-Pham , et al obesity 2010 Difference between US and Viet women
  • 4. Workshop on Analysis of Clinical Studies – Can Tho University of Medicine and Pharmacy – April 2012 Vitamin D in Vietnamese men and women •  Vitamin D (25-hydroxyvitamin D) Men Women N 222 336 Mean 28.57 23.79 SD (standard deviation) 8.94 7.86 •  Is there real difference between men and women?
  • 5. Workshop on Analysis of Clinical Studies – Can Tho University of Medicine and Pharmacy – April 2012 Inference for 2-sample means •  Estimation and test of hypothesis Assumptions: •  The two samples are independent •  The two sample sizes are large. That is, n1 > 30 and n2 > 30 •  Both samples are simple random  samples
  • 6. Workshop on Analysis of Clinical Studies – Can Tho University of Medicine and Pharmacy – April 2012 Estimation: sample and population Sample Population Men Women Men Women N 222 (n1) 336 (n2) Infinite Infinite Mean 28.57 (x1) 23.79 (x2) m1 = ? m2 = ? SD (standard deviation) 8.94 (s1) 7.86 (s2) s1 = ? s2 = ?
  • 7. Workshop on Analysis of Clinical Studies – Can Tho University of Medicine and Pharmacy – April 2012 Estimation: sample and population Sample Population Men Women Men Women N 222 (n1) 336 (n2) Infinite Infinite Mean 28.57 (x1) 23.79 (x2) m1 = ? m2 = ? SD (standard deviation) 8.94 (s1) 7.86 (s2) s1 = ? s2 = ? Difference d = x1 – x 1 d = m1 – m2 Status Known Unknown
  • 8. Workshop on Analysis of Clinical Studies – Can Tho University of Medicine and Pharmacy – April 2012 •  “Is there real difference between men and women” means whether d = 0. •  We want to estimate the sampling variability around d Sample Population Men Women Men Women N 222 (n1) 336 (n2) Infinite Infinite Mean 28.57 (x1) 23.79 (x2) m1 = ? m2 = ? SD (standard deviation) 8.94 (s1) 7.86 (s2) s1 = ? s2 = ? Difference d = x1 – x 1 d = m1 – m2 Status Known Unknown
  • 9. Workshop on Analysis of Clinical Studies – Can Tho University of Medicine and Pharmacy – April 2012 Estimation •  We need to estimate d and standard deviation of d (denoted by s) s = n1 n2 + s1 . !2 2 2 •  95% confidence interval of d is approximately: d + 1.96 s
  • 10. Workshop on Analysis of Clinical Studies – Can Tho University of Medicine and Pharmacy – April 2012 Test of hypothesis Null hypothesis Ho : !1 = !2 Alternative hypothesis H1 : !1 ! !2 Question: if Ho is true, what is the chance that we observed the data as reported? è P-value
  • 11. Workshop on Analysis of Clinical Studies – Can Tho University of Medicine and Pharmacy – April 2012 Test of hypothesis •  Set alpha = 0.05 or 0.01 •  Calculate a statistic •  Compare the statistic with the null distrribution Fail to reject H0 Reject H0 Reject H0 t = - 2.575 t = 2.575 !1 - !! = 0 or t = 0
  • 12. Workshop on Analysis of Clinical Studies – Can Tho University of Medicine and Pharmacy – April 2012 Test statistic t = Difference SD of difference = Signal Noise (x1 - x2) t = n1 n2 + s1 . !2 2 2
  • 13. Workshop on Analysis of Clinical Studies – Can Tho University of Medicine and Pharmacy – April 2012 Test statistic (x1 - x2) t = n1 n2 + s1 . !2 2 2 !! and !!!! If!!! and !!!!!are not known, use s1 and s2 in their places. provided that both samples are large.! P-value: Use the computed value of the test statistic t, and find the P-value
  • 14. Workshop on Analysis of Clinical Studies – Can Tho University of Medicine and Pharmacy – April 2012 Using R setwd("C:/Documents and Settings/Tuan/My Documents/ _Current Projects/_Vietnam/Huong/Vitamin D") vd = read.csv("vitaminD.csv", header=T, na.strings=" ") attach(vd) library(psych) describe.by(vitd, sex) t = t.test(vitd ~ sex) print(t)
  • 15. Workshop on Analysis of Clinical Studies – Can Tho University of Medicine and Pharmacy – April 2012 R outputs > describe.by(vitd, sex) group: 1 var n mean sd median trimmed mad min max range skew kurtosis se 1 1 222 28.57 8.94 28.29 28.45 8.46 4 59.87 55.87 0.17 0.66 0.6 -------------------------------------------------------------------------- group: 2 var n mean sd median trimmed mad min max range skew kurtosis se 1 1 336 23.79 7.86 24.26 23.93 7.1 4 59.6 55.6 0.07 1.22 0.43
  • 16. Workshop on Analysis of Clinical Studies – Can Tho University of Medicine and Pharmacy – April 2012 R output – t-test > t = t.test(vitd ~ sex) > print(t) t = 6.4768, df = 430.332, p-value = 2.562e-10 alternative hypothesis: true difference in means is not equal to 0 95 percent confidence interval: 3.326365 6.224809 Men Women Difference and 95% CI P-value N 222 336 336 Mean 28.6 (8.9) 23.8 (7.9) 4.8 (3.3 – 6.2) <0.0001
  • 17. Workshop on Analysis of Clinical Studies – Can Tho University of Medicine and Pharmacy – April 2012 Interpretation Men Women Difference and 95% CI P-value N 222 336 336 Mean 28.6 (8.9) 23.8 (7.9) 4.8 (3.3 – 6.2) <0.0001 25(OH)D in men was higher than that in women, with average difference being 4.8 ng/mL (95% CI: 3.3 to 6.2 ng/mL; P < 0.0001).
  • 18. Workshop on Analysis of Clinical Studies – Can Tho University of Medicine and Pharmacy – April 2012 se = (6.2-3.3)/(2*1.96) d = rnorm(1000, mean=4.8, sd=se) > hist(d, xlim=c(-2, 8)) Histogram of d d Frequency -2 0 2 4 6 8 0 50 100 150 200 250
  • 19. Workshop on Analysis of Clinical Studies – Can Tho University of Medicine and Pharmacy – April 2012 Transformation of data > describe.by(xlap, sex) group: 1 var n mean sd median trimmed mad min max range skew kurtosis se 1 1 100 0.45 0.31 0.35 0.41 0.26 0.02 1.57 1.55 1.4 2.15 0.03 ------------------------------------------------------------ group: 2 var n mean sd median trimmed mad min max range skew kurtosis se 1 1 144 0.34 0.24 0.28 0.31 0.19 0.06 1.26 1.2 1.3 1.39 0.02
  • 20. Workshop on Analysis of Clinical Studies – Can Tho University of Medicine and Pharmacy – April 2012 Histogram of xlap xlap Frequency 0.0 0.5 1.0 1.5 0 20 40 60 80 Histogram of log(xlap + 0.1) log(xlap + 0.1) Frequency -2.5 -2.0 -1.5 -1.0 -0.5 0.0 0.5 1.0 0 20 40 60 80 > library(nortest) > pearson.test(xlap) Pearson chi-square normality test data: xlap P = 87.877, p-value = 6.145e-12 > pearson.test(log(xlap+0.1)) Pearson chi-square normality test data: log(xlap + 0.1) P = 20.7541, p-value = 0.1882
  • 21. Workshop on Analysis of Clinical Studies – Can Tho University of Medicine and Pharmacy – April 2012 Analysis of transformeddata > describe.by(log(xlap+0.1), sex) group: 1 var n mean sd median trimmed mad min max range skew kurtosis se 1 1 100 -0.73 0.52 -0.8 -0.73 0.54 -2.1 0.51 2.61 0.08 -0.34 0.05 ------------------------------------------------------------ group: 2 var n mean sd median trimmed mad min max range skew kurtosis se 1 1 144 -0.94 0.5 -0.97 -0.97 0.52 -1.82 0.31 2.13 0.3 -0.66 0.04
  • 22. Workshop on Analysis of Clinical Studies – Can Tho University of Medicine and Pharmacy – April 2012 T-test on transformed data > t.test(log(xlap+0.1) ~ sex) data: log(xlap + 0.1) by sex t = 3.216, df = 206.284, p-value = 0.001509 alternative hypothesis: true difference in means is not equal to 0 95 percent confidence interval: 0.08306888 0.34626674 sample estimates: mean in group 1 mean in group 2 -0.7300382 -0.9447060 Exp(-0.73+0.9447) = 1.234 Exp(0.083) = 1.086 Exp(0.346) = 1.413
  • 23. Workshop on Analysis of Clinical Studies – Can Tho University of Medicine and Pharmacy – April 2012 Interpretation Men Women Percentage difference and 95% CI P-value N 100 144 Mean 0.45 (0.31) 0.34 (0.24) 23% (8.6, 41.3) 0.0015 Compared with women, beta crosslap was 23% (95% CI: 8.6 to 41.3%) higher in men , and the difference was statistically significant (P = 0.001)
  • 24. Workshop on Analysis of Clinical Studies – Can Tho University of Medicine and Pharmacy – April 2012 Non-parametric analysis •  Wilcoxon’s rank sum test > wilcox.test(xlap ~ sex) Wilcoxon rank sum test with continuity correction data: xlap by sex W = 8890, p-value = 0.001834 alternative hypothesis: true location shift is not equal to 0
  • 25. Workshop on Analysis of Clinical Studies – Can Tho University of Medicine and Pharmacy – April 2012 Non-parametric analysis •  Permutation and median test > library(coin) > oneway_test(xlap ~ as.factor(sex)) Asymptotic 2-Sample Permutation Test data: xlap by as.factor(sex) (1, 2) Z = 3.1073, p-value = 0.001888 alternative hypothesis: true mu is not equal to 0 > median_test(xlap ~ as.factor(sex)) Asymptotic Median Test data: xlap by as.factor(sex) (1, 2) Z = -2.8579, p-value = 0.004265 alternative hypothesis: true mu is not equal to 0
  • 26. Workshop on Analysis of Clinical Studies – Can Tho University of Medicine and Pharmacy – April 2012 Summary •  Statistical tests: –  T-test: comparing two groups, for continuous outcomes –  Non-parametric tests: Wilcoxon, median, and permutation tests •  Assumptions: normal distribution, similar variance, independence •  Trasnformation of data if necessary