From | "����ΰ" <[email protected]> |
To | [email protected] |
Subject | st: =?gb2312?B?YWJvdXQgbG9vcGluZw==?= |
Date | Thu, 30 Oct 2003 21:31:10 +0800 (CST) |
Deat all, Thanks for uli and Nick. Now here is my data, . list t1 t2 p12 p21 +---------------------------------------+ | t1 t2 p12 p21 | |---------------------------------------| 1. | 884926 115074 .3470322 .1175582 | 2. | . . .3154392 .137751 | 3. | . . .2806379 &nbs! p;.1431388 | 4. | . . .2409214 .1699163 | 5. | . . .1775456 .2156969 | |---------------------------------------| 6. | . . .1161977 .2085497 | 7. | . . .1420289 .2278323 | 8. | . . .1545061 .1971488 | 9. | &nb! sp; . .  ; .1151673 .2456649 | 10. | . . .0701624 .1987177 | |---------------------------------------| 11. | . . .0555115 .2351439 | 12. | . . .0643219 .215013 | 13. | . . .0767569 .1852408 | +---------------------------------------+ In order to get what I want, I did this. . replace&! nbsp;t1=t1[_n-1]+t2[_n-1]*p12[_n-1] if _n>1 (1 real change made) . replace t2=t2[_n-1]+t1[_n-1]*p21[_n-1] if _n>1 (2 real changes made) . list t1 t2 p12 p21 +-------------------------------------------+ | t1 t2 p12 p21 | |-------------------------------------------| 1. | 884926 115074 .3470322 .1175582 | 2. | 924860.4 219104.3 .3154392 .137751 | 3. |  ! ; . 346504.8 .2806379 .1431388 | 4. | . . .2409214 .1699163 | 5. | . . .1775456 .2156969 | |-------------------------------------------| 6. | . . .1161977 .2085497 | 7. | . . .1420289 .2278323 | 8. | . &! nbsp; . .1545061 .1971488 | 9. | . . .1151673 .2456649 | 10. | . . .0701624 .1987177 | |-------------------------------------------| 11. | . . .0555115 .2351439 | 12. | . . .0643219 .215013 | 13. | &nbs! p; . & nbsp; . .0767569 .1852408 | +-------------------------------------------+ But this is not what I want, I want all the t1 and t2 replaced. I tried this, but it doesn't work. while _n>1 { replace t1=t1[_n-1]+t2[_n-1]*p12[_n-1] replace t2=t2[_n-1]+t1[_n-1]*p21[_n-1] } Thanks. CUI liwei ============================================================= ������佡��ɱ�����ж��� ������ľ��� ��ס��ľ��� ����ȫ���շѣ� ����վ����������ѧ�������� |
© Copyright 1996–2024 StataCorp LLC | Terms of use | Privacy | Contact us | What's new | Site index |