Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

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

Re: st: replacing with mean

From   Fabio Zona <>
Subject   Re: st: replacing with mean
Date   Thu, 2 Dec 2010 19:56:01 +0100 (CET)

Thanks a lot to both Dimitry and Nick.

Last issue:  I have read the FAQ. However, it is just for one variable: how should I implement the commands when I have 20 or more different  variables? I am facing difficulties in writing the lines!!



----- Messaggio originale -----
Da: "Nick Cox" <>
A: "" <>
Inviato: Giovedì, 2 dicembre 2010 18:43:42 GMT +01:00 Amsterdam/Berlino/Berna/Roma/Stoccolma/Vienna
Oggetto: RE: st: replacing with mean

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


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. 

Industry   List"A"    Var1   Var2  Var3   
A             1        
A             2
A             3

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:

*   For searches and help try:

© Copyright 1996–2016 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index