Case-crossover study

Jinseob Kim
Jinseob KimSenior Engineer at Samsung Electronics
Analysis of Time-series Data
Case-crossover Study
Jinseob Kim
July 17, 2015
Jinseob Kim Analysis of Time-series Data July 17, 2015 1 / 30
Contents
1 Concepts
Individual data
Design
2 Conditional logistic regression
Review Basic linear regression
Logistic regression
Conditional logistic regression
3 Practice
Issues
In R
Jinseob Kim Analysis of Time-series Data July 17, 2015 2 / 30
Objective
1 Individual risk VS population risk
2 Case-crossover design의 개념
3 주의사항
4 적용: season package in R
Jinseob Kim Analysis of Time-series Data July 17, 2015 3 / 30
Concepts
Contents
1 Concepts
Individual data
Design
2 Conditional logistic regression
Review Basic linear regression
Logistic regression
Conditional logistic regression
3 Practice
Issues
In R
Jinseob Kim Analysis of Time-series Data July 17, 2015 4 / 30
Concepts Individual data
Two approaches to see the relationship between weather
and health outcome
Population based study
Y: # events (daily death counts or # hospital admissions)
X: temperature
Estimates pop’n risk (% change in daily death counts corresponding
to the change in temperature)
Individual based study
Y : 1 if an event occurs, 0 otherwise
X : temperature
Estimates individual risk (% change in individual probability of event
or odds ratio corresponding to the change in temperature)
Jinseob Kim Analysis of Time-series Data July 17, 2015 5 / 30
Concepts Individual data
Data structure change
(Year,week,case)
(2006,1,20) : 1 case
(Year,week,event)
(2006,1,1), (2006,1,1), · · · , (2006,1,1) : 20개 case
(2005,53,0), · · · , (2005,53,0), (2006,2,0), · · · , (2006,2,0) : controls..
Jinseob Kim Analysis of Time-series Data July 17, 2015 6 / 30
Concepts Design
Case + Crossover
Case: 환자만 이용.
Crossover: 환자의 다른 시점이 대조군.
Jinseob Kim Analysis of Time-series Data July 17, 2015 7 / 30
Concepts Design
If average (air pollution) of controls < average (air pollution) of case
days..
We conclude that the event is associated with higher values of air
pollution
Jinseob Kim Analysis of Time-series Data July 17, 2015 8 / 30
Concepts Design
Various control day
Time trend로 인한 bias 보정
Jinseob Kim Analysis of Time-series Data July 17, 2015 9 / 30
Conditional logistic regression
Contents
1 Concepts
Individual data
Design
2 Conditional logistic regression
Review Basic linear regression
Logistic regression
Conditional logistic regression
3 Practice
Issues
In R
Jinseob Kim Analysis of Time-series Data July 17, 2015 10 / 30
Conditional logistic regression Review Basic linear regression
Remind
β estimation in linear regression
1 Ordinary Least Square(OLS): semi-parametric
2 Maximum Likelihood Estimator(MLE): parametric
Jinseob Kim Analysis of Time-series Data July 17, 2015 11 / 30
Conditional logistic regression Review Basic linear regression
Least Square(최소제곱법)
제곱합을 최소로: y 정규성에 대한 가정 필요없다.
Figure: OLS Fitting
Jinseob Kim Analysis of Time-series Data July 17, 2015 12 / 30
Conditional logistic regression Review Basic linear regression
Likelihood??
가능도(likelihood) VS 확률(probability)
Discrete: 가능도 = 확률 - 주사위 던져 1나올 확률은 1
6
Continuous: 가능도 != 확률 - 0∼1 에서 숫자 하나 뽑았을 때 0.7일
확률은 0...
Jinseob Kim Analysis of Time-series Data July 17, 2015 13 / 30
Conditional logistic regression Review Basic linear regression
Maximum likelihood estimator(MLE)
최대가능도추정량: 1, · · · , n이 서로 독립이라하자.
1 각각의 가능도 함수를 구한다.
2 가능도를 전부 곱하면 전체 사건의 가능도 (독립이니까)
3 가능도를 최대로 하는 β를 구한다.
Jinseob Kim Analysis of Time-series Data July 17, 2015 14 / 30
Conditional logistic regression Review Basic linear regression
MLE: 최대가능도추정량
데이터가 일어날 가능성을 최대로: y또는 분포가정필요.
Jinseob Kim Analysis of Time-series Data July 17, 2015 15 / 30
Conditional logistic regression Review Basic linear regression
Logistic function: MLE
Figure: Fitting Logistic Function
Jinseob Kim Analysis of Time-series Data July 17, 2015 16 / 30
Conditional logistic regression Review Basic linear regression
LRT? Ward? score?
Likelihood Ratio Test VS Ward test VS score test
1 통계적 유의성 판단하는 방법들.
2 가능도비교 VS 베타값비교 VS 기울기비교/
Jinseob Kim Analysis of Time-series Data July 17, 2015 17 / 30
Conditional logistic regression Review Basic linear regression
비교
Figure: Comparison
Jinseob Kim Analysis of Time-series Data July 17, 2015 18 / 30
Conditional logistic regression Logistic regression
Model
Log(
pi
1 − pi
) = β0 + β1 · xi1
pi = P(Yi = 1) =
exp(β0 + β1 · xi1)
1 + exp(β0 + β1 · xi1)
P(Yi = 0) =
1
1 + exp(β0 + β1 · xi1)
P(Yi = yi ) = (
exp(β0 + β1 · xi1)
1 + exp(β0 + β1 · xi1)
)yi
(
1
1 + exp(β0 + β1 · xi1)
)1−yi
Jinseob Kim Analysis of Time-series Data July 17, 2015 19 / 30
Conditional logistic regression Logistic regression
Likelihood
Likelihood=
n
i=1
P(Yi = yi ) =
n
i=1
(
exp(β0 + β1 · xi1)
1 + exp(β0 + β1 · xi1)
)yi
(
1
1 + exp(β0 + β1 · xi1)
)1−yi
개인별로 가능도(데이터의 상황이 나올 확률)이 나온다.
그것들을 다 곱하면 Likelihood
이것을 최소로 하는 β를 구하는 것.
Case나 Control이나 따로따로 Likelihood를 구한다.
Jinseob Kim Analysis of Time-series Data July 17, 2015 20 / 30
Conditional logistic regression Conditional logistic regression
Conditional likelihood
Matched case-control set
Case와 그의 control들(1:1 or 1:N)이 한 쌍!!
쌍별로 likelihood가 나온다.
쌍별로 우리의 데이터를 볼 가능성을 계산.
모든 쌍에 대해 다 곱하면 전체 Likelihood
Jinseob Kim Analysis of Time-series Data July 17, 2015 21 / 30
Conditional logistic regression Conditional logistic regression
Definition
ith strata(1 ≤ i ≤ N): 1 case(이름:갑), ni control이라 하자.
Conditional likelihood of ith strata=
Li = P(갑이 case고 나머지가 control|case 1명&control ni 명)
Total likelihood=
N
i=1
Li
Jinseob Kim Analysis of Time-series Data July 17, 2015 22 / 30
Practice
Contents
1 Concepts
Individual data
Design
2 Conditional logistic regression
Review Basic linear regression
Logistic regression
Conditional logistic regression
3 Practice
Issues
In R
Jinseob Kim Analysis of Time-series Data July 17, 2015 23 / 30
Practice Issues
Control 확실하냐?
앞 뒤 7일, 14일 등.. control이 확실??
Exposure → Disease가 짧아야..
Exposure 가 축적되지 않아야..
급성질환, 폭로의 일시적 효과 (ex:폭염과 사망)
Jinseob Kim Analysis of Time-series Data July 17, 2015 24 / 30
Practice In R
season package
> library(season)
> data(CVDdaily) # cardiovascular disease data
> CVDdaily=subset(CVDdaily,date<=as.Date('1987-12-31')) # subset for exampl
> head(CVDdaily)
date cvd dow tmpd o3mean o3tmean Mon Tue Wed Thu Fri Sat
3 1987-01-01 55 Thursday 54.50 -16.0073 -15.89619 0 0 0 1 0 0
5 1987-01-02 73 Friday 58.50 -11.6595 -11.19102 0 0 0 0 1 0
9 1987-01-03 64 Saturday 55.25 -10.3241 -10.51787 0 0 0 0 0 1
12 1987-01-04 57 Sunday 54.75 -18.6471 -18.27014 0 0 0 0 0 0
15 1987-01-05 56 Monday 54.50 -17.5291 -17.13201 1 0 0 0 0 0
18 1987-01-06 65 Tuesday 49.75 -22.7846 -22.74711 0 1 0 0 0 0
month winter spring summer autumn
3 1 1 0 0 0
5 1 1 0 0 0
9 1 1 0 0 0
12 1 1 0 0 0
15 1 1 0 0 0
18 1 1 0 0 0
Jinseob Kim Analysis of Time-series Data July 17, 2015 25 / 30
Practice In R
casecross()
> # Effect of ozone on CVD death
> model1 = casecross(cvd ~ o3mean+tmpd+Mon+Tue+Wed+Thu+Fri+Sat, data=CVDdaily)
> # match on day of the week
> model2 = casecross(cvd ~ o3mean+tmpd,matchdow=TRUE, data=CVDdaily)
> # match on temperature to within a degree
> model3 = casecross(cvd ~ o3mean+Mon+Tue+Wed+Thu+Fri+Sat, data=CVDdaily, matchconf='tmpd', confrange=1)
Jinseob Kim Analysis of Time-series Data July 17, 2015 26 / 30
Practice In R
casecross(formula = cvd ~ o3mean + tmpd + Mon + Tue + Wed + Thu +
Fri + Sat, data = CVDdaily, exclusion = 2, stratalength = 28,
matchdow = FALSE, usefinalwindow = FALSE, matchconf = "",
confrange = 0, stratamonth = FALSE)
Time-stratified case-crossover with a stratum length of 28 days
Total number of cases 17502
Number of case days with available control days 364
Average number of control days per case day 23.2
Parameter Estimates:
coef exp(coef) se(coef) z Pr(>|z|)
o3mean -0.002882613 0.9971215 0.001128975 -2.55330077 0.01067073
tmpd 0.001461400 1.0014625 0.001981047 0.73769030 0.46070267
Mon 0.042733425 1.0436596 0.028942815 1.47647783 0.13981566
Tue 0.057910712 1.0596204 0.028772745 2.01269332 0.04414690
Wed -0.010008025 0.9900419 0.029171937 -0.34307029 0.73154558
Thu -0.016790296 0.9833499 0.029455877 -0.57001513 0.56866744
Fri 0.027247952 1.0276226 0.029173235 0.93400517 0.35030123
Sat 0.001855841 1.0018576 0.028900116 0.06421568 0.94879849
Jinseob Kim Analysis of Time-series Data July 17, 2015 27 / 30
Practice In R
casecross(formula = cvd ~ o3mean + tmpd, data = CVDdaily, matchdow = TRUE,
exclusion = 2, stratalength = 28, usefinalwindow = FALSE,
matchconf = "", confrange = 0, stratamonth = FALSE)
Time-stratified case-crossover with a stratum length of 28 days
Matched on day of the week
Total number of cases 17502
Number of case days with available control days 364
Average number of control days per case day 3
Parameter Estimates:
coef exp(coef) se(coef) z Pr(>|z|)
o3mean -0.0030752572 0.9969295 0.001188540 -2.5874238 0.009669658
tmpd -0.0004095116 0.9995906 0.002131744 -0.1921017 0.847662557
Jinseob Kim Analysis of Time-series Data July 17, 2015 28 / 30
Practice In R
casecross(formula = cvd ~ o3mean + Mon + Tue + Wed + Thu + Fri +
Sat, data = CVDdaily, matchconf = "tmpd", confrange = 1,
exclusion = 2, stratalength = 28, matchdow = FALSE, usefinalwindow = FA
stratamonth = FALSE)
Time-stratified case-crossover with a stratum length of 28 days
Matched on tmpd plus/minus 1
Total number of cases 15180
Number of case days with available control days 318
Average number of control days per case day 4.9
Parameter Estimates:
coef exp(coef) se(coef) z Pr(>|z|)
o3mean -0.003238583 0.9967667 0.00131839 -2.4564691 1.403099e-02
Mon 0.182058170 1.1996840 0.03577818 5.0885255 3.608582e-07
Tue 0.144181049 1.1550932 0.03563272 4.0463108 5.203115e-05
Wed 0.099443480 1.1045560 0.03554924 2.7973451 5.152447e-03
Thu 0.088518237 1.0925542 0.03459482 2.5587140 1.050601e-02
Fri 0.108107305 1.1141673 0.03437323 3.1451022 1.660288e-03
Sat 0.023660066 1.0239422 0.03525152 0.6711786 5.021068e-01
Jinseob Kim Analysis of Time-series Data July 17, 2015 29 / 30
Practice In R
END
Email : secondmath85@gmail.com
Jinseob Kim Analysis of Time-series Data July 17, 2015 30 / 30
1 of 30

