Hello,
I would like to do the total bys of a variable that contains missing value. But i don't want to use missing as zeros.
My database is like that :
So i want to get the same variable as "wanted".
I want to do the sum of x by id, but only if every x are not missing (every x exect if recipe==1, because it's always a missing value)
Is it possible ?
Thanks
I would like to do the total bys of a variable that contains missing value. But i don't want to use missing as zeros.
My database is like that :
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input float(id recipe x wanted) 1 1 . 5 1 2 1 5 1 2 2 5 1 2 2 5 2 1 . 6 2 2 2 6 2 2 4 6 3 1 . . 3 2 2 . 3 2 . . 3 2 3 . 4 1 . 4 4 2 4 4 5 1 . . 5 2 . . 5 2 3 . 5 2 . . end label values recipe recipe label def recipe 1 "name", modify label def recipe 2 "ingredient", modify
So i want to get the same variable as "wanted".
I want to do the sum of x by id, but only if every x are not missing (every x exect if recipe==1, because it's always a missing value)
Is it possible ?
Thanks
Comment