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 at the end of May, and its replacement, statalist.org is already up and running.


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

st: xt unit-exclusive means by year


From   Jim Mahon <James.E.Mahon@williams.edu>
To   statalist@hsphsun2.harvard.edu
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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index