Recommended

6.4.4 designs case-crossover by
6.4.4 designs case-crossover6.4.4 designs case-crossover
6.4.4 designs case-crossoverA M
3.9K views9 slides
Relative and Atribute Risk by
Relative and Atribute RiskRelative and Atribute Risk
Relative and Atribute RiskTauseef Jawaid
21.7K views21 slides
Likelihood Ratio, ROC and kappa Statistics by
Likelihood Ratio,  ROC and kappa StatisticsLikelihood Ratio,  ROC and kappa Statistics
Likelihood Ratio, ROC and kappa Statisticsamitakashyap1
546 views34 slides
Mixed Effects Models - Fixed Effects by
Mixed Effects Models - Fixed EffectsMixed Effects Models - Fixed Effects
Mixed Effects Models - Fixed EffectsScott Fraundorf
222 views58 slides
Survival analysis by
Survival analysisSurvival analysis
Survival analysisHar Jindal
23.6K views77 slides
Nested case control study by
Nested case control studyNested case control study
Nested case control studyPrayas Gautam
8.7K views7 slides

More Related Content

What's hot

Epidemiological studies by
Epidemiological studiesEpidemiological studies
Epidemiological studiesBruno Mmassy
35.4K views36 slides
Sensitivity, specificity, positive and negative predictive by
Sensitivity, specificity, positive and negative predictiveSensitivity, specificity, positive and negative predictive
Sensitivity, specificity, positive and negative predictiveMusthafa Peedikayil
15.8K views6 slides
Survival analysis & Kaplan Meire by
Survival analysis & Kaplan MeireSurvival analysis & Kaplan Meire
Survival analysis & Kaplan MeireDr Athar Khan
3K views57 slides
Measures of association by
Measures of associationMeasures of association
Measures of associationIAU Dent
5K views6 slides
Measures of disease frequency by
Measures of disease frequency Measures of disease frequency
Measures of disease frequency Dr Venkatesh Karthikeyan
1.8K views65 slides

