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]

st: xt unit-exclusive means by year


From   Jim Mahon <[email protected]>
To   [email protected]
Subject   st: xt unit-exclusive means by year
Date   Thu, 29 Jul 2010 13:48:26 -0400

Dear statalist,

I'm trying to create an instrument in cross-sectional time series that takes

an initial value for each unit and then applies to it the mean trend for all

units but the one in question, and then repeats this operation for each

unit.  Sounds simple, but I can't figure out how to do it:  "by country:

egen instrument = mean(varname) if id ~= x" obviously doesn't work.  Interaction

expansion seems not to be the route.  Do I have to program something? I'd

love not to have to create a new variable for each unit.



Thanks and best wishes,

Jim Mahon

--
James E. Mahon, Jr.
Woodrow Wilson Professor and Chair
Department of Political Science
Williams College
226 Schapiro Hall
24 Hopkins Hall Drive
Williamstown, MA 01267
(413) 597-2236

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