# Re: st: RE: Problem with generating time dummies in panel data

 From "Ada Ma" To statalist@hsphsun2.harvard.edu Subject Re: st: RE: Problem with generating time dummies in panel data Date Mon, 17 Jul 2006 14:42:39 +0100

```You have to tell Stata that you don't want a value generated if minder
is missing.  Your command refers to the year variable, not the minder
variable although the generated variables are named minder1, minder2,
minder3, you could have called the three dummy variables holiday1,
holiday2, holiday3, if you have written -tab year, gen(holiday)-

Therefore if you want no dummies generated when minder is missing you
should write:

tab year if ~mi(minder), gen(minder)

Or you can restrict your regression to use only obs that has a minder
value.  Or you can drop all obs that has got a missing minder value.

On 7/17/06, Daghan Yeldan <caracicatriz2002@hotmail.com> wrote:
```
```Thank you at least I get the year dummies, but again I am facing with a
problem;
Namely, the variable minder is defined as hp<h and gets the value 1 if this
is the case, gets value 0 if this is not the case for each year. Now when I
list the variables I see value 0 is attached to a year even if there is no
minder value associated with the year. For example
+-----------------------------------------------------------+
|      resp96      y   minder   minder1   minder2   minder3 |
|-----------------------------------------------------------|
1. |         701   1994        0         1         0         0 |
2. |         701   1996        1         0         1         0 |
3. |        1602   1994        .         1         0         0 |
4. |        1602   1996        .         0         1         0 |
5. |        1602   1998        .         0         0         1 |
|-----------------------------------------------------------|

For resp96 1602, there is no minder variable present, but if you look at the
dummies there are values attached to them.
If I use them in a regression, then I get muticollinearity and automatically
dropped by stata.
My excuses for the inconvienient results but I am stucked with this problem
by days.

d

>From: "Scott Merryman" <smerryman@kc.rr.com>
>To: <statalist@hsphsun2.harvard.edu>
>Subject: RE: st: RE: Problem with generating time dummies in panel data
>Date: Mon, 17 Jul 2006 08:19:45 -0500
>
>For year dummies I would try -tab year, gen(minder)-
>
>This will create three dummies callers (named minder1, minder2, minder3
>corresponding to years 1994, 1996, and 1998).
>
>Scott
>
>
> > -----Original Message-----
> > From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-
> > statalist@hsphsun2.harvard.edu] On Behalf Of Daghan Yeldan
> > Sent: Monday, July 17, 2006 8:15 AM
> > To: statalist@hsphsun2.harvard.edu
> > Subject: RE: st: RE: Problem with generating time dummies in panel data
> >
> > thnx for the advice. But I tried them all before I sent this message.
>The
> > problem I get is when I do this,
> >
> > tab minder,g(min) it only creates two dummies instead of 3. I have 3
>years
> > of variables.
> > How can I solve this problem?
> > cheers,
> > d
>
>
```
```*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
```