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

st: browsing a subset of panels in a panel dataset

From   postkarte <>
Subject   st: browsing a subset of panels in a panel dataset
Date   Wed, 2 Apr 2008 15:43:14 +0200

dear statalist-reader,

I analyse a panel data set with several observations (time) for all panel
group, which are marked with a panel identifier. I have to select
several panel groups out of
the entire panel dataset on the basis of a binary variable ("binvar") coded
1 when fulfilling a certain criterion. Binvar==1 is mostly the case
for only a single observation per panel group. I would like to be able
to browse the
entire panel for visual inspection, i.e. also the observations in that
panel group for
which binvar==0. The list of panel identifiers with a panel
observation holding binvar==1 is usually fairly long so

browse if binvar=="panel identifier1" | binvar=="panel identifier2" etc.

is too cumbersome.

Up to now I have used

generate "auxiliary_var"=0
sort "panel_identifier" "binvar"
by "panel identifier": replace "auxiliary_var"=1 if "binvar"[_N]==1
browse if "auxiliary_var"==1

I have to do this procedure repeatedly and was wondering if there's a
more elegant way of looking at the entire panel group, such as handing
over the list of panel identifiers to a temporary variable such as a
local macro, say "temp_var" and then type something along the lines of

browse if "panel identifier" is a part of "temp_var"

Your helpful comments are much appreciated! In case there's no such
way, I guess I'll have to write a small program containing the
procedure I've been using up to now.

Thanks in advance,

*   For searches and help try:

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