Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: AW: missing data, tab ..., matcell(...) and marksample


From   "Jann, Ben" <[email protected]>
To   <[email protected]>
Subject   st: AW: missing data, tab ..., matcell(...) and marksample
Date   Sat, 9 Aug 2003 23:31:06 +0200

Paul A. Jargowsky writes:
> The problem I am having concerns missing values in the row or column 
> variable.  I won't to be able to retain them, but when I specify the 
> "missing" option to my table command, the missing 
> observations are ignored. 
> I have discovered that the problem is the marksample command, 
> which is 
> needed for byableness and ifableness.  In other words, in the 
> following 
> code:
> 
> marksample touse
> ....
> .....
> ......
> quietly tab `1' `2' [`weight' `exp'] if `touse',
> 	matcell(`X') matrow(`R') matcol(`C') `missing'
> .......
> 
> the output matrix `X' will not have a row for the missing 
> category of the 
> row or column variable even if there should be one.  But if I 
> comment out 
> "if `touse'", it works:
> 
> quietly tab `1' `2' [`weight' `exp'] /* if `touse'*/,
> 	matcell(`X') matrow(`R') matcol(`C') `missing'
> 
...
> 
> Is this a feature or a bug?

No bug! -marksample- marks all cases without missing values. So, if you
invoke "qui tab ... if `thouse'", only cases without missing values will
be selected and the "missing"-option cannot have any effect.

(It looks to me, like you don't need the "marksample touse" line at all.
Depends on what else your program is doing.)

ben

*
*   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/



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