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

st: RE: concordance


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: concordance
Date   Thu, 17 Feb 2005 11:52:05 -0000

You could do it using random draws e.g. 

gen a = . 
...
replace a = cond(uniform() < 0.5, 1, 2) if b == 10 
... 

I don't know if that's quite what you want. I guess
there's a typo in your last sentence in any case. 

Nick 
[email protected] 

Karen Jackson

> I have a concordance (for a large number of codes) that has a 
> structure 
> something like this:
> 
> CATEGORY A          CATEGORY B
> 
> 1                   10
>                     20
>                     30
>                     40
> -------------------------------
> 
> 2                   10
>                     50
>                     60
> 
> -------------------------------
> 
> I have values corresponding to each CATEGORY B code and want 
> to aggregate 
> these into CATEGORY A codes. My problem is that when the code 
> appears in 
> both CATEGORY A and CATEGORY B, as in the of CATEGORY B code 
> "10", I wish 
> to add only 50% of "10" into CATEGORY A code "1" and 50% into 
> CATEGORY B 
> code "2". Any ideas?

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