
09-01-2015
doubled30602
Calcite | Level 5
Member since
10-01-2013
- 7 Posts
- 0 Likes Given
- 0 Solutions
- 0 Likes Received
-
Latest posts by doubled30602
Subject Views Posted 2671 10-08-2013 08:19 PM 2671 10-08-2013 09:04 AM 2671 10-08-2013 08:30 AM 2671 10-07-2013 07:09 PM 2671 10-07-2013 06:23 PM 2889 10-07-2013 05:54 PM -
Activity Feed for doubled30602
- Posted Re: Repeat sales index on SAS Programming. 10-08-2013 08:19 PM
- Posted Re: Repeat sales index on SAS Programming. 10-08-2013 09:04 AM
- Posted Re: Repeat sales index on SAS Programming. 10-08-2013 08:30 AM
- Posted Re: Repeat sales index on SAS Programming. 10-07-2013 07:09 PM
- Posted Re: Repeat sales index on SAS Programming. 10-07-2013 06:23 PM
- Posted Repeat sales index on SAS Programming. 10-07-2013 05:54 PM
10-08-2013
09:04 AM
On further inspection, the results are not quite what I'm looking for and this is probably because I was unclear previously. Records 21, 22, and 23 in the sample file illustrate the issue. The sales occur 02/19/2004, 05/17/207, and 03/02/2010. I need 2 rows from these 3 observations. Using Patrick's syntax, the resulting table needs to have: first row has -1 in quarter_2004Q1, 1 in quarter_2007Q2, and 0 otherwise. The second row has -1 in quarter_2007Q2, 1 in quarter_2010Q1, and 0 otherwise. The current code has in the first row: -1 in quarter_2004Q1 for that observation (record 21) and 0 otherwise. Second row still has -1 in quarter_2004Q1 and then 1 in quarter_2007Q2 and 0 otherwise /* this works and I could just remove the first instance, except */ Third row still has -1 in quarter_2004Q1, 1 in quarter_2007Q2 and now 1 in quarter_2010Q1 (0 otherwise). I will be regressing the holding period return (log differences) on each row and one row can only have one occurrence of -1 and 1. Thanks! Darren
... View more
10-08-2013
08:30 AM
Thank you Patrick! Quite impressive and I don't think I would have gotten to this point any time soon. One quick question, is there a good method to compute the natural log price difference between the first and second sales? Thanks again, Darren
... View more
10-07-2013
07:09 PM
The 48 new columns are the quarter/year from the 3rd quarter of 2002 to the 2nd quarter of 2012. The panel is going to be largely zeros. When the home sells the first time, the value in that row is "-1" and it must populate in the correct quarter/year column. On the same row, a value of "1" must be populated in the correct quarter and year column for the subsequent sale. I know that address is not usable but for illustration purposes, say I can use address as the key Address 1 Sold 02/16/2003: -1 in Q1_2003 and 0 in other 47 columns. Address 1 Sold 05/17/2006: in the same row as the first sale, retain -1 in Q1_2003, insert 1 in Q2_2006, and 0 in other 46 columns. This is relatively straightforward and can be accomplished with first.address and last.address and brute force copy and paste 48 if-then statements, lag them into 48 new columns, (lag log(price) at the same time), remove if lag(address) ne address and then use select-when to insert "1" using 48 new statements for the second occurrence. Some of this may be accomplished with a 2-dimensional array indexed as do year = 2002 to 2013; do quarter = 1 to 4; I think the main issue with these methods is that they will do not account for a second pair for the same property (i.e., need to know the 2nd of the pair is also the 1st of the next pair). Continuing the example: Address 1 Sold 10/24/2010: on a new row, -1 in Q2_2006, 1 in Q4_2010, and 0 in other 46 columns Address 2 Sold mm/dd/yyyy: recognize this as a new home and repeat above procedure Thanks! Darren
... View more
10-07-2013
06:23 PM
The address is not actually my key. The compound key is age, beds, baths, county, and reetnumber and it works. I only include the address for presentation. The 48 new columns come from the unique quarter (4) for 12 years
... View more
10-07-2013
05:54 PM
Greetings all. I have become completely perplexed in trying to code a database of about 150,000 house sales into a repeat sales index. Each row has address, county, home age, number of beds and baths, and sold date. I have distilled the dataset into transaction pairs and need to create one line for each pair. For some homes, there are more than 1 pair e.g., a home sold in 2003, 2005, and 2009. The first pair is 2003 and 2005 and the second is 2005 and 2009. The data begins in the 3rd quarter of 2002 and ends with the 2nd quarter of 2013. Attached is a sample SAS dataset. The final dataset should be, in each row: -1 in the column for the quarter and year the home first sold, 1 in the quarter/year column for the second sale, and 0 otherwise. I can use address (actually a compound key) as a unique identifier of the pairs. One other slight consideration is that for each pair I need to compute the natural log difference between selling price, which should be straightforward as I can subtract the lagged log(price). There is no need to retain any of the housing information in the final dataset b/c I will regress the price difference on the 48 new columns/variables. Problems I have experienced include using an array but not each line will be used; lags but then brute force of 48 new columns twice; first.address does not pick up the second pair when a home sells more than twice; and I thought of SQL but it is not my strength. Thank you in advance for any help!! Darren
... View more