Listings

Listing 5.1    GMBO/PECAN Commands for the Kyphosis Examples-Logistic Regression

! GMBO/PECAN examples 5.1 to 5.6

NAMES age start number kyphosis @

  INPUT ../exdata/kyphosis.dat @

TRAN age = age/12 @

QUANTILES age @

TRAN  acat = 1 + (age >= 2)  + (age >= 7)  + (age >= 11)@

LEVELS acat @

MEAN kyphosis ; by acat @

CASES kyphosis

! A null model

FIT @

! Score tests for various effects

FIT age=0 age*age=0 number=0 start=0 @

NULL

FIT + start number @

LRT

PARAMETER 3-4:0 @

FIT @

LRT

NULL

PARAMETER 2:0 5:0 @

FIT @ LRT

NULL

FIT +start*start @ LRT

! Request for automatic computation of model diagnostics

FV @

HAT @

RESI HAT @

! Diagnostic plots

PLOT %RS %FV @

PLOT %HAT %ORD @

PLOT %HAT number @

! Exclusion of a potential outlier

SELECT number < 14 @

FIT @

NULL

FIT -number @ LRT

 

 

Listing 5.2    GMBO/PECAN commands for the Smoking Examples-Using Alternate Links

! Examples 5.7 to 5.10

! Test the LINK command

NAMES x n @

INPUT ../exdata/sholom.dat @

! Create categorical index variables

TRAN alcohol = 4 - GL(3,1) ; socio = GL(3,6) ; smoker = GL(2,3) @

LEVELS alcohol socio smoker @

CASES x

N n

! Simple models for the unadjusted odds

LINEAR 0 %CON:1 @

FIT -%CON @

FITOPT LINEAR 0 @

LOGLINEAR 0 - %CON @

FIT %CON:1 @

! Odds models with effect covariates

FIT + alcohol @

!  Generalized odds models

LINEAR 1 alcohol @

LINEAR 0  %CON:0.1 @

PARAMETER 2=0 @

FIT @

! The complementary log-log link

LINK COMP @

FIT alcohol @

FIT -%CON @

! The identity link

LINK ID @

FIT %CON:0.1 @

FIT alcohol @

BOUNDS 3 @

BOUNDS 4 @

NULL @

PARAMETER 4=0 2=0 @

FIT @

LRT

 

 

Listing 5.3    Analysis of Matched Case-Control Data with PECAN, 1:1 Matching

!Example 5.11 Matched Case-Control Data with 1:1 Matching

! Describe input variables and read the data

NAMES setno cases gall hyp ob est cdose dura non age @

INPUT ../exdata/leimod.dat@

! Recode missing values

MISS cdose 9; ob 9; dura 99 @

! Define the modified age variable (subject age in each case-control set) and

! compute additional covariates

CONS #cage = -1 @

TRAN IF cases == 1 THEN

   #cage = age ;

 ENDIF ;

 cage = #cage ;

 categ = 1 + (cage >= 65) + (cage >= 75) ;

 cage70 = cage - 70 ; agegp = (age >= 70) ;

 cest = (cdose > 0) ;

 caseno = GL(5,1) ; pairs = caseno <= 2 ;

     @

! Save edited data for use in subsequent analyses

     SAVE  @

! Limit analyses to 1:1 matching for this example

SELECT pairs == 1 @

! Explicit specification of key variables (not really necessary here)

CASES cases

STRATA setno @

COND @ ! Instruct program to use conditional likelihood

!Null and estrogen effect models with score and LR tests

FIT @

NULL

CONS #basdv = #_dv @

SCORE + est @

FIT @

LRT

CI @

! Tests for gallbladder disease and hypertension effects

NOMODEL

FIT @

SCORE + gall @

FIT @ LRT

NULL

SCORE +hyp @

FIT @

LRT NULL

CONS #dvdif = #basdv - #_dv @

CHISQ 2 #dvdif @

FIT + gall*hyp @ LRT

! Categorical dose response model (implicit handling of missing values)

LEVELS cdose @

FIT cdose @

 

 

Listing 5.4    Analysis of Matched Case-Control Data with PECAN, 1:M Matching

!Example 5.12 Matched Case-Control Data with 1:M Matching

! Describe input variables and read the data

NAMES setno cases gall hyp ob est cdose dura non age @

INPUT leimod.dat@

! Recode missing values

MISS cdose 9; ob 9; dura 99; @

! Define the modified age variable (subject age in each case-control set) and

! compute additional covariates

CONS #cage = -1 @

TRAN IF cases == 1 THEN

    #cage = age ;

  ENDIF ;

  cage = #cage ;

  categ = 1 + (cage >= 65) + (cage >= 75) ;

  cage70 = cage - 70 ; agegp = (age >= 70) ;

  cest = (cdose > 0) ;

  caseno = GL(5,1); pairs = caseno <= 2;

@

! Save edited data for use in subsequent analyses

SAVE @

! Explicit specification of key variables (not really necessary here)

CASES cases

STRATA setno@

COND @ ! Instruct program to use conditional likelihood

FIT @ NULL

SCORE +est @

FIT @ LRT

! Alternative forms for estrogen effect model

NOMODEL

LINE 1 est @

FIT @

NOMODEL@

FIT @

FIT cest @

! Add listwise missing value checking for cest

CHECK cest @

FIT @

FIT cest @