version 11 *!!!!!!!!!!!!!!! Not debugged as of Nov 2009. Check function of margins command *!!!!!!!!!!!!!! Note that margins replaces the adjust command log using adjust.log, replace * adjust.log * * Evaluate the adjust postestimation command after hazard regression * and logistic regression models * * The adjust command tabulates the linear predictor, or the exponentiated linear * predictor evaluated at one or more catigorical variables. It can be used to * tabulate hazard ratios with their confidence intervals over one or two categorical * variables, either with or without interaction terms. An example follows. * use "C:\WDDtext\2.20.Framingham.dta", clear gen hypertension = dbp > 90 stset followup, failure(chdfate) gen men = sex==1 stcox men##hypertension, nohr lincom 1.men+ 1.hypertens +1.men#1.hypertens * * The identical linear predictors given above can be calculated by the adjust * command as follows. * margins men##hypertension * * We now calculate the related hazard ratios from the same model as above * stcox men##hypertension lincom 1.men+ 1.hypertens + 1.men#1.hypertens, hr * * Now repeat these calculations using the adjust command * margins men##hypertension // exp ci label(hazard ratio) * * Unfortunately this approach does not work in general with logistic * regression. This is because in logistic regression the linear predictor * rarely equals the log of an interesting odds ratio. For example * use "C:\WDDtext\5.5.EsophagealCa.dta", clear gen smoke = tobacco >2 logit cancer heavy##smoke [freq=patients] lincom _cons + 1.heavy lincom _cons + 1.smoke lincom _cons +1.heavy+ 1.smoke+ 1.heavy#1.smoke * * The preceding results are replicated by the following adjust command. * Alas, they are not interesting log odds ratios. * margins heavy##smoke log close