Advertisement
Guest User

EnVaTut1

a guest
May 24th, 2016
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. *2)
  2.  
  3. clear all
  4. cd "C:\Users\PCL161\Desktop\Tutorial 1"
  5. set more off
  6.  
  7.  
  8. *first data set prices.dta
  9. clear all
  10.  
  11. import excel using rock_view_prices.xlsx, firstrow
  12. destring, replace
  13. save prices.dta, replace
  14.  
  15.  
  16. *second data set characteristics.dta
  17.  
  18. clear all
  19.  
  20. import excel using rock_view_characteristics.xlsx, firstrow
  21. destring, replace
  22. save characteristics.dta, replace
  23.  
  24.  
  25. *3)
  26.  
  27. clear all
  28.  
  29. use prices.dta
  30. merge 1:1 id using characteristics
  31. drop _merge
  32.  
  33.  
  34. *4)
  35.  
  36. drop if price==.
  37. drop if view==.
  38.  
  39.  
  40. *5)
  41.  
  42. generate price2 = price+diff
  43. rename price price1
  44. generate age = 2005 - yearbuilt
  45.  
  46.  
  47. *6)
  48.  
  49. label variable price2 "asking price"
  50. label variable price1 "selling price"
  51. label variable age "age"
  52. *Den rest noch nachtragen
  53.  
  54. label define yesno 1 "yes" 0 "no"
  55. label values garage sub view yesno
  56.  
  57.  
  58. *7)
  59.  
  60. order id price1 price2 diff view
  61.  
  62. *8)
  63.  
  64. save workingsample.dta, replace
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement