Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: expanding dataset by n observations where n varies


From   Joseph Coveney <jcoveney@bigplanet.com>
To   Statalist <statalist@hsphsun2.harvard.edu>
Subject   Re: st: expanding dataset by n observations where n varies
Date   Sat, 15 Sep 2007 19:05:51 -0700

Hind Sbihi wrote:

The dataset I am working with comprises repeated observations for several
thousands subjects. Each observation consists of a job/exposure
level/hearing test combination. The data is long shaped.
I am trying to truncate these units of observation by year.

[snipped for brevity]

My main objective is to expand these observations and obtain something like
this output

[snipped for brevity]

I would be grateful if you would let me know how to deal with this problem.

--------------------------------------------------------------------------------

What you want seems to be padding the dataset with empty six-month date
intervals, which seems like an unusual Main Objective, even if it's for
display or "reporting".

If this dataset padding activity per se is not the ultimate objective of
your analysis, then my suggestion would be to pause, step back and
re-confirm what it is that you're trying to get out of your data.

Perhaps your ultimate objective is better approached with time-series
setting of your data (-tsset-) and related commands, or, as Maarten
suggested:  declaring the dataset to be survival data (-stset-) and then
taking advantage of one or more subsequent -st- commands.

Stata's data-management commands related to time-series and survival
datasets include convenient "house-keeping" commands that might be useful in
your context regardless of whether your analytical objective is strictly
related to time-series or survival analysis.

Joseph Coveney


*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



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