Hello, I am studying a dataset of commercial real estate transactions. Some transaction span across multiple observations/addresses but represent one unique transaction. In the example below, all 11 parcels were bought for $25M.
If I were to sum the portfolioprice without a filter, it would not be accurate, so I created a variable called "uniquetransaction" that is a unique identifier for each transaction.
It allows me to do something like "sum portfolioprice if uniquetransaction==1" and I would get an accurate result.
Here is how I obtained uniquetransaction:
bysort trueowner lastsaledate portfolioprice (propertytype): gen uniquetransaction = _n
replace uniquetransaction = . if uniquetransaction!=1
However, now I run into a 2nd issue. Some transactions have multiple property types, like the one below.
I would like to create the "uniquepropertytransaction" variable, that identifies the first occurence of a property type within each transaction, but I can't figure out how.
This is so I could complete commands such as "sum portfolioprice if propertytype=="Land" & uniquepropertytransaction==1
Please note the transactions are grouped by trueowner, lastsaledate and portfolioprice and could be sorted based on them folio number or address.
Could you please help me? Thank you.
If I were to sum the portfolioprice without a filter, it would not be accurate, so I created a variable called "uniquetransaction" that is a unique identifier for each transaction.
It allows me to do something like "sum portfolioprice if uniquetransaction==1" and I would get an accurate result.
Here is how I obtained uniquetransaction:
bysort trueowner lastsaledate portfolioprice (propertytype): gen uniquetransaction = _n
replace uniquetransaction = . if uniquetransaction!=1
However, now I run into a 2nd issue. Some transactions have multiple property types, like the one below.
I would like to create the "uniquepropertytransaction" variable, that identifies the first occurence of a property type within each transaction, but I can't figure out how.
This is so I could complete commands such as "sum portfolioprice if propertytype=="Land" & uniquepropertytransaction==1
Please note the transactions are grouped by trueowner, lastsaledate and portfolioprice and could be sorted based on them folio number or address.
Could you please help me? Thank you.
uniquepropertytransaction | uniquetransaction | propertytype | folio | address | trueowner | lastsaledate | portfolioprice |
1 | 1 | Office | 3136491240853 | 240 NW 29 ST | AVENTURA MIXED USE PROPERTY LLC | 2/10/22 | $25,384,800 |
1 | MultiFamily | 3136491240855 | 242 NW 29 ST | AVENTURA MIXED USE PROPERTY LLC | 2/10/22 | $25,384,800 | |
MultiFamily | 3136491240857 | 244 NW 29 ST | AVENTURA MIXED USE PROPERTY LLC | 2/10/22 | $25,384,800 | ||
MultiFamily | 3136491240859 | 246 NW 29 ST | AVENTURA MIXED USE PROPERTY LLC | 2/10/22 | $25,384,800 | ||
1 | Land | 3136491240861 | 248 NW 29 ST | AVENTURA MIXED USE PROPERTY LLC | 2/10/22 | $25,384,800 | |
Land | 3136491240863 | 250 NW 29 ST | AVENTURA MIXED USE PROPERTY LLC | 2/10/22 | $25,384,800 | ||
Land | 3136491240865 | 252 NW 29 ST | AVENTURA MIXED USE PROPERTY LLC | 2/10/22 | $25,384,800 | ||
Land | 3136491240867 | 254 NW 29 ST | AVENTURA MIXED USE PROPERTY LLC | 2/10/22 | $25,384,800 | ||
Land | 3136491240869 | 256 NW 29 ST | AVENTURA MIXED USE PROPERTY LLC | 2/10/22 | $25,384,800 | ||
Land | 3136491240871 | 258 NW 29 ST | AVENTURA MIXED USE PROPERTY LLC | 2/10/22 | $25,384,800 | ||
Land | 3136491240873 | 260 NW 29 ST | AVENTURA MIXED USE PROPERTY LLC | 2/10/22 | $25,384,800 |
Comment