DATA Step, Macro, Functions and more

Single record from multiple observations

Reply
Occasional Contributor
Posts: 7

Single record from multiple observations

Greetings.  I would greatly appreciate assistance with creating a single record for each real estate transaction within the attached file.  Each transaction has multiple records for each buyer(s) and seller(s).  The SEQ_KEY ID combination is unique for individual transactions.  ROLE=1 is seller(s) and ROLE=2 is buyer(s).  I need to keep track of when a corporation, estate, gov, or agent is the buyer or seller. I have already coded these variables as corpbuy=1 for corporate buyer and 0 otherwise for subsequent regression analysis.  Each transaction can have more than one type.  The biggest challenge for me is when there are many buyers/sellers for one transaction, like SEQ=8 in records 109-116. I would like to do some sort of dynamic lagging but lack the skill.  The largest SEQ is 16 (in the full file not the one attached).  When there are multiple buyers or sellers, I would like to retain at least SEQ=2 of DISPLAYNAME for each so that I can subsequently check for non-arms-length transactions by finding exactly the same last names across ROLE.  If it is not too much, I would like to retain any instance of NAME being populated as this is motivation for my study - NAME is realtors that buy and sell property for themselves and whether they pay different prices.

Thank you for your help!

D. Hayunga

Attachment
Ask a Question
Discussion stats
  • 0 replies
  • 187 views
  • 0 likes
  • 1 in conversation