<>
*******
clear*
inp byte(salemonth) saleprice
1 980000
2 575000
2 439000
3 1300000
3 850000
3 841000
3 350000
4 1280000
4 897000
4 470000
5 515000
6 615000
8 1000000
8 430000
10 2000000
10 850000
12 1200000
13 1200000
13 780000
14 1700000
15 1500000
16 1500000
16 989000
17 800000
18 1100000
19 1920000
20 1100000
20 950000
end
compress
list, noo
gen month= mofd(date("1/3/2005", "DMY"))+ salemonth
format month %tmMonth_CCYY
l
*******
HTH
Martin
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Jeff
Sent: Samstag, 16. Januar 2010 22:34
To: [email protected]
Subject: st: RE: tsset
I'm a relatively new user of STATA. The following partial array of
numbers represents the Month of Sale (Salemonth) and Sale Price
(saleprice) of various real properties. I wish to tsset the "salemonth"
so that #1 corresponds to April 2005, #2 corresponds to May 2005, etc.
Notice, however, that some months repeat themselves. In other words, in
some months there are more than one transaction (Saleprice).
I've tried the following which does not work because it advances each
month by one, and does not recognize that some months can have multiple
sale price transactions.
Generate month = ym(2005, 04)+_n-1
tsset month, monthly
Thank you in advance
salemonth saleprice
1 980000
2 575000
2 439000
3 1300000
3 850000
3 841000
3 350000
4 1280000
4 897000
4 470000
5 515000
6 615000
8 1000000
8 430000
10 2000000
10 850000
12 1200000
13 1200000
13 780000
14 1700000
15 1500000
16 1500000
16 989000
17 800000
18 1100000
19 1920000
20 1100000
20 950000
Jeffrey B. Wolpin
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/