Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
****&&&&& THIS PROGRAM TAKES THE FULL VANCOUVER AREA DATASET, AND NARROWS IT DOWN TO THE PROPERTIES
****&&&&& IN VANCOUVER AND RICHMOND, BETWEEN 1/1/2006 AND 8/31/2007, EXCLUDING A BUFFER ZONE,
****&&&&& AND THEN WRITES THE RESULTING DATASET TO "C:\Users\jcohen2\Desktop\Bryan Graham Stata software\IPT-GWR_Application_SouthVan_Richmond_6-15-17-dumweighted\data_for_application.txt"
****&&&&& MUST RUN THE FOLLOWING BEFORE RUNNING:
****&&&& ssc install iptATE (this is case-sensitive)
****&&&& ssc install estout
****&&&& change directory to be the same one where the .xlsx data are located
cd "C:\Users\jcohen2\Desktop\Bryan Graham Stata software\IPT-GWR_Application_SouthVan_Richmond_6-15-17-dumweighted\"
log using vanrichlon, text replace
import excel using "Vancouver_Area_data.xlsx", firstrow clear
gen date_lastsale=dofc(LastSaleDate)
format date_lastsale %td
gen sale_year=year(date_lastsale)
scalar startdate=date("January 1, 2006","MDY")
scalar advisory_date=date("November 16, 2006", "MDY")
scalar enddate=date("August 31, 2007", "MDY")
gen sale_price=LastSaleAmount
keep if sale_price>1000 & date_lastsale>startdate & date_lastsale<enddate & YEAR_BUILT>0 & YEAR_BUILT<2008 & LotSize_Sqft != . & EFF_YEAR>0 & EFF_YEAR<=sale_year & GR_BUILDING_AREA>100 & GR_BUILDING_AREA != . & ((JurisdictionDescription == "Vancouver, City of" & Long>-123.138631 & Long<-123.00000 & Lat<49.2417) | (JurisdictionDescription =="Richmond, City of" & Long>-123.138631 & Long<-123.00000 & Lat<49.2417)) & LotSize_Sqft>0 & Repeat_Sale == 0
label data vanrich_data
gen dum_treat=0
replace dum_treat=1 if sale_price>1000 & date_lastsale>advisory_date & date_lastsale<enddate & YEAR_BUILT>0 & YEAR_BUILT<2008 & EFF_YEAR>0 & EFF_YEAR<=sale_year & GR_BUILDING_AREA>100 & ((JurisdictionDescription == "Vancouver, City of" & Long>-123.138631 & Long<-123.00000 & Lat<49.2417)) & LotSize_Sqft>0 & Repeat_Sale == 0
export excel using "C:\Users\jcohen2\Desktop\Bryan Graham Stata software\IPT-GWR_Application_SouthVan_Richmond_6-15-17-dumweighted\data_for_application.xlsx", firstrow(variables) replace
log close
end