*! version 3.0.0 01/13/94 updated 14-Feb-94. STB-18: sg22 program define _glmmapl /* {tocode | fromcode ..} ... */ version 3.1 if "`1'"=="fromcode" { di in red "_glmmapl fromcode not yet implemented" exit 9000 } local ulink = lower("`2'") local upow "`3'" if "`4'"!="" { di in red "link() invalid" exit 198 } local l = length("`ulink'") global S_1 "pow" /* returned link */ global S_2 . /* returned power if link is pow */ if "`ulink'"=="" { global S_1 } else if "`ulink'"==substr("identity",1,`l') { global S_2 1 } else if "`ulink'"=="log" { global S_2 0 } else if "`ulink'"==substr("power",1,max(`l',3)) { capture confirm number `upow' if _rc { di in red "invalid # in link(power #)" exit 198 } global S_2 `upow' local upow } else if "`ulink'"==substr("opower",1,max(`l',3)) { capture confirm number `upow' if _rc { di in red "invalid # in link(opower #)" exit 198 } if `upow'==0 { global S_1 "l" } else { global S_1 "opo" /* short for odds-power */ global S_2 `upow' } local upow } else if "`ulink'"==substr("logit",1,`l') { global S_1 "l" } else if "`ulink'"==substr("probit",1,`l') { global S_1 "p" } else if "`ulink'"==substr("cloglog",1,`l') { global S_1 "c" } else if "`ulink'"==substr("nbinomial",1,`l') { global S_1 "nb" } else { di in red "unknown link() `ulink'" exit 198 } if "`upow'"!="" { di in red "unknown 2nd argument in link(`ulink' `upow')" exit 198 } end exit Map user-specified link to internal link code. (Capitalization indicates minimum abbreviations.) mapped to Allowed (link) (pow) ----------------------------------------- Identity pow 1 LOG pow 0 Logit l Probit p Cloglog c POWer # pow # OPOwer # opo # (nothing)