PROC MCMC - SAS · PDF filePROC MCMC Masud Rana,1 Rhonda Bryce,1 J. A. Dosman,2 and Punam...

26
PROC MCMC Masud Rana, 1 Rhonda Bryce, 1 J. A. Dosman, 2 and Punam Pahwa 1,3 1 Clinical Research Support Unit, College of Medicine 2 Department of Medicine 3 Department of Community Health & Epidemiology University of Saskatchewan Saskatoon, Saskatchewan, S7N 5E5, Canada Saskatoon SAS User Group (SUCCESS) May 14, 2013 Masud Rana (CRSU) PROC MCMC May 14, 2013 1 / 26

Transcript of PROC MCMC - SAS · PDF filePROC MCMC Masud Rana,1 Rhonda Bryce,1 J. A. Dosman,2 and Punam...

PROC MCMC

Masud Rana,1 Rhonda Bryce,1 J. A. Dosman,2 and Punam Pahwa1,3

1Clinical Research Support Unit, College of Medicine2Department of Medicine

3Department of Community Health & EpidemiologyUniversity of Saskatchewan

Saskatoon, Saskatchewan, S7N 5E5, Canada

Saskatoon SAS User Group (SUCCESS)

May 14, 2013

Masud Rana (CRSU) PROC MCMC May 14, 2013 1 / 26

Outline

1 Bayesian Inference

2 Data

3 Example

Masud Rana (CRSU) PROC MCMC May 14, 2013 2 / 26

Bayesian Inference

Bayesian Inference

Masud Rana (CRSU) PROC MCMC May 14, 2013 3 / 26

Bayesian Inference

Bayesian Inference (Cont.)

Masud Rana (CRSU) PROC MCMC May 14, 2013 4 / 26

Bayesian Inference

Bayesian Inference (Cont.)

Masud Rana (CRSU) PROC MCMC May 14, 2013 5 / 26

Data

Data

F Forced Expiratory Volume in one second (FEV1) is the volume of airthat can forcibly be blown out in one second, after full inspiration.

F FEV1 is a frequently used index for assessing lung function.

F FEV1 is assumed to be correlated with sex, age, height, weight andsmoking habits.

F In 1978 Labour Canada started the Grain Dust Medical SurveillanceProgram to assess the prevalence of respiratory system among grainworkers and ended in 1993 over five different cycles across Canada.

F Data on 5702 personnel were collected in Cycle 1 of the survey.

Masud Rana (CRSU) PROC MCMC May 14, 2013 6 / 26

Example

Model 1

CURRFEV 1i = β0 + β1 ∗ CURREXPi + β2 ∗ Smokeri + β3 ∗ BASEHTi+

β4 ∗ CURRWTi + β5 ∗ CURRAGEi + εi (1)

where εi ∼ N(0, σ2), i = 1, 2, ......, n.

Prior Distribution

βj ∼ N(0,VAR = 10000), j = 0, 1, ..., 5

σ2 ∼ IGAMMA(SHAPE = 0.01,SCALE = 0.01) (2)

Likelihood Function

CURRFEV 1i ∼ N(β0 + β1 ∗ CURREXPi + β2 ∗ Smokeri + β3 ∗ BASEHTi+

β4 ∗ CURRWTi + β5 ∗ CURRAGEi , σ2) (3)

Masud Rana (CRSU) PROC MCMC May 14, 2013 7 / 26

Example

SAS Code for Model 1

Masud Rana (CRSU) PROC MCMC May 14, 2013 8 / 26

Example

Diagnostic Plots for β0

Masud Rana (CRSU) PROC MCMC May 14, 2013 9 / 26

Example

Diagnostic Plots for β1

Masud Rana (CRSU) PROC MCMC May 14, 2013 10 / 26

Example

Diagnostic Plots for β2

Masud Rana (CRSU) PROC MCMC May 14, 2013 11 / 26

Example

Diagnostic Plots for β3

Masud Rana (CRSU) PROC MCMC May 14, 2013 12 / 26

Example

Diagnostic Plots for β4

Masud Rana (CRSU) PROC MCMC May 14, 2013 13 / 26

Example

Diagnostic Plots for β5

Masud Rana (CRSU) PROC MCMC May 14, 2013 14 / 26

Example

Diagnostic Plots for σ2

Masud Rana (CRSU) PROC MCMC May 14, 2013 15 / 26

Example

Random Effects Model

♣ Correlation coefficient between Age and Experience is 0.77.

♣ Regression coefficients are assumed to vary across different regions.

♣ Regions are:

♦ Atlantic: East of Quebec♦ St. Lawrence: Quebec only♦ Great Lakes: Ontario (East of Thunder Bay)♦ Central: Ontario (Thunder Bay and westward), Manitoba and

Saskatchewan♦ Mountain: Alberta, British Columbia, Yukon and North West

Territories

Model 2

CURRFEV 1ij = α0i + α1i ∗ CURRAGEij + α2i ∗ CURREXPij + εij (4)

where εij ∼ N(0, σ2), i = 1, 2, ......, 5, j = 1, 2, .., ni .

Masud Rana (CRSU) PROC MCMC May 14, 2013 16 / 26

Example

Prior Distribution

θi =

α0i

α1i

α2i

∼ MVN

θc =

α0c

α1c

α2c

,Σc

θc ∼ MVN

µ0 =

000

,Σ0 =

1000 0 00 1000 00 0 1000

Σc ∼ IWISHART

3,

1 0 00 1 00 0 1

σ2 ∼ GAMMA (SHAPE = 3,SCALE = 2)

(5)

Likelihood Function

CURRFEV 1ij ∼ N(α0i + α1i ∗ CURRAGEij + α2i ∗ CURREXPij , σ2) (6)

Masud Rana (CRSU) PROC MCMC May 14, 2013 17 / 26

Example

SAS Code for Model 2

Masud Rana (CRSU) PROC MCMC May 14, 2013 18 / 26

Example

Diagnostic Plots for Region=Atlantic

Masud Rana (CRSU) PROC MCMC May 14, 2013 19 / 26

Example

Diagnostic Plots for Region=St. Lawrence

Masud Rana (CRSU) PROC MCMC May 14, 2013 20 / 26

Example

Diagnostic Plots for Region=Great Lakes

Masud Rana (CRSU) PROC MCMC May 14, 2013 21 / 26

Example

Diagnostic Plots for Region=Central

Masud Rana (CRSU) PROC MCMC May 14, 2013 22 / 26

Example

Diagnostic Plots for Region=Mountain

Masud Rana (CRSU) PROC MCMC May 14, 2013 23 / 26

Example

Diagnostic Plots for σ2

Masud Rana (CRSU) PROC MCMC May 14, 2013 24 / 26

Example

References

Thomas NicholsBayesian Inference.http : //www .fil .ion.ucl .ac .uk/spm/course/slides10−vancouver/08 Bayes.pdf .

Fang ChenThe RANDOM Statement and More: Moving On with PROC MCMCin Proceedings of the SAS Global Forum 2011 Conference.Cary, NC: SAS Institute Inc.

SAS Institute Inc. 2011SAS/STAT 9.3 Users Guide.Cary, NC: SAS Institute Inc.

Masud Rana (CRSU) PROC MCMC May 14, 2013 25 / 26

Example

Masud Rana (CRSU) PROC MCMC May 14, 2013 26 / 26