Download dataset for analysis

Discussions about CSEntry
Post Reply
Deepndra
Posts: 1
Joined: January 10th, 2022, 10:30 pm

Download dataset for analysis

Post by Deepndra »

When I download the data for analysis, the multiple response questions do not come in a separate column (as separate variables), rather they appear in a single column with the multiple options in the same cell as a string variable? How shall I download a dataset with the multiple response variables in different columns?
sherrell
Posts: 397
Joined: April 2nd, 2014, 9:16 pm
Location: Washington, DC

Re: Download dataset for analysis

Post by sherrell »

Unfortunately you'll need to run a short post-capture processing routine to split out the values you've collected into (new) individual variables.

Sherrell
KAPALA
Posts: 13
Joined: July 18th, 2017, 1:09 am

Re: Download dataset for analysis

Post by KAPALA »

Suppose you had 4 options in a multiple response questions which are A, B, C, D and let say this is question number G04 in your dataset. Since these answers are in multiple you may find that sometimes you can have answers like AB, AC, DC e.t.c. In order to carry out analysis you have to separate these answers and create new variable. Basing on the scenario i have created you will use the following codes
gen GO4A = strpos(G04, "A")
gen G04B = strpos(G04, "B")
gen G04C = strpos(G04, "C")
gen G04D = strpos(G04, "D")

This code will create new variables.

Regards
Albert Kapala
sherrell
Posts: 397
Joined: April 2nd, 2014, 9:16 pm
Location: Washington, DC

Re: Download dataset for analysis

Post by sherrell »

Albert, did you write a function named strpos? For there is no function with this name in CSPro.

What should be done is a call to the pos or poschar function. Any non-zero value means the value exists. For example, using the pos function, you would write:

numeric GO4A = pos("A", G04) > 0;
numeric GO4B = pos("B", G04) > 0;
numeric GO4C = pos("C", G04) > 0;
numeric GO4D = pos("D", G04) > 0;

https://www.csprousers.org/help/CSPro/pos_function.html
https://www.csprousers.org/help/CSPro/p ... ction.html

Sherrell
KAPALA
Posts: 13
Joined: July 18th, 2017, 1:09 am

Re: Download dataset for analysis

Post by KAPALA »

Hi!
This is your message
"When I download the data for analysis, the multiple response questions do not come in a separate column (as separate variables), rather they appear in a single column with the multiple options in the same cell as a string variable? How shall I download a dataset with the multiple response variables in different columns?"
I wrote those codes by assuming that you have downloaded the data as you said. Those are STATA Codes for analysis of Multiple Response Variable and not in CSPro.
etuser
Posts: 85
Joined: September 3rd, 2019, 5:57 am

Re: Download dataset for analysis

Post by etuser »

I usually use the dictionary to parse the multiple response variable, what you can do is , let say , if you have a variable of length 5 which is an alpha and store multiple response (Check box) , create a new dictionary by saving as the original dictionary and modify the variable as length 1 and occurs 5 times and then use the "flatten" option of a dictionary to parse the variable into five separate variables of length 1 for each, then open the data in data viewer and save as the data as .txt and use use the usual export using the new dictionary and the new .txt data
KAPALA
Posts: 13
Joined: July 18th, 2017, 1:09 am

Re: Download dataset for analysis

Post by KAPALA »

Thank You!
Post Reply