Basic concept with coding choices

Hi all,

Hoping someone may be able to give me some reassurance…!

I’m working on a survey deployment, where we take the responses and then code them in Stata (e.g. replacing ‘oranges’ with 1, ‘apples’ with 2, etc.). But, I’m hoping that we code just include 1, 2, etc. in the original XLSForm code.

My only concern is that is there an issue with duplicating the same variable name in XLSForms (the second column)? Or, as long as it’s in a different group, all will be fine?

So, for example, right now we have:

list name name label::English (en)
fruit apple Apple
fruit orange Orange
fruit banana Banana
city ldn London
city nyc New York

And I’d like it to be:

list name name label::English (en)
fruit 1 Apple
fruit 2 Orange
fruit 3 Banana
city 1 London
city 2 New York

But, will it be an issue if ‘1’ and ‘2’ is repeated? Or, as they’re in different lists it’ll be OK?

Thank you!

Andy

@AndrewXLS, your current choice name is OK. Here is a condition that is an issue:

list name name label::English (en)
fruit 1 Apple
fruit 1 Orange
fruit 3 Banana
city 1 London
city 2 New York

or,

list name name label::English (en)
fruit 1 Apple
fruit 2 Orange
fruit 2 Banana
city 1 London
city 1 New York

Each unique list name should have a unique name like the one you have created above. The one I have showed is an issue because, the list name fruit cannot hold 2 name with 1 neither can the list name fruit hold 2 name with 2 nor the list name city can hold 2 name with 1.

Thanks for the quick reply, Kal!

Just to confirm, my second example (with the numbers) is fine - as none of the numbers in either list (fruit, or city) repeat. Is that right?

1 Like

Yes. It’s perfectly coded.

Thank you!

1 Like