I don't think I will write the code for you but direct you to
SORT CASES
AGGREGATE
XSAVE
MATCH
piece it together and you will be set.
--
Ujjawal wrote
Hi Team,
I have 2 variables V1 and V2 .There are total 3 options in both variables V1 and V2. This data set contains more than 1 million records. Below the dummy dataset:
V1 V2
4 1
5 1
5 1
4 1
4 2
6 3
6 2
5 2
5 3
4 3
My requirement is :
1. Create a new variable, lets say V3
2. Based on the count percentage of 3 options of V1 i want 4 ,5, 6 coded for each options of V2 in variable V3.
As you can see , in the above data set 4's are coming up 4 times out of 10 records (i.e 40%) ,5's - 40% ,6's-20%.
Next Step is create a variable V3 and assign 4,5,6 codes for option 1 so 40% of 1 will be coded 4,40% of 1 will be coded 5 and the remaining 20% percentage of 1 will be coded 6 in V3...same thing goes for 2 and 3 options as well....
Any help would be highly appreciated !
Thanks in advance ....
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me.
---
"Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis."
Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?"