I have 3 variables that I want to construct an aggregate variable with:
racfew
rachaf
racmost
I have (.i) for some (missing values)
The new variable I want to construct is Racpeers= racfew + rachaf + racmost
How can I have Racpeers = .i (missing) only if all three variables (racfew, rachaf and racmost) are .i? If say one or two of the three is missing I want to assign .i= 0.
In other words, say I have a value of 2 for rachaf and .i for both racfew and racmost, I want Racpeers = 2.
But if I have racfew, rachaf and racmost = .i , I want to have Racpeers = .i or drop the observation for that variable.
How can this be done?
Related Posts with How to delete specific observations?
comparing the effect and magnitude of two coefficients across two modelsHello everyone, I have a panel dataset with 500 banks (in 20 countries) over the period 2000-2015. …
Graph box over sex, side by side boxesHi folks, Apologies if this question is simple but I was trying to find a good solution. I want to…
How to sum up (frequency and percentage) by group?Hello, I have a dataset like below. What I want to do is to group based on icd_code (first 3 digit…
two notes when using twoway graph, by()Hi all, I'm making a graph (see below) that uses the twoway graph by() option. As you can see, beca…
Updated combomarginsplotGreetings, An updated combomarginsplot is now available on SSC (thanks Kit Baum!). This version has…
Subscribe to:
Post Comments (Atom)
0 Response to How to delete specific observations?
Post a Comment