John, I would like to ask you further question,
I have implemented the solution provided . It works. Now, I have the following results, that I need some clarifications or guidance
Based on what we read , for check all that apply variable, split function will create new variables.
Initial Stage
Source of Income
|
Client
|
Benefit ; EI ; CERB
|
1
|
EI ; Support ; Benefit
|
2
|
Support; CERB; EI
|
3
|
Applied Syntax
spssinc trans result = Source1 to Source3 type=25
/formula "re.split(',', Source of Income)".
Source 1
|
Source 2
|
Source 3
|
Client
|
Benefit
|
EI
|
CERB
|
1
|
EI
|
Support
|
Benefit
|
2
|
Support
|
CERB
|
EI
|
3
|
As you could see from the example above, Source 1 or Source 2 or Source 3 contains income source that is similar for 3 cases.
Question, what is the way to evaluate scenario above. Or if there is a way to create variables based on value and name variables as the example below.
Source Benefit
|
Source EI
|
Source CERB
|
Source Support
|
Client
|
1
|
1
|
1
|
0
|
1
|
1
|
1
|
0
|
1
|
2
|
0
|
1
|
1
|
1
|
3
|
thank you in advance
Kamal
------------------------------
Tolife Tolife
------------------------------
Original Message:
Sent: Fri December 04, 2020 10:20 AM
From: Jon Peck
Subject: splitting value from one variable (multiple values in one variable) to multiple variables
I presume that you want to split Q1A and Q6A on the comma character. Please be more explicit with your questions.
You can do this in standard SPSS Statistics syntax with a loop and the substrings functions, but I am going to show you a simpler
way to do this using the SPSSINC TRANS extension command (example for Q1A).
spssinc trans result = part1 part2 type=5
/formula "re.split(',', Q1A)".
This creates two new string variables, part1 and part2, of length five splitting on the comma character. The reference to the variable must match the letter case: q1a would not work.
You can install SPSSINC TRANS from the Extensions > Extension Hub menu. Search for trans.
------------------------------
Jon Peck
Original Message:
Sent: Fri December 04, 2020 07:48 AM
From: Akter Hossain
Subject: splitting value from one variable (multiple values in one variable) to multiple variables
Hi Friends
I'm new in SPSS and struggling to split multiple value from one variable to multiple variables. Is anyone can help me how to do that in syntax or using menu bar. See the attached file pls.
Thank you,
Akter
------------------------------
Akter Hossain
------------------------------
#SPSSStatistics