What's hot(20)

Epidemiological studies by Bruno Mmassy
Epidemiological studiesEpidemiological studies
Epidemiological studies
Bruno Mmassy35.4K views
Sensitivity, specificity, positive and negative predictive by Musthafa Peedikayil
Sensitivity, specificity, positive and negative predictiveSensitivity, specificity, positive and negative predictive
Sensitivity, specificity, positive and negative predictive
Musthafa Peedikayil15.8K views
Survival analysis & Kaplan Meire by Dr Athar Khan
Survival analysis & Kaplan MeireSurvival analysis & Kaplan Meire
Survival analysis & Kaplan Meire
Dr Athar Khan3K views
Measures of association by IAU Dent
Measures of associationMeasures of association
Measures of association
IAU Dent5K views
Medical Statistics Pt 1 by Fastbleep
Medical Statistics Pt 1Medical Statistics Pt 1
Medical Statistics Pt 1
Fastbleep2.3K views
An Introduction to Infectious Disease Modeling by InsideScientific
An Introduction to Infectious Disease ModelingAn Introduction to Infectious Disease Modeling
An Introduction to Infectious Disease Modeling
InsideScientific1.9K views
Measures of Disease, Morbidity& mortality by ADIL .
Measures of Disease, Morbidity& mortalityMeasures of Disease, Morbidity& mortality
Measures of Disease, Morbidity& mortality
ADIL .765 views
prevalence and incidence rate by isa talukder
prevalence and incidence rateprevalence and incidence rate
prevalence and incidence rate
isa talukder4K views
Epidemological studies by bhuvanesh4668
Epidemological studies Epidemological studies
Epidemological studies
bhuvanesh46681.7K views
Descriptive and Analytical Epidemiology by coolboy101pk
Descriptive and Analytical Epidemiology Descriptive and Analytical Epidemiology
Descriptive and Analytical Epidemiology
coolboy101pk99K views

Viewers also liked

