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]

st: RE: xt unit-exclusive means by year

From   "Martin Weiss" <>
To   <>
Subject   st: RE: xt unit-exclusive means by year
Date   Thu, 29 Jul 2010 19:52:36 +0200


Maybe try this FAQ by


-----Original Message-----
[] On Behalf Of Jim Mahon
Sent: Donnerstag, 29. Juli 2010 19:48
Subject: st: xt unit-exclusive means by year

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.

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:

*   For searches and help try:

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