Identifies repeat sales from a data set with observations on sale price, time of sale, and a property id.
Returns a data frame in which each observation is a repeat sales pair.
Usage
repsaledata(price,timevar,id)
Arguments
price
Variable representing sale price
timevar
Variable representing date of sale
id
Property id
Details
The input to repsaledata is meant to be a set of variables from a standard hedonic data set –
the sale price, date, and an id number for the individual property. The function identifies the subset of properties that sold
at least twice and forms a new data set in which each observation is a repeat sales pair, with "0" denoting the earlier time and
"1" denoting the later date in the variable names. The observations are ordered first by id, then by timevar, and then by price.
A repeat sales pair is formed by matching an observation for which id(t)=id(t-1) and timevar(t)=timevar(t-1). Thus, a property that
sold in times 1, 2, and 3 will produce 2 repeat sales pairs: (1) t = 1 and 2, and (2) t = 2 and 3.
The output of repsaledata is a data frame with 5 variables. If some of the original hedonic data set variables need to be
included in the repeat sales data set, the original hedonic data set and the repsaledata data frame can be merged by the id variable.