Saturday, 30 July 2016

Creating new codes from one meta code

This is another life saver syntax that I learnt from Minhaj. Some datasets come with only one large code with various information. For example it is common to have PSU code which includes the information about the respondent's location, sex etc.

Here is a syntax that can be modified.

SET OVars Both ONumbers Both TVars Both TNumbers Both.
SET OVars Labels ONumbers Labels TVars Labels TNumbers Labels.


comp province = trunc (psu/100000).
comp temp = trunc (psu/10000).
*comp locality = temp - (province*10).
var lab province 'Province'.
val lab province 1'Punjab' 2'Sindh' 3'NWFP' 4'Balochistan'.

format province (f1.0).
fre province.

In this syntax the point to note is that variable "psu" has 6 characters and the code for "province" is stored in position 1. Hence, it is divided by "10000" which will truncate the last 5 characters. 

3 comments:

awamichat said...
This comment has been removed by a blog administrator.
Packers And Movers Bangalore said...
This comment has been removed by a blog administrator.
Sindhuja Ravi said...

Thanks for sharing the valuable information here. So i think i got some useful information with this content. Thank you and please keep update like this informative details.

SEO Company in chennai

Digital Marketing Company in Chennai