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?
How to incorporate exposure variable in Zero Truncated Negative Binomial ModelHello All, This is my first time using this platform, so apologies in advance for any faux pas. Als…
Principal component analysis in panel data settingHello to everyone, I have a panel of 190 industries over the 2000-2018 period. my data-set contains…
Performing survival analysis under GSEMBefore I go to my questions, I'll give a short background of my research proposal. Most longitudinal…
ForvalHi, I have this little problem with the following code: clear all forval i=1/1{ use 201`i'-1.dta me…
Plot count data with SE bars on StataHi, I am looking at code for making a chart where I could plot two variables--- eg: no of times vis…
Subscribe to:
Post Comments (Atom)
0 Response to How to delete specific observations?
Post a Comment