Statalist The Stata Listserver

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

Re: st: AW: tsset on subsample of observations

From   "Robert Duval" <>
Subject   Re: st: AW: tsset on subsample of observations
Date   Sat, 11 Nov 2006 17:13:14 -0500

Hi Tom,

Thanks for the suggestion, however it doesn't really get at what I want,...

After defining tsset, I want to create variables like

gen z = x-l.x

and keep this variables in the dataset. For the duplicate obs. z
should take missing values.

By using -preserve- / -restore- I lose z after restoring the old dataset.

Any other suggestion will be greatly appreciated


On 11/11/06, Thomas Erdmann <> wrote:
Couldnt you work with -preserve- and -restore- ?

duplicates tag x y, generate(dup)
drop if dup~=0
tsset x y

Wouldn't it be better to keep one of the duplicate observations?
Duplicates drop, force
Instead of
Drop if dup~=0

- Tom

-----Ursprüngliche Nachricht-----
[] Im Auftrag von Robert Duval
Gesendet: Samstag, 11. November 2006 21:21
Betreff: st: tsset on subsample of observations

Dear All,

Is there a way to tsset a subsample of my observations?

I want to perform operations that involve time series commands, but if
I consider my entire dataset I have repeated time values within the

I would like to Stata to tsset my observations for that subset of obs.
that are uniquely identified within each panel... something like:

tsset x y if unique==1

Is there a way to do this?

Otherwise I would be forced to drop the repeated observations, but
since I need those obs. for other exercises this will force me to save
datasets: one with duplicates and another one without them. Something
that seems highly inefficient.

Any help would be greatly appreciated.
*   For searches and help try:

No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.409 / Virus Database: 268.14.0/524 - Release Date: 08.11.2006

*   For searches and help try:

*   For searches and help try:

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