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

st: Re: drop command with panel data

From   "Martin Weiss" <>
To   <>
Subject   st: Re: drop command with panel data
Date   Sat, 25 Apr 2009 13:19:09 +0200


Everything rides on your data structure - as always. Let`s pretend you have a long dataset and a dummy indicating the presence of a mortgage at that particular point in time.

set obs 10000
egen float id = seq(), from(1) to(10000) block(8)
egen float time = seq(), from(1) to(8) block(1)
xtset id time

gen byte mortgage =runiform()<0.25

//what does the participation look like?

//drop those who do not have a mortgage at any time
bys id:egen anymortgage=max(mortgage)
keep if anymortgage

//what does the participation look like _now_?

xttab mortgage

----- Original Message ----- From: <>
To: <>
Sent: Saturday, April 25, 2009 1:07 PM
Subject: st: drop command with panel data

I have a panel of households observed for 8 years, I would like to know how can I drop households that never had a mortgage (e.g.) during the time span.

Thank you in advance,

*   For searches and help try:

*   For searches and help try:

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