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

st: programming problem

From   Jeph Herrin <>
Subject   st: programming problem
Date   Thu, 16 Aug 2007 13:45:53 -0400

I have observations on patient admissions over
a 12 month period.

For each observation, I have 12 variables, call
them var1-var12, which indicate whether a certain
condition was met for that patient for months 1-12.
So, eg, it may be true for months 1-3 and 7-12.

I also have a variable -month-, which indicates
the current month of the observed admission. What
I want to capture is whether the condition was true
in the month of admission.

For instance, at first I unthinkingly tried this:

 gen mycond = var`=month'==1

but this of course uses the first observed value
of -month-, which happens to be 6, and only checks

I eventually got there by creating lots of vars, but is
there a more direct solution?


*   For searches and help try:

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