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]

Antw: st: RE: use dummy variable for nonmissing data

From   "Rainald Borck" <[email protected]>
To   <[email protected]>
Subject   Antw: st: RE: use dummy variable for nonmissing data
Date   Sat, 15 Jan 2011 21:10:22 +0100


sorry, probably I didn't explain myself well. I know Stata can't do anything with missing values. The question is this: say I have individuals from Germany in 1990 who all have missings in some variable y and I have created the dummy variable _IcouXyea_GER_1990.  When I leave this variable in a regression of, say y on all the country-year dummies, Stata will drop it because all individuals from Germany in 1990 have missing y and all those who have nonmissing have a 0 in _IcouXyea_GER_1990. So I want to tell Stata to use only those _IcouXyea_country_year where there are individuals in the country and year with nonmissing values. This would be convenient (rather than manually adjusting the output for all dropped dummies).

I tried by creating a variable nonmiss with values equal to 0 if there all individuals in a country in one year have missing values and 1 otherwise, and then


drop if nonmiss==0

xi.*i.year, noomit

reg y var1  _IcouXyea*


but this doesn't seem to work (neither without noomit).


>>> Nick Cox  14.01.11 17.01 Uhr >>>
This is just part of the default behaviour. Stata can't do anything statistical if values are missing and it ignores such observations. What do you think it could possibly do with them? 

[email protected] 

Rainald Borck
I have survey data for individuals from several countries and years like this

id country year var1 var2
1 A 1900 1 2
200 B 1900 3 .

I have created country_year dummies using
xi*i.year, noomit
Now I want to tell Stata to temporarily drop (or not use) the variable _IcouXyea_country_year if that country does not have observations for that year (i.e. the variable is missing for all individuals from that country and particular year). Can anyone help?

*   For searches and help try:

*   For searches and help try:

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