Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: RE: RE: RE: tsset


From   "Martin Weiss" <[email protected]>
To   <[email protected]>
Subject   st: RE: RE: RE: tsset
Date   Sat, 16 Jan 2010 22:46:29 +0100

<>

Note that my code does not furnish a solution to the problem of "repeated
time values in sample", which Stata will complain about in response to the
command

*******
tsset month, monthly
*******

following my code. This problem is one of your data, and only you can solve
it - probably by not -tsset-ing your data...

HTH
Martin


-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Martin Weiss
Sent: Samstag, 16. Januar 2010 22:41
To: [email protected]
Subject: st: RE: RE: tsset


<>

*******
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/

*
*   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/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index