Impact of three decades of energy efficiency interventions in public housing ... by
Impact of three decades of energy efficiency interventions in public housing ...Impact of three decades of energy efficiency interventions in public housing ...
Impact of three decades of energy efficiency interventions in public housing ...sophieproject
1.3K views19 slides
Improving informed consent forms in clinical research studies by
Improving informed consent forms in clinical research studiesImproving informed consent forms in clinical research studies
Improving informed consent forms in clinical research studiesTrialJoin
609 views11 slides
Understanding Your Customer dsp_certificate by
Understanding Your Customer dsp_certificateUnderstanding Your Customer dsp_certificate
Understanding Your Customer dsp_certificateCarrie E. Williams
262 views1 slide
Study designs in epidemiology by
Study designs in epidemiologyStudy designs in epidemiology
Study designs in epidemiologyBhoj Raj Singh
6.7K views17 slides
Types and Designs of Clinical Studies by
Types and Designs of Clinical StudiesTypes and Designs of Clinical Studies
Types and Designs of Clinical StudiesTrialJoin
9.1K views17 slides
Logistic Regression in Case-Control Study by
Logistic Regression in Case-Control StudyLogistic Regression in Case-Control Study
Logistic Regression in Case-Control StudySatish Gupta
11K views28 slides

Viewers also liked(8)

Impact of three decades of energy efficiency interventions in public housing ... by sophieproject
Impact of three decades of energy efficiency interventions in public housing ...Impact of three decades of energy efficiency interventions in public housing ...
Impact of three decades of energy efficiency interventions in public housing ...
sophieproject1.3K views
Improving informed consent forms in clinical research studies by TrialJoin
Improving informed consent forms in clinical research studiesImproving informed consent forms in clinical research studies
Improving informed consent forms in clinical research studies
TrialJoin609 views
Study designs in epidemiology by Bhoj Raj Singh
Study designs in epidemiologyStudy designs in epidemiology
Study designs in epidemiology
Bhoj Raj Singh6.7K views
Types and Designs of Clinical Studies by TrialJoin
Types and Designs of Clinical StudiesTypes and Designs of Clinical Studies
Types and Designs of Clinical Studies
TrialJoin9.1K views
Logistic Regression in Case-Control Study by Satish Gupta
Logistic Regression in Case-Control StudyLogistic Regression in Case-Control Study
Logistic Regression in Case-Control Study
Satish Gupta11K views
Study design in research by Kusum Gaur
Study design in  research Study design in  research
Study design in research
Kusum Gaur66.8K views
ロジスティック回帰分析の書き方 by Sayuri Shimizu
ロジスティック回帰分析の書き方ロジスティック回帰分析の書き方
ロジスティック回帰分析の書き方
Sayuri Shimizu182.6K views

Similar to Case-crossover study

Generalized Additive Model by
Generalized Additive Model Generalized Additive Model
Generalized Additive Model Jinseob Kim
2.5K views45 slides
430 PROJJ by
430 PROJJ430 PROJJ
430 PROJJMichael Smith
137 views13 slides
TestSurvRec manual by
TestSurvRec manualTestSurvRec manual
TestSurvRec manualCarlos M Martínez M
381 views18 slides
50120130405032 by
5012013040503250120130405032
50120130405032IAEME Publication
281 views8 slides
report by
reportreport
reportArthur He
338 views33 slides
CLIM Fall 2017 Course: Statistics for Climate Research, Statistics of Climate... by
CLIM Fall 2017 Course: Statistics for Climate Research, Statistics of Climate...CLIM Fall 2017 Course: Statistics for Climate Research, Statistics of Climate...
CLIM Fall 2017 Course: Statistics for Climate Research, Statistics of Climate...The Statistical and Applied Mathematical Sciences Institute
202 views40 slides

Similar to Case-crossover study(20)

Generalized Additive Model by Jinseob Kim
Generalized Additive Model Generalized Additive Model
Generalized Additive Model
Jinseob Kim2.5K views
Ppt unit-05-mbf103 by Vibha Nayak
Ppt unit-05-mbf103Ppt unit-05-mbf103
Ppt unit-05-mbf103
Vibha Nayak1.1K views
Time and size covariate generalization of growth curves and their extension t... by bimchk
Time and size covariate generalization of growth curves and their extension t...Time and size covariate generalization of growth curves and their extension t...
Time and size covariate generalization of growth curves and their extension t...
bimchk26 views
Auto Correlation Presentation by Irfan Hussain
Auto Correlation PresentationAuto Correlation Presentation
Auto Correlation Presentation
Irfan Hussain19.2K views
Seminar on Robust Regression Methods by Sumon Sdb
Seminar on Robust Regression MethodsSeminar on Robust Regression Methods
Seminar on Robust Regression Methods
Sumon Sdb5.8K views
Applications on Markov Chain by ijtsrd
Applications on Markov ChainApplications on Markov Chain
Applications on Markov Chain
ijtsrd46 views
Survival Analysis Lecture.ppt by habtamu biazin
Survival Analysis Lecture.pptSurvival Analysis Lecture.ppt
Survival Analysis Lecture.ppt
habtamu biazin100 views
Big Data Analytics for Healthcare by Chandan Reddy
Big Data Analytics for HealthcareBig Data Analytics for Healthcare
Big Data Analytics for Healthcare
Chandan Reddy13.6K views
Gestión de la calidad sem 2 by youffre
Gestión de la calidad sem 2Gestión de la calidad sem 2
Gestión de la calidad sem 2
youffre118 views

More from Jinseob Kim

Unsupervised Deep Learning Applied to Breast Density Segmentation and Mammogr... by
Unsupervised Deep Learning Applied to Breast Density Segmentation and Mammogr...Unsupervised Deep Learning Applied to Breast Density Segmentation and Mammogr...
Unsupervised Deep Learning Applied to Breast Density Segmentation and Mammogr...Jinseob Kim
462 views43 slides
Fst, selection index by
Fst, selection indexFst, selection index
Fst, selection indexJinseob Kim
1.1K views65 slides
Why Does Deep and Cheap Learning Work So Well by
Why Does Deep and Cheap Learning Work So WellWhy Does Deep and Cheap Learning Work So Well
Why Does Deep and Cheap Learning Work So WellJinseob Kim
169 views38 slides
괴델(Godel)의 불완전성 정리 증명의 이해. by
괴델(Godel)의 불완전성 정리 증명의 이해.괴델(Godel)의 불완전성 정리 증명의 이해.
괴델(Godel)의 불완전성 정리 증명의 이해.Jinseob Kim
6.1K views5 slides
New Epidemiologic Measures in Multilevel Study: Median Risk Ratio, Median Haz... by
New Epidemiologic Measures in Multilevel Study: Median Risk Ratio, Median Haz...New Epidemiologic Measures in Multilevel Study: Median Risk Ratio, Median Haz...
New Epidemiologic Measures in Multilevel Study: Median Risk Ratio, Median Haz...Jinseob Kim
834 views36 slides
가설검정의 심리학 by
가설검정의 심리학 가설검정의 심리학
가설검정의 심리학 Jinseob Kim
1.3K views8 slides

More from Jinseob Kim(20)

Unsupervised Deep Learning Applied to Breast Density Segmentation and Mammogr... by Jinseob Kim
Unsupervised Deep Learning Applied to Breast Density Segmentation and Mammogr...Unsupervised Deep Learning Applied to Breast Density Segmentation and Mammogr...
Unsupervised Deep Learning Applied to Breast Density Segmentation and Mammogr...
Jinseob Kim462 views
Fst, selection index by Jinseob Kim
Fst, selection indexFst, selection index
Fst, selection index
Jinseob Kim1.1K views
Why Does Deep and Cheap Learning Work So Well by Jinseob Kim
Why Does Deep and Cheap Learning Work So WellWhy Does Deep and Cheap Learning Work So Well
Why Does Deep and Cheap Learning Work So Well
Jinseob Kim169 views
괴델(Godel)의 불완전성 정리 증명의 이해. by Jinseob Kim
괴델(Godel)의 불완전성 정리 증명의 이해.괴델(Godel)의 불완전성 정리 증명의 이해.
괴델(Godel)의 불완전성 정리 증명의 이해.
Jinseob Kim6.1K views
New Epidemiologic Measures in Multilevel Study: Median Risk Ratio, Median Haz... by Jinseob Kim
New Epidemiologic Measures in Multilevel Study: Median Risk Ratio, Median Haz...New Epidemiologic Measures in Multilevel Study: Median Risk Ratio, Median Haz...
New Epidemiologic Measures in Multilevel Study: Median Risk Ratio, Median Haz...
Jinseob Kim834 views
가설검정의 심리학 by Jinseob Kim
가설검정의 심리학 가설검정의 심리학
가설검정의 심리학
Jinseob Kim1.3K views
Win Above Replacement in Sabermetrics by Jinseob Kim
Win Above Replacement in SabermetricsWin Above Replacement in Sabermetrics
Win Above Replacement in Sabermetrics
Jinseob Kim546 views
Regression Basic : MLE by Jinseob Kim
Regression  Basic : MLERegression  Basic : MLE
Regression Basic : MLE
Jinseob Kim1.7K views
iHS calculation in R by Jinseob Kim
iHS calculation in RiHS calculation in R
iHS calculation in R
Jinseob Kim679 views
Selection index population_genetics by Jinseob Kim
Selection index population_geneticsSelection index population_genetics
Selection index population_genetics
Jinseob Kim1.2K views
질병부담계산: Dismod mr gbd2010 by Jinseob Kim
질병부담계산: Dismod mr gbd2010질병부담계산: Dismod mr gbd2010
질병부담계산: Dismod mr gbd2010
Jinseob Kim2K views
Deep Learning by JSKIM (Korean) by Jinseob Kim
Deep Learning by JSKIM (Korean)Deep Learning by JSKIM (Korean)
Deep Learning by JSKIM (Korean)
Jinseob Kim1.7K views
Machine Learning Introduction by Jinseob Kim
Machine Learning IntroductionMachine Learning Introduction
Machine Learning Introduction
Jinseob Kim931 views
Deep learning by JSKIM by Jinseob Kim
Deep learning by JSKIMDeep learning by JSKIM
Deep learning by JSKIM
Jinseob Kim8.4K views
Multilevel study by Jinseob Kim
Multilevel study Multilevel study
Multilevel study
Jinseob Kim1.2K views
GEE & GLMM in GWAS by Jinseob Kim
GEE & GLMM in GWASGEE & GLMM in GWAS
GEE & GLMM in GWAS
Jinseob Kim1.2K views

Recently uploaded

Top 10 Pharma Companies in Mumbai | Medibyte by
Top 10 Pharma Companies in Mumbai | MedibyteTop 10 Pharma Companies in Mumbai | Medibyte
Top 10 Pharma Companies in Mumbai | MedibyteMedibyte Pharma
17 views1 slide
Taking Action to Improve the Patient Journey With Transthyretin Amyloidosis (... by
Taking Action to Improve the Patient Journey With Transthyretin Amyloidosis (...Taking Action to Improve the Patient Journey With Transthyretin Amyloidosis (...
Taking Action to Improve the Patient Journey With Transthyretin Amyloidosis (...PeerVoice
8 views1 slide
1.FGD.pptx by
1.FGD.pptx1.FGD.pptx
1.FGD.pptxDrPradipJana
15 views25 slides
POWDERS.pptx by
POWDERS.pptxPOWDERS.pptx
POWDERS.pptxSUJITHA MARY
19 views42 slides
Torque in orthodontics.docx by
Torque in orthodontics.docxTorque in orthodontics.docx
Torque in orthodontics.docxDr.Mohammed Alruby
11 views17 slides
Top Ayurvedic PCD Companies in India Riding the Wave of Wellness Trends by
Top Ayurvedic PCD Companies in India Riding the Wave of Wellness TrendsTop Ayurvedic PCD Companies in India Riding the Wave of Wellness Trends
Top Ayurvedic PCD Companies in India Riding the Wave of Wellness Trendsmuskansbl01
34 views15 slides

Recently uploaded(20)

Top 10 Pharma Companies in Mumbai | Medibyte by Medibyte Pharma
Top 10 Pharma Companies in Mumbai | MedibyteTop 10 Pharma Companies in Mumbai | Medibyte
Top 10 Pharma Companies in Mumbai | Medibyte
Medibyte Pharma17 views
Taking Action to Improve the Patient Journey With Transthyretin Amyloidosis (... by PeerVoice
Taking Action to Improve the Patient Journey With Transthyretin Amyloidosis (...Taking Action to Improve the Patient Journey With Transthyretin Amyloidosis (...
Taking Action to Improve the Patient Journey With Transthyretin Amyloidosis (...
PeerVoice8 views
Top Ayurvedic PCD Companies in India Riding the Wave of Wellness Trends by muskansbl01
Top Ayurvedic PCD Companies in India Riding the Wave of Wellness TrendsTop Ayurvedic PCD Companies in India Riding the Wave of Wellness Trends
Top Ayurvedic PCD Companies in India Riding the Wave of Wellness Trends
muskansbl0134 views
Depression PPT template by EmanMegahed6
Depression PPT templateDepression PPT template
Depression PPT template
EmanMegahed619 views
VarSeq 2.5.0: VSClinical AMP Workflow from the User Perspective by Golden Helix
VarSeq 2.5.0: VSClinical AMP Workflow from the User PerspectiveVarSeq 2.5.0: VSClinical AMP Workflow from the User Perspective
VarSeq 2.5.0: VSClinical AMP Workflow from the User Perspective
Golden Helix67 views
Myocardial Infarction Nursing.pptx by Asraf Hussain
Myocardial Infarction Nursing.pptxMyocardial Infarction Nursing.pptx
Myocardial Infarction Nursing.pptx
Asraf Hussain13 views
eTEP -RS Dr.TVR.pptx by Varunraju9
eTEP -RS Dr.TVR.pptxeTEP -RS Dr.TVR.pptx
eTEP -RS Dr.TVR.pptx
Varunraju9131 views
STR-324.pdf by phbordeau
STR-324.pdfSTR-324.pdf
STR-324.pdf
phbordeau16 views
Referral-system_April-2023.pdf by manali9054
Referral-system_April-2023.pdfReferral-system_April-2023.pdf
Referral-system_April-2023.pdf
manali905437 views
BUKTI SOSIALISASI KODE ETIK DAN PERATURAN INTERNAL.docx 4,2,C.docx by InkhaRina
BUKTI SOSIALISASI KODE ETIK DAN PERATURAN INTERNAL.docx 4,2,C.docxBUKTI SOSIALISASI KODE ETIK DAN PERATURAN INTERNAL.docx 4,2,C.docx
BUKTI SOSIALISASI KODE ETIK DAN PERATURAN INTERNAL.docx 4,2,C.docx
InkhaRina32 views
The relative risk of cancer from smoking and vaping nicotine by yfzsc5g7nm
The relative risk of cancer from smoking and vaping nicotine The relative risk of cancer from smoking and vaping nicotine
The relative risk of cancer from smoking and vaping nicotine
yfzsc5g7nm176 views
Pharma Franchise For Critical Care Medicine | Saphnix Lifesciences by Saphnix Lifesciences
Pharma Franchise For Critical Care Medicine | Saphnix LifesciencesPharma Franchise For Critical Care Medicine | Saphnix Lifesciences
Pharma Franchise For Critical Care Medicine | Saphnix Lifesciences

Case-crossover study

  • 1. Analysis of Time-series Data Case-crossover Study Jinseob Kim July 17, 2015 Jinseob Kim Analysis of Time-series Data July 17, 2015 1 / 30
  • 2. Contents 1 Concepts Individual data Design 2 Conditional logistic regression Review Basic linear regression Logistic regression Conditional logistic regression 3 Practice Issues In R Jinseob Kim Analysis of Time-series Data July 17, 2015 2 / 30
  • 3. Objective 1 Individual risk VS population risk 2 Case-crossover design의 개념 3 주의사항 4 적용: season package in R Jinseob Kim Analysis of Time-series Data July 17, 2015 3 / 30
  • 4. Concepts Contents 1 Concepts Individual data Design 2 Conditional logistic regression Review Basic linear regression Logistic regression Conditional logistic regression 3 Practice Issues In R Jinseob Kim Analysis of Time-series Data July 17, 2015 4 / 30
  • 5. Concepts Individual data Two approaches to see the relationship between weather and health outcome Population based study Y: # events (daily death counts or # hospital admissions) X: temperature Estimates pop’n risk (% change in daily death counts corresponding to the change in temperature) Individual based study Y : 1 if an event occurs, 0 otherwise X : temperature Estimates individual risk (% change in individual probability of event or odds ratio corresponding to the change in temperature) Jinseob Kim Analysis of Time-series Data July 17, 2015 5 / 30
  • 6. Concepts Individual data Data structure change (Year,week,case) (2006,1,20) : 1 case (Year,week,event) (2006,1,1), (2006,1,1), · · · , (2006,1,1) : 20개 case (2005,53,0), · · · , (2005,53,0), (2006,2,0), · · · , (2006,2,0) : controls.. Jinseob Kim Analysis of Time-series Data July 17, 2015 6 / 30
  • 7. Concepts Design Case + Crossover Case: 환자만 이용. Crossover: 환자의 다른 시점이 대조군. Jinseob Kim Analysis of Time-series Data July 17, 2015 7 / 30
  • 8. Concepts Design If average (air pollution) of controls < average (air pollution) of case days.. We conclude that the event is associated with higher values of air pollution Jinseob Kim Analysis of Time-series Data July 17, 2015 8 / 30
  • 9. Concepts Design Various control day Time trend로 인한 bias 보정 Jinseob Kim Analysis of Time-series Data July 17, 2015 9 / 30
  • 10. Conditional logistic regression Contents 1 Concepts Individual data Design 2 Conditional logistic regression Review Basic linear regression Logistic regression Conditional logistic regression 3 Practice Issues In R Jinseob Kim Analysis of Time-series Data July 17, 2015 10 / 30
  • 11. Conditional logistic regression Review Basic linear regression Remind β estimation in linear regression 1 Ordinary Least Square(OLS): semi-parametric 2 Maximum Likelihood Estimator(MLE): parametric Jinseob Kim Analysis of Time-series Data July 17, 2015 11 / 30
  • 12. Conditional logistic regression Review Basic linear regression Least Square(최소제곱법) 제곱합을 최소로: y 정규성에 대한 가정 필요없다. Figure: OLS Fitting Jinseob Kim Analysis of Time-series Data July 17, 2015 12 / 30
  • 13. Conditional logistic regression Review Basic linear regression Likelihood?? 가능도(likelihood) VS 확률(probability) Discrete: 가능도 = 확률 - 주사위 던져 1나올 확률은 1 6 Continuous: 가능도 != 확률 - 0∼1 에서 숫자 하나 뽑았을 때 0.7일 확률은 0... Jinseob Kim Analysis of Time-series Data July 17, 2015 13 / 30
  • 14. Conditional logistic regression Review Basic linear regression Maximum likelihood estimator(MLE) 최대가능도추정량: 1, · · · , n이 서로 독립이라하자. 1 각각의 가능도 함수를 구한다. 2 가능도를 전부 곱하면 전체 사건의 가능도 (독립이니까) 3 가능도를 최대로 하는 β를 구한다. Jinseob Kim Analysis of Time-series Data July 17, 2015 14 / 30
  • 15. Conditional logistic regression Review Basic linear regression MLE: 최대가능도추정량 데이터가 일어날 가능성을 최대로: y또는 분포가정필요. Jinseob Kim Analysis of Time-series Data July 17, 2015 15 / 30
  • 16. Conditional logistic regression Review Basic linear regression Logistic function: MLE Figure: Fitting Logistic Function Jinseob Kim Analysis of Time-series Data July 17, 2015 16 / 30
  • 17. Conditional logistic regression Review Basic linear regression LRT? Ward? score? Likelihood Ratio Test VS Ward test VS score test 1 통계적 유의성 판단하는 방법들. 2 가능도비교 VS 베타값비교 VS 기울기비교/ Jinseob Kim Analysis of Time-series Data July 17, 2015 17 / 30
  • 18. Conditional logistic regression Review Basic linear regression 비교 Figure: Comparison Jinseob Kim Analysis of Time-series Data July 17, 2015 18 / 30
  • 19. Conditional logistic regression Logistic regression Model Log( pi 1 − pi ) = β0 + β1 · xi1 pi = P(Yi = 1) = exp(β0 + β1 · xi1) 1 + exp(β0 + β1 · xi1) P(Yi = 0) = 1 1 + exp(β0 + β1 · xi1) P(Yi = yi ) = ( exp(β0 + β1 · xi1) 1 + exp(β0 + β1 · xi1) )yi ( 1 1 + exp(β0 + β1 · xi1) )1−yi Jinseob Kim Analysis of Time-series Data July 17, 2015 19 / 30
  • 20. Conditional logistic regression Logistic regression Likelihood Likelihood= n i=1 P(Yi = yi ) = n i=1 ( exp(β0 + β1 · xi1) 1 + exp(β0 + β1 · xi1) )yi ( 1 1 + exp(β0 + β1 · xi1) )1−yi 개인별로 가능도(데이터의 상황이 나올 확률)이 나온다. 그것들을 다 곱하면 Likelihood 이것을 최소로 하는 β를 구하는 것. Case나 Control이나 따로따로 Likelihood를 구한다. Jinseob Kim Analysis of Time-series Data July 17, 2015 20 / 30
  • 21. Conditional logistic regression Conditional logistic regression Conditional likelihood Matched case-control set Case와 그의 control들(1:1 or 1:N)이 한 쌍!! 쌍별로 likelihood가 나온다. 쌍별로 우리의 데이터를 볼 가능성을 계산. 모든 쌍에 대해 다 곱하면 전체 Likelihood Jinseob Kim Analysis of Time-series Data July 17, 2015 21 / 30
  • 22. Conditional logistic regression Conditional logistic regression Definition ith strata(1 ≤ i ≤ N): 1 case(이름:갑), ni control이라 하자. Conditional likelihood of ith strata= Li = P(갑이 case고 나머지가 control|case 1명&control ni 명) Total likelihood= N i=1 Li Jinseob Kim Analysis of Time-series Data July 17, 2015 22 / 30
  • 23. Practice Contents 1 Concepts Individual data Design 2 Conditional logistic regression Review Basic linear regression Logistic regression Conditional logistic regression 3 Practice Issues In R Jinseob Kim Analysis of Time-series Data July 17, 2015 23 / 30
  • 24. Practice Issues Control 확실하냐? 앞 뒤 7일, 14일 등.. control이 확실?? Exposure → Disease가 짧아야.. Exposure 가 축적되지 않아야.. 급성질환, 폭로의 일시적 효과 (ex:폭염과 사망) Jinseob Kim Analysis of Time-series Data July 17, 2015 24 / 30
  • 25. Practice In R season package > library(season) > data(CVDdaily) # cardiovascular disease data > CVDdaily=subset(CVDdaily,date<=as.Date('1987-12-31')) # subset for exampl > head(CVDdaily) date cvd dow tmpd o3mean o3tmean Mon Tue Wed Thu Fri Sat 3 1987-01-01 55 Thursday 54.50 -16.0073 -15.89619 0 0 0 1 0 0 5 1987-01-02 73 Friday 58.50 -11.6595 -11.19102 0 0 0 0 1 0 9 1987-01-03 64 Saturday 55.25 -10.3241 -10.51787 0 0 0 0 0 1 12 1987-01-04 57 Sunday 54.75 -18.6471 -18.27014 0 0 0 0 0 0 15 1987-01-05 56 Monday 54.50 -17.5291 -17.13201 1 0 0 0 0 0 18 1987-01-06 65 Tuesday 49.75 -22.7846 -22.74711 0 1 0 0 0 0 month winter spring summer autumn 3 1 1 0 0 0 5 1 1 0 0 0 9 1 1 0 0 0 12 1 1 0 0 0 15 1 1 0 0 0 18 1 1 0 0 0 Jinseob Kim Analysis of Time-series Data July 17, 2015 25 / 30
  • 26. Practice In R casecross() > # Effect of ozone on CVD death > model1 = casecross(cvd ~ o3mean+tmpd+Mon+Tue+Wed+Thu+Fri+Sat, data=CVDdaily) > # match on day of the week > model2 = casecross(cvd ~ o3mean+tmpd,matchdow=TRUE, data=CVDdaily) > # match on temperature to within a degree > model3 = casecross(cvd ~ o3mean+Mon+Tue+Wed+Thu+Fri+Sat, data=CVDdaily, matchconf='tmpd', confrange=1) Jinseob Kim Analysis of Time-series Data July 17, 2015 26 / 30
  • 27. Practice In R casecross(formula = cvd ~ o3mean + tmpd + Mon + Tue + Wed + Thu + Fri + Sat, data = CVDdaily, exclusion = 2, stratalength = 28, matchdow = FALSE, usefinalwindow = FALSE, matchconf = "", confrange = 0, stratamonth = FALSE) Time-stratified case-crossover with a stratum length of 28 days Total number of cases 17502 Number of case days with available control days 364 Average number of control days per case day 23.2 Parameter Estimates: coef exp(coef) se(coef) z Pr(>|z|) o3mean -0.002882613 0.9971215 0.001128975 -2.55330077 0.01067073 tmpd 0.001461400 1.0014625 0.001981047 0.73769030 0.46070267 Mon 0.042733425 1.0436596 0.028942815 1.47647783 0.13981566 Tue 0.057910712 1.0596204 0.028772745 2.01269332 0.04414690 Wed -0.010008025 0.9900419 0.029171937 -0.34307029 0.73154558 Thu -0.016790296 0.9833499 0.029455877 -0.57001513 0.56866744 Fri 0.027247952 1.0276226 0.029173235 0.93400517 0.35030123 Sat 0.001855841 1.0018576 0.028900116 0.06421568 0.94879849 Jinseob Kim Analysis of Time-series Data July 17, 2015 27 / 30
  • 28. Practice In R casecross(formula = cvd ~ o3mean + tmpd, data = CVDdaily, matchdow = TRUE, exclusion = 2, stratalength = 28, usefinalwindow = FALSE, matchconf = "", confrange = 0, stratamonth = FALSE) Time-stratified case-crossover with a stratum length of 28 days Matched on day of the week Total number of cases 17502 Number of case days with available control days 364 Average number of control days per case day 3 Parameter Estimates: coef exp(coef) se(coef) z Pr(>|z|) o3mean -0.0030752572 0.9969295 0.001188540 -2.5874238 0.009669658 tmpd -0.0004095116 0.9995906 0.002131744 -0.1921017 0.847662557 Jinseob Kim Analysis of Time-series Data July 17, 2015 28 / 30
  • 29. Practice In R casecross(formula = cvd ~ o3mean + Mon + Tue + Wed + Thu + Fri + Sat, data = CVDdaily, matchconf = "tmpd", confrange = 1, exclusion = 2, stratalength = 28, matchdow = FALSE, usefinalwindow = FA stratamonth = FALSE) Time-stratified case-crossover with a stratum length of 28 days Matched on tmpd plus/minus 1 Total number of cases 15180 Number of case days with available control days 318 Average number of control days per case day 4.9 Parameter Estimates: coef exp(coef) se(coef) z Pr(>|z|) o3mean -0.003238583 0.9967667 0.00131839 -2.4564691 1.403099e-02 Mon 0.182058170 1.1996840 0.03577818 5.0885255 3.608582e-07 Tue 0.144181049 1.1550932 0.03563272 4.0463108 5.203115e-05 Wed 0.099443480 1.1045560 0.03554924 2.7973451 5.152447e-03 Thu 0.088518237 1.0925542 0.03459482 2.5587140 1.050601e-02 Fri 0.108107305 1.1141673 0.03437323 3.1451022 1.660288e-03 Sat 0.023660066 1.0239422 0.03525152 0.6711786 5.021068e-01 Jinseob Kim Analysis of Time-series Data July 17, 2015 29 / 30
  • 30. Practice In R END Email : secondmath85@gmail.com Jinseob Kim Analysis of Time-series Data July 17, 2015 30 / 30