Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

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

st: Selecting observations

From   Jacob-Jan Koopmans <[email protected]>
To   [email protected]
Subject   st: Selecting observations
Date   Wed, 2 Apr 2014 14:31:22 +0200

Dear Statalist,

I have a problem with selecting observations.

I would like to compare the health characteristics of people that drop
out of insurance with that of people that remain insured.

In my data-set I have 4 years and want to know whether people that
drop out of insurance between year 3 and 4 but were insured in the
first 3 years are more or less healthy compared to the individuals
that remain insured in year 4. For this I would thus like to drop
observations that were uninsured in year 1 to 3 and in year 4 I would
like to keep the individuals that became uninsured.

Dropping out the observations that were uninsured in the first 3 years
is simple.
Initially I started with simple drop commands
drop if has_health_insuranceA==1 if year==1
drop if has_health_insuranceA==1 if year==2
drop if has_health_insuranceA==1 if year==3

However, in year 4 I now want to select individuals which were insured
in year 1, 2 and 3 but not anymore in year 4. And have no idea how to
do this.
Is there anyone who could help me with this?

Kind regards,
Jacob-Jan Koopmans
*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index