[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: replacing values in a variable with rowsums, aka "ereplace"

From   "Martin Weiss" <>
To   <>
Subject   st: RE: replacing values in a variable with rowsums, aka "ereplace"
Date   Mon, 14 Jul 2008 13:44:06 +0200

-h cond- might be for you...

Martin Weiss

Diplom-Kaufmann Martin Weiss
Mohlstrasse 36
Room 415
72074 Tuebingen

Fon: 0049-7071-2978184




-----Original Message-----
[] On Behalf Of Ora John Reuter
Sent: Sunday, July 13, 2008 4:48 PM
Subject: st: replacing values in a variable with rowsums, aka "ereplace"

Dear Statlisters,

I am searching for something that would do the equivalent of an 
'ereplace'.  I have a set variables for which I generated a -rowtotal- 
given some condition, e.g. (egen x=rowtotal (d1-d40) if y=1), but then 
I need to replace some values in that same variable (x) with a 
different -rowtotal- given a different condition.  I dont know how else 
to explain it except to say that if there were an  'ereplace' command 
the next command would look like this:

"ereplace" x=rowtotal(d2-d40) if y=2

In other words, I need to replace values in x with different sums of 
variables.  I need to do this for a great many conditions so typing out 
the list of variables to be added for each condition would be a minor 

  Ora John Reuter
Emory University
Department of Political Science
327 Tarbutton Hall
1555 Dickey Drive
Atlanta, GA 30322

*   For searches and help try:

*   For searches and help try:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index