Stata 15 help for _get_offopt


[P] _get_offopt -- Parsing tool for getting offset option specification


Standard offset variable syntax:

_get_offopt [varname] [, noconfirm]

Exposure variable syntax (also known as log offset):

_get_offopt [ln(varname)] [, noconfirm]


_get_offopt is a programming tool that helps identify which option was used to specify an offset in an estimation command, based on what is typically put in e(offset). Basically, _get_offopt looks at the supplied argument and returns the associated option in s(offopt). varname is returned in s(offvar).


noconfirm prevents _get_offopt from confirming that varname exists.


. sysuse auto, clear (1978 Automobile Data)

. quietly poisson mpg turn trunk, exposure(gear) . di "`e(offset)'" ln(gear_ratio) . _get_offopt `e(offset)' . sreturn list

macros: s(offvar) : "gear_ratio" s(offopt) : "exposure(gear_ratio)"

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index