Announcement

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

  • Extracting observations which have similar characteristics to specified values

    I have a cross-sectional dataset (n=200 households). I want to extract householdswhich very closely fit the criteria: Householdsize=4, Landsize=10 and beans=1, where beans is a dummy variable taking 1 for a household that grew beans. I do not intend to run any regression at this stage, just to find which households are close (not only exactly) to this. Kindly assist.

  • #2
    Then you have to define what "close" means. Thereafter, the -inrange()- function may prove useful, e.g.,

    Code:
    gen wanted=inrange(Householdsize,3,5)&inrange(Landsize, 9, 11)&beans
    browse if wanted
    Last edited by Andrew Musau; 17 Aug 2018, 06:27.

    Comment

    Working...
    X