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

Re: st: how to cope with missings in my case


From   Jia Xiangping <[email protected]>
To   statalist <[email protected]>
Subject   Re: st: how to cope with missings in my case
Date   Fri, 7 Oct 2005 17:38:20 +0800

Dear all,

An alternative way I can figure out is to -recode var-var3
(missing=0)-, after which -gen- var4. This way is sorta stupid, but
effective.

The problem is I don't want to have my data base changed, so before
run in that way, I have to copy the original dataset and run the
commands on the copy version. It's unsafe. After all, that's not
Stata's style. But what I can figure out is just this.

Joe


On 10/7/05, Jia Xiangping <[email protected]> wrote:
> Dear all,
>
> I came across a problem about missing value. For example:(var1 var2
> var3 are categorical variables)
>
> index  var1   var 2   var3   var 4
>  1       .         1         1
>  2       1        1         .
>  3       .         1        1
>
> Now I want to get the frequecy of each observation and generate a
> variable var4 which is the sum of frequency. So when I run -gen
> var4=var1+var2+var3-, I should have got 2,2,1. But I got three missing
> value. I'd like to say this problem is quite typical for missing value
> topic. I tried to find answer online. But no clues now. Does anybody
> can help me? Thanks
>
>
> --
> Xiangping JIA
>
> *
> *   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/
>


--
Xiangping JIA

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