Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: st: replacing with mean


From   Nick Cox <[email protected]>
To   "'[email protected]'" <[email protected]>
Subject   RE: st: replacing with mean
Date   Thu, 2 Dec 2010 17:43:42 +0000

This is an FAQ. 

FAQ     . . Creating variables recording prop. of the other members of a group
        . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  N. J. Cox
        4/05    How do I create variables summarizing for each
                individual properties of the other members of a
                group?
                http://www.stata.com/support/faqs/data/members.html

Nick 
[email protected] 

Fabio Zona

my request for "replace missing" was related to a more complex procedure I am trying to define. I think I better describe the whole problem and ask you for a more general and maybe effective solution.

Here is the problem.

Say I have 200 industries. I have a list of companies, List"A", of say 5000 companies distributed among these industries. For each of these companies I have 20 variables. 

          Companies
Industry   List"A"    Var1   Var2  Var3   
A             1        
A             2
A             3
..            
B
..


I have a separate list, List"B" of 700 companies, that is a subsample of List"A". 

I need to associate to each company "i" of List"B" (my sample for regression) the median value of its industry EXCLUDING the focal company "i", and have to do this for all 20 variables!

It's extremely challenging. How would you deal with this?


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


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