Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Tracking unmerged observations from USING dataset with rangejoin command

    rangejoin age -2 +2 using `tempfile', by(id)

    I want to find out the unmerged observations from tempfile that are outside the range. How do I find this? Additionally, I ensured that there are no missing values in age and id variables. So, having age_U missing means the unmerged observations from baseline right? For these observations, all other variables from using dataset is missing in the merged dataset.
    Last edited by Mehedi Hassan; 18 Feb 2025, 10:12.

  • #2
    So, having age_U means unmerged observations from baseline right?
    Not sure what you mean by "baseline" here. And I think you have it backwards.

    Anyway, given that there are no missing values in the age and id variables in either of the two data sets, if age_U is missing, then that observation in the data set that started out in memory (let's call it the master data set, as we would with -merge- or -joinby-) found no match in `tempfile'. Moreover, all of the *_U variables will have missing values in those observations.

    You cannot, immediately following -rangejoin- identify observations in `tempfile' (the using data set) that found no match: these observations just don't appear anywhere in the result. If you need to identify them, you would need to combine the result of -rangejoin- with `tempfile' using either -merge- (assuming that can be done 1:1, 1:m, or m:1 with id as the -merge- key) or -joinby-, and then pick out the observations with the appropriate value of the _merge variable.

    Comment

    Working...
    X