.- help for ^findobs^ STB-28: ip10 .- Finding an observation number ----------------------------- ^findobs^ [ ^if^ exp ] [ ^in^ range ] [^,^ ^i^nstance^(^#^)^ ] Description ----------- ^findobs^ displays the observation number of the ^#^-th observation that satisfies specified ^if^ and ^in^ conditions. By default, ^findobs^ displays the number of the first observation that satisfies the conditions. The observation number also is stored in the global macro ^S_1^. If the Stata time series library is installed in the ado-path, ^findobs^ will detect it and display the date of the target observation along with its observation number. If the occurrence cannot be found or results in an impossible observation number, ^findobs^ displays nothing and stores a missing value in ^S_1^. Option ------ ^i^nstance^(^#^)^ specifies which occurrence is the target observation. For example, ^instance(3)^ indicates the observation number of the third occurrence that satisifies the conditions should be displayed and stored. Negative numbers indicate that occurrences should be counted starting from the end of the data set. ^instance(0)^ displays the number of the observation preceding the first occurrence. ^instance(-0)^ displays the number of the observation following the final occurrence. Example ------- . ^findobs if income>100000, instance(3)^ Author ------ Sean Becketti Stata Technical Bulletin stb@@stata.com Also see -------- STB: STB-28 ip10, STB-24 sts7.6 On-line: help for @ts@ (if installed)