Order in two roster from a same record and order of copy in pff setproperty function with his "KEY" option

Discussions about CSEntry
Forum rules
New release: CSPro 8.0
Post Reply
Gillesbop
Posts: 23
Joined: August 11th, 2016, 3:22 am

Order in two roster from a same record and order of copy in pff setproperty function with his "KEY" option

Post by Gillesbop »

Hi everyone !
If we drag and drop items of the same record, separately and independently of each other (such as names, age and sex on one side and then information such as education, health, etc. on the other side) what happens about the order of the lines is that the row order of the first roster (the individuals) is directly related to the order of the second by linking them by% NAME% (only for cases of CAPI) or it would take eventually write a logic code to establish a perfect link between the rosters and their dependence?

My second question concerns the setproperty function and its "KEY" option
By writing:
pffMenage.setproperty ("Key", CHOOSE_HOUSEHOLD)
after we have extracted the IDs of the listing questionnary in the fields of CHOOSE_HOUSEHOLD, how is the copy in the KEY? provided that:
the two identifiers of the two dictionaries (household and listing) should have the same characteristics and are classified in the same order;
(the copy will be item by item)

How else does this function do to establish a perfect copy between the two knowing that the names of the identifiers are not the same in both dictionaries and therefore difficult to establish a correspondence between the two dictionaries.

Thank you very mch !
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: Order in two roster from a same record and order of copy in pff setproperty function with his "KEY" option

Post by josh »

When you drag items from the same record onto two different rosters you end up with two different groups (group in CSPro is either a roster or a repeating form) that both come from the same record. Line n in the first roster will correspond to line n in the second roster. As you mention if you are in the proc or in the question text of an item in the second roster and you refer to an item the in first roster without a subscript CSPro will use the subscript of the current line. This means that if you are on one of the education variables in the second roster and you refer to AGE or SEX from the first roster, CSPro will give the AGE or SEX of the current individual. So if you are on education for person 3 and you refer to AGE, CSPro assumes you want the age of person 3. This is only possible if the rosters are built from the same dictionary record. If you create two rosters from two different records then you have to use a subscript to link the variables in the two rosters.

The key of a case in CSPro is made up by concatenating together all of the values of the id-items of the case. So if I have a case with PROVINCE=01, DISTRICT=03, HOUSEHOLD_NUM=001 then the key would be "0103001". When you specify the key parameter in the pff you provide the concatenated key and CSPro breaks it up into the separate id variables based on the item lengths in the dictionary. If the two dictionaries have different id-items then the key will be broken up according to the dictionary of the application being launched. If the length of the key parameter is less than the length of all the id-items together, CSPro will fill in the id-items that it can based on the key parameter and leave the rest blank.
Gillesbop
Posts: 23
Joined: August 11th, 2016, 3:22 am

Re: Order in two roster from a same record and order of copy in pff setproperty function with his "KEY" option

Post by Gillesbop »

Thank you Josh for those answers

I'm sure for my first question and thank you for that, but I still have doubts about the second and the problem is about the order of the items in the two dictionaries to make it simple, here is a concrete case:

Let's assume that in the household dictionary I have the following items in order: Province, district and household number
and in the dictionaries of listing I have in order: district, province and household number ( did you notice the order?)

knowing that province and district have the same length in both dictionaries, but do not respect the order of disposition in both dictionaries
after KEY, the district codes of the listing will be copied to the province codes in the household dictionary?

household (length) <---> listing (length)
- -
Province (2) <---> District (2)
district (2) <---> province (2)
num_houshold (3) <---> num_houshold (3)

choose_household = "0103001" from listing

household (length) <---> listing (length)
- -
Province = 01 <---> district = 01
district = 03 <---> province = 03
num_houshold = 001<---> num_houshold = 001

is this the logic?

In other words, at equal length, the transmission is in the order of arrangement of the two dictionaries ?
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: Order in two roster from a same record and order of copy in pff setproperty function with his "KEY" option

Post by josh »

You are correct. It is based on the order of the variables in the two dictionaries.
Post Reply