Hi all,
I have three variables V1, V2 and V3.
Essentially, I want to check if the observations across these variables are the same.
The code to do this is:
egen diffcheck = diff(V1 V2 V3)
The issue is this function doesn't factor for missing variables
i.e. if the values are
V1 = 3
V2 = 3
V3 = . (missing)
It will tell me that these values are different. I want to factor for missing values.
This is the simplified case to this problem. The table is much larger and it is much more than three variables being compared at a time. Once I have the problem solved in the simplest case, I will easily be able to generalize it to the larger problem.
Please advise.
I have three variables V1, V2 and V3.
Essentially, I want to check if the observations across these variables are the same.
The code to do this is:
egen diffcheck = diff(V1 V2 V3)
The issue is this function doesn't factor for missing variables
i.e. if the values are
V1 = 3
V2 = 3
V3 = . (missing)
It will tell me that these values are different. I want to factor for missing values.
This is the simplified case to this problem. The table is much larger and it is much more than three variables being compared at a time. Once I have the problem solved in the simplest case, I will easily be able to generalize it to the larger problem.
Please advise.
Comment