Notice: On March 31, it was **announced** that Statalist is moving from an email list to a **forum**. The old list will shut down on April 23, and its replacement, **statalist.org** is already up and running.

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

From |
"Martin Weiss" <martin.weiss1@gmx.de> |

To |
<statalist@hsphsun2.harvard.edu> |

Subject |
st: RE: Fwd: Adding Observations to PanelDta; Number Obs Equal to Another Variable, varying for each ID |

Date |
Sun, 19 Sep 2010 20:25:08 +0200 |

<> Just *********** expand NumVisit *********** HTH Martin -----Original Message----- From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Emma Quinn Sent: Sonntag, 19. September 2010 20:14 To: statalist@hsphsun2.harvard.edu Subject: st: Fwd: Adding Observations to PanelDta; Number Obs Equal to Another Variable, varying for each ID Hi, I am working with panel data, and I would like to append observations to my time series variable. However, the number of observations I would like to add depends on the ID of the subject and is equal to another variable in my dataset; the number of appointments they have made. The appointments for each would be made on two-month intervals following the starting date--the time variable. I would like to add 2 month intervals for each ID; however the number of 2 month intervals I add depends on how many visits they ended up making. For example if : ID Panel Var Time Var NumVisit 1 2 3/6/2004 12 2 8 3/7/2004 8 3 3 8/7/2005 6 then for ID 3, I would like to generate the date variable 10/7/2005, 12/7/2005, 2/7/2005, 4/7/2005, 6/7/2005 and 8/7/2005. I tried to tsappend add(), after defining a local macro x = NumVisit and again as local macro 4 = NumVisit but they didn't work; the command would not recognize 'x' or '4' as a positive integer. Alternatively, my time variable corresponds to the "start date" of the study. I have another date variable that corresponds to the "end date"--the last visit made. If any one knew how to generate two month intervals between the two dates, where the start and end date are different for each ID, that would be much appreciated. Much appreciated! * * 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/

**Follow-Ups**:**st: RE: RE: Fwd: Adding Observations to PanelDta; Number Obs Equal to Another Variable, varying for each ID***From:*"Martin Weiss" <martin.weiss1@gmx.de>

**References**:**st: Fwd: Adding Observations to PanelDta; Number Obs Equal to Another Variable, varying for each ID***From:*Emma Quinn <e.q.jackson@gmail.com>

- Prev by Date:
**st: Fwd: Adding Observations to PanelDta; Number Obs Equal to Another Variable, varying for each ID** - Next by Date:
**st: RE: RE: Fwd: Adding Observations to PanelDta; Number Obs Equal to Another Variable, varying for each ID** - Previous by thread:
**st: Fwd: Adding Observations to PanelDta; Number Obs Equal to Another Variable, varying for each ID** - Next by thread:
**st: RE: RE: Fwd: Adding Observations to PanelDta; Number Obs Equal to Another Variable, varying for each ID** - Index(es):