Triple S exports with multiple variables

classic Classic list List threaded Threaded
23 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Triple S exports with multiple variables

Amy_Hynd
Hi, I have been using the export script from http://pages.infinit.net/rlevesqu/SampleScripts.htm and this only offers the solution to export as single, quantity or as character. Has anyone came across a script that can export to multiple as well as single types? My attempts at amending the script have been slow,but for the script the recognise the multi-code, I am assuming that it will need to be included in the mrset before any scripts are ran? Many thanks
Reply | Threaded
Open this post in threaded view
|

Re: Triple S exports with multiple variables

Art Kendall
The script is over a decade old. There have been numerous improvement to SPSS.
Please describe what you are trying to do. Perhaps cobble up a small example of what the data looks like now and what you would like to see.
Art Kendall
Social Research Consultants
On 6/14/2013 11:28 AM, Amy_Hynd [via SPSSX Discussion] wrote:
Hi, I have been using the export script from http://pages.infinit.net/rlevesqu/SampleScripts.htm and this only offers the solution to export as single, quantity or as character. Has anyone came across a script that can export to multiple as well as single types? My attempts at amending the script have been slow,but for the script the recognise the multi-code, I am assuming that it will need to be included in the mrset before any scripts are ran? Many thanks


If you reply to this email, your message will be added to the discussion below:
http://spssx-discussion.1045642.n5.nabble.com/Triple-S-exports-with-multiple-variables-tp5720731.html
To start a new topic under SPSSX Discussion, email [hidden email]
To unsubscribe from SPSSX Discussion, click here.
NAML

Art Kendall
Social Research Consultants
Reply | Threaded
Open this post in threaded view
|

Re: Triple S exports with multiple variables

David Marso
Administrator
In reply to this post by Amy_Hynd
Despite my incomparable ESPss and InterNeTelepathy skills, I have absolutely NO idea of what you are trying to do -what we have here is a failure to communicate-.  Please elaborate and provide more detail? What the H is Triple S? What do you mean by multi-code?  Which specific script are you diddling around with?
--
Amy_Hynd wrote
Hi,

I have been using the export script from http://pages.infinit.net/rlevesqu/SampleScripts.htm and this only offers the solution to export as single, quantity or as character.

Has anyone came across a script that can export to multiple as well as single types?

My attempts at amending the script have been slow,but for the script the recognise the multi-code, I am assuming that it will need to be included in the mrset before any scripts are ran?

Many thanks
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me.
---
"Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis."
Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?"
Reply | Threaded
Open this post in threaded view
|

Re: Triple S exports with multiple variables

Amy_Hynd
In reply to this post by Art Kendall
Hi,

I have a survey data set that contains multiple types of variable types and require this dataset to be imported to another software that uses triple S/ XML.  

I have very little knowledge of XML and do not use it that often, but with multiple response questions (where a respondent can select more than one answer) - it is appearing as multiple single choice questions rather than as one multiple question.

So for a multiple question in SPSS which looks like:
B3A_01 B3A_02 B3A_03 B3A_04 B3A_05 B3A_06 B3A_07 B3A_08
6 7
1 6
2
2 1


I would like the triple s to look like so:
- <variable ident="32" type="multiple">
  <name>B3A</name> 
  <label>Question text(s)?</label> 
  <position start="689" finish="708" /> 
  <spread subfields="10" width="2" /> 
- <values>
  <value code="1">A</value> 
  <value code="2">B</value> 
  <value code="3">C</value> 
  <value code="4">D</value> 
  <value code="5">E</value> 
  <value code="6">F</value> 
  <value code="7">F=G</value> 
  <value code="8">H</value> 
  <value code="9">I/value>
  <value code="10">J/value>

but the script <a href="http://">http://pages.infinit.net/rlevesqu/Scripts/ImportExport/Export2Triple-S.txt (although I am using a slightly amended version for 2.0) exports the data as follows:


- <variable ident="26" type="single">
  <name>B3A_01</name> 
  <label>Question text</label> 
  <position start="6119" finish="6120" /> 
- <values>
  <value code="1">A</value> 
  <value code="2">B</value> 
  <value code="3">C</value> 
  <value code="4">D</value> 
  <value code="5">E</value> 
  <value code="6">F</value> 
  <value code="7">G</value> 
  <value code="8">H</value> 
  </values>
  </variable>
- <variable ident="27" type="single">
  <name>B3A_02</name> 
  <label>Question Text</label> 
  <position start="6121" finish="6122" /> 
- <values>
  <value code="1">A</value> 
  <value code="2">B</value> 
  <value code="3">C</value> 
  <value code="4">D</value> 
  <value code="5">E</value> 
  <value code="6">F</value> 
  <value code="7">G</value> 
  <value code="8">H</value> 

Any help would be greatly appreciated.
Reply | Threaded
Open this post in threaded view
|

Re: Triple S exports with multiple variables

news
In reply to this post by Amy_Hynd
Hi,
What is the program you want to export to ?
Can't it read csv formatted input ?

Regards,
F. Thomas

On 14/06/2013 17:28, Amy_Hynd wrote:

> Hi, I have been using the export script from
> http://pages.infinit.net/rlevesqu/SampleScripts.htm and this only
> offers the solution to export as single, quantity or as character. Has
> anyone came across a script that can export to multiple as well as
> single types? My attempts at amending the script have been slow,but
> for the script the recognise the multi-code, I am assuming that it
> will need to be included in the mrset before any scripts are ran? Many
> thanks
> ------------------------------------------------------------------------
> View this message in context: Triple S exports with multiple variables
> <http://spssx-discussion.1045642.n5.nabble.com/Triple-S-exports-with-multiple-variables-tp5720731.html>
> Sent from the SPSSX Discussion mailing list archive
> <http://spssx-discussion.1045642.n5.nabble.com/> at Nabble.com.

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
Reply | Threaded
Open this post in threaded view
|

Re: Triple S exports with multiple variables

Jon K Peck
In reply to this post by Amy_Hynd
I don't know how you are producing the SPSS dictionary information as xml, but the spss.CreateXmlDictionary api, which is the only way I can think of for doing this for SPSS Statistics using built-in capabilities, reflects the actual structure of multiple response data in the SPSS dictionary.   Such variables are actually a collection of ordinary variables that each have their own dictionary information, but the XML contains a set definition element that contains the information that makes them into a set.  Thus the XML would have to be manipulated into the S3 format.

But if you are using Data Collection rather than SPSS Statistics or a third-party tool, there may be a different story.


Jon Peck (no "h") aka Kim
Senior Software Engineer, IBM
[hidden email]
phone: 720-342-5621




From:        Amy_Hynd <[hidden email]>
To:        [hidden email],
Date:        06/17/2013 02:28 AM
Subject:        Re: [SPSSX-L] Triple S exports with multiple variables
Sent by:        "SPSSX(r) Discussion" <[hidden email]>




Hi,

I have a survey data set that contains multiple types of variable types and
require this dataset to be imported to another software that uses triple S/
XML.

I have very little knowledge of XML and do not use it that often, but with
multiple response questions (where a respondent can select more than one
answer) - it is appearing as multiple single choice questions rather than as
one multiple question.

So for a multiple question in SPSS which looks like:
B3A_01  B3A_02  B3A_03  B3A_04  B3A_05  B3A_06  B3A_07  B3A_08
6       7
1       6
2
2       1


I would like the triple s to look like so:
- <variable ident="32" type="multiple">
 <name>B3A</name>
 <label>Question text(s)?</label>
 <position start="689" finish="708" />
 <spread subfields="10" width="2" />
- <values>
 <value code="1">A</value>
 <value code="2">B</value>
 <value code="3">C</value>
 <value code="4">D</value>
 <value code="5">E</value>
 <value code="6">F</value>
 <value code="7">F=G</value>
 <value code="8">H</value>
 <value code="9">I/value>
 <value code="10">J/value>

but the script
http://pages.infinit.net/rlevesqu/Scripts/ImportExport/Export2Triple-S.txt
<http://>   (although I am using a slightly amended version for 2.0) exports
the data as follows:


- <variable ident="26" type="single">
 <name>B3A_01</name>
 <label>Question text</label>
 <position start="6119" finish="6120" />
- <values>
 <value code="1">A</value>
 <value code="2">B</value>
 <value code="3">C</value>
 <value code="4">D</value>
 <value code="5">E</value>
 <value code="6">F</value>
 <value code="7">G</value>
 <value code="8">H</value>
 </values>
 </variable>
- <variable ident="27" type="single">
 <name>B3A_02</name>
 <label>Question Text</label>
 <position start="6121" finish="6122" />
- <values>
 <value code="1">A</value>
 <value code="2">B</value>
 <value code="3">C</value>
 <value code="4">D</value>
 <value code="5">E</value>
 <value code="6">F</value>
 <value code="7">G</value>
 <value code="8">H</value>

Any help would be greatly appreciated.



--
View this message in context:
http://spssx-discussion.1045642.n5.nabble.com/Triple-S-exports-with-multiple-variables-tp5720731p5720755.html
Sent from the SPSSX Discussion mailing list archive at Nabble.com.

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD


Reply | Threaded
Open this post in threaded view
|

Re: Triple S exports with multiple variables

Art Kendall
In reply to this post by Amy_Hynd
I have the impression that the script is pretty old.

Wheels are frequently re-invented in the different analysis worlds.
There are often different names for identical analyses.

Please describe what analysis you are trying to do.
Sometimes it is no longer necessary to move out of SPSS to do things.

Art Kendall
Social Research Consultants
On 6/14/2013 11:28 AM, Amy_Hynd [via SPSSX Discussion] wrote:
Hi, I have been using the export script from http://pages.infinit.net/rlevesqu/SampleScripts.htm and this only offers the solution to export as single, quantity or as character. Has anyone came across a script that can export to multiple as well as single types? My attempts at amending the script have been slow,but for the script the recognise the multi-code, I am assuming that it will need to be included in the mrset before any scripts are ran? Many thanks


If you reply to this email, your message will be added to the discussion below:
http://spssx-discussion.1045642.n5.nabble.com/Triple-S-exports-with-multiple-variables-tp5720731.html
To start a new topic under SPSSX Discussion, email [hidden email]
To unsubscribe from SPSSX Discussion, click here.
NAML

Art Kendall
Social Research Consultants
Reply | Threaded
Open this post in threaded view
|

Re: Triple S exports with multiple variables

Jon Johnson-3
Hi Amy

As seemingly one of the few people on this familiar with Triple-S! Triple S operates at a variable level, so i am not sure that this is a valid thing to be doing, as presumably a multi-code will be split over several variables?


--------------------------------------------
Jon Johnson
Senior Database Manager
Centre for Longitudinal Studies
Tel: 0 207 612 6571
Email: [hidden email]
Twitter: CLScohorts
________________________________________
From: SPSSX(r) Discussion [[hidden email]] On Behalf Of Art Kendall [[hidden email]]
Sent: 17 June 2013 15:40
To: [hidden email]
Subject: Re: Triple S exports with multiple variables

I have the impression that the script is pretty old.

Wheels are frequently re-invented in the different analysis worlds. There are often different names for identical analyses.

Please describe what analysis you are trying to do.
Sometimes it is no longer necessary to move out of SPSS to do things.


Art Kendall
Social Research Consultants

On 6/14/2013 11:28 AM, Amy_Hynd [via SPSSX Discussion] wrote:
Hi, I have been using the export script from http://pages.infinit.net/rlevesqu/SampleScripts.htm and this only offers the solution to export as single, quantity or as character. Has anyone came across a script that can export to multiple as well as single types? My attempts at amending the script have been slow,but for the script the recognise the multi-code, I am assuming that it will need to be included in the mrset before any scripts are ran? Many thanks

________________________________
If you reply to this email, your message will be added to the discussion below:
http://spssx-discussion.1045642.n5.nabble.com/Triple-S-exports-with-multiple-variables-tp5720731.html
To start a new topic under SPSSX Discussion, email [hidden email]</user/SendEmail.jtp?type=node&node=5720762&i=0>
To unsubscribe from SPSSX Discussion, click here.
NAML<http://spssx-discussion.1045642.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>

Art Kendall
Social Research Consultants

________________________________
View this message in context: Re: Triple S exports with multiple variables<http://spssx-discussion.1045642.n5.nabble.com/Triple-S-exports-with-multiple-variables-tp5720731p5720762.html>
Sent from the SPSSX Discussion mailing list archive<http://spssx-discussion.1045642.n5.nabble.com/> at Nabble.com.

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
Reply | Threaded
Open this post in threaded view
|

Re: Triple S exports with multiple variables

Amy_Hynd
Hi,

I am using SPSS Statistics and I am using the script (link above) to produce the dictionary as XML.

I have the data in SPSS but it needs to be imported into another platform for further research and the quickest way that this can be done is via triple S. So at this point, no analysis is required.

Jon, I think you are right, and I don't understand triple s entirely, but I know the variable needs to turn into a spread variable?So it would be B3, rather than B3_01, B3_02 - in the same way that MRSETS create it I assume?

I'm going to try and refer the script to if it in MRSET =multiple=spread?

Do you think that this may work?

Thanks
Reply | Threaded
Open this post in threaded view
|

Re: Triple S exports with multiple variables

Amy_Hynd
In reply to this post by news
Hi,

It can do, however with triple S- it contains the dictionary/background data that we need to move across as well.
Reply | Threaded
Open this post in threaded view
|

Re: Triple S exports with multiple variables

Art Kendall
In reply to this post by Amy_Hynd
What does "the other platform" do that cannot be done with SPSS, SPSS with R, or saved, as a STATA dataset, or saved as a SAS data set?
Most of the current stat packages read at least one of those kinds of dataset.
Art Kendall
Social Research Consultants
On 6/18/2013 4:44 AM, Amy_Hynd [via SPSSX Discussion] wrote:
Hi,

I am using SPSS Statistics and I am using the script (link above) to produce the dictionary as XML.

I have the data in SPSS but it needs to be imported into another platform for further research and the quickest way that this can be done is via triple S. So at this point, no analysis is required.

Jon, I think you are right, and I don't understand triple s entirely, but I know the variable needs to turn into a spread variable?So it would be B3, rather than B3_01, B3_02 - in the same way that MRSETS create it I assume?

I'm going to try and refer the script to if it in MRSET =multiple=spread?

Do you think that this may work?

Thanks


If you reply to this email, your message will be added to the discussion below:
http://spssx-discussion.1045642.n5.nabble.com/Triple-S-exports-with-multiple-variables-tp5720731p5720783.html
To start a new topic under SPSSX Discussion, email [hidden email]
To unsubscribe from SPSSX Discussion, click here.
NAML

Art Kendall
Social Research Consultants
Reply | Threaded
Open this post in threaded view
|

Re: Triple S exports with multiple variables

Jon K Peck
In reply to this post by Amy_Hynd
I have no idea what Triple S expects, but are you sure that you can't transfer the data in Statistics to the other package using one of the many formats Statistics can write to (Excel, SAS, Stata, csv, fixed ascii, databases,...)?


Jon Peck (no "h") aka Kim
Senior Software Engineer, IBM
[hidden email]
phone: 720-342-5621




From:        Amy_Hynd <[hidden email]>
To:        [hidden email],
Date:        06/18/2013 02:46 AM
Subject:        Re: [SPSSX-L] Triple S exports with multiple variables
Sent by:        "SPSSX(r) Discussion" <[hidden email]>




Hi,

I am using SPSS Statistics and I am using the script (link above) to produce
the dictionary as XML.

I have the data in SPSS but it needs to be imported into another platform
for further research and the quickest way that this can be done is via
triple S. So at this point, no analysis is required.

Jon, I think you are right, and I don't understand triple s entirely, but I
know the variable needs to turn into a spread variable?So it would be B3,
rather than B3_01, B3_02 - in the same way that MRSETS create it I assume?

I'm going to try and refer the script to if it in MRSET =multiple=spread?

Do you think that this may work?

Thanks



--
View this message in context:
http://spssx-discussion.1045642.n5.nabble.com/Triple-S-exports-with-multiple-variables-tp5720731p5720783.html
Sent from the SPSSX Discussion mailing list archive at Nabble.com.

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD


Reply | Threaded
Open this post in threaded view
|

Creating a new variable from duplicate and non-duplicate records

Zana Dael
In reply to this post by David Marso

Hello
 
In my file I have adult offender ID’s with many court cases. Some IDs have duplicate cases, which I need to keep because they have different hearing outcomes, some cases within the same ID are not duplicates and a few IDs have no duplicate cases.  Within each ID, I want to grab one of the duplicate case types and all of the unique case types and put into a different variable (UniqueCases).  The casetype is numerical but I am using text in the example to illustrate what I am trying to achieve.  
 
How do I get to uniquecases?
 
ID            CaseNumber    CaseType              dup        UniqueCases
1              68                           theft                      1                           theft
1              68                           theft                      1
1              72                           drugs                    0                           drugs
2              208                         assault                  0                           assault
2              108                         DWI                    0                           DWI
3              319                         Burg                     0                           Burg
4              522                         Drugs                   0                           Drug
4              533                         Theft                    0                           Theft
4              556                         Assault                 1                           Assault
4              556                         Assault                 1
4              556                         Assault                 1

Thanks

Zeda
Reply | Threaded
Open this post in threaded view
|

Re: Creating a new variable from duplicate and non-duplicate records

Maguin, Eugene

You may want something different but you could use Aggregate and break on id and case number or case type. That would result in two records for id=1, two for id=2, one for id=3 and three for id=4.

Gene Maguin

 

From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Zd Gibbs
Sent: Tuesday, June 18, 2013 10:49 AM
To: [hidden email]
Subject: Creating a new variable from duplicate and non-duplicate records

 

 

Hello

 

In my file I have adult offender ID’s with many court cases. Some IDs have duplicate cases, which I need to keep because they have different hearing outcomes, some cases within the same ID are not duplicates and a few IDs have no duplicate cases.  Within each ID, I want to grab one of the duplicate case types and all of the unique case types and put into a different variable (UniqueCases).  The casetype is numerical but I am using text in the example to illustrate what I am trying to achieve.  

 

How do I get to uniquecases?

 

ID            CaseNumber    CaseType              dup                               UniqueCases

1              68                           theft                      1                           theft

1              68                           theft                      1

1              72                           drugs                    0                           drugs

2              208                         assault                  0                           assault

2              108                         DWI                    0                           DWI

3              319                         Burg                     0                           Burg

4              522                         Drugs                   0                           Drug

4              533                         Theft                    0                           Theft

4              556                         Assault                 1                           Assault

4              556                         Assault                 1

4              556                         Assault                 1

 

Thanks

 

Zeda

Reply | Threaded
Open this post in threaded view
|

Re: Creating a new variable from duplicate and non-duplicate records

Zana Dael
Gene,

I tried that and it just replicated the data from casetype to First(casetype) - I got the same data in each of the two variables (using pasted syntax below). Is it possible to turn the duplicate casetypes into missing so that data is excluded from analyses?

SORT CASES BY ID casenum.
AGGREGATE
  /OUTFILE=* MODE=ADDVARIABLES 
  /PRESORTED
  /BREAK=ID casenum
  /casetype_first=FIRST(casetype).

Zeda


From: "Maguin, Eugene" <[hidden email]>
To: [hidden email]
Sent: Tuesday, June 18, 2013 10:16 AM
Subject: Re: Creating a new variable from duplicate and non-duplicate records

You may want something different but you could use Aggregate and break on id and case number or case type. That would result in two records for id=1, two for id=2, one for id=3 and three for id=4.
Gene Maguin
 
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Zd Gibbs
Sent: Tuesday, June 18, 2013 10:49 AM
To: [hidden email]
Subject: Creating a new variable from duplicate and non-duplicate records
 
 
Hello
 
In my file I have adult offender ID’s with many court cases. Some IDs have duplicate cases, which I need to keep because they have different hearing outcomes, some cases within the same ID are not duplicates and a few IDs have no duplicate cases.  Within each ID, I want to grab one of the duplicate case types and all of the unique case types and put into a different variable (UniqueCases).  The casetype is numerical but I am using text in the example to illustrate what I am trying to achieve.  
 
How do I get to uniquecases?
 
ID            CaseNumber    CaseType              dup                               UniqueCases
1              68                           theft                      1                           theft
1              68                           theft                      1
1              72                           drugs                    0                           drugs
2              208                         assault                  0                           assault
2              108                         DWI                    0                           DWI
3              319                         Burg                     0                           Burg
4              522                         Drugs                   0                           Drug
4              533                         Theft                    0                           Theft
4              556                         Assault                 1                           Assault
4              556                         Assault                 1
4              556                         Assault                 1
 
Thanks
 
Zeda


Reply | Threaded
Open this post in threaded view
|

Re: Creating a new variable from duplicate and non-duplicate records

Bruce Weaver
Administrator
First, note that by replying to an old message (rather than starting a new thread), you caused your post to become buried in the Triple S exports thread in the Nabble archive for this list.  

Second, does the following do what you want?

* Read in some sample data.
NEW FILE.
DATASET CLOSE all.
DATA LIST list / ID  CaseNumber (2f5.0)    CaseType (a25).
BEGIN DATA
1              68                           theft
1              68                           theft
1              72                           drugs
2              208                         assault
2              108                         DWI    
3              319                         Burg  
4              522                         Drugs  
4              533                         Theft  
4              556                         Assault
4              556                         Assault
4              556                         Assault
END DATA.

SORT CASES BY ID CaseNumber.
COMPUTE FirstCase = ($casenum EQ 1) OR NOT (ID EQ Lag(ID) and CaseNumber EQ Lag(CaseNumber)).
COMPUTE Duplicate = NOT FirstCase.
FORMATS FirstCase Duplicate (f1).
LIST.

FILTER BY FirstCase.
* Do your analysis.
USE ALL.
FILTER OFF.



Zd Gibbs wrote
Gene,

I tried that and it just replicated the data from casetype to First(casetype) - I got the same data in each of the two variables (using pasted syntax below). Is it possible to turn the duplicate casetypes into missing so that data is excluded from analyses?

SORT CASES BY ID casenum.
AGGREGATE
  /OUTFILE=* MODE=ADDVARIABLES 
  /PRESORTED
  /BREAK=ID casenum
  /casetype_first=FIRST(casetype).

Zeda


________________________________
 From: "Maguin, Eugene" <[hidden email]>
To: [hidden email] 
Sent: Tuesday, June 18, 2013 10:16 AM
Subject: Re: Creating a new variable from duplicate and non-duplicate              records
 


You may want something different but you could use Aggregate and break on id and case number or case type. That would result in two records for id=1, two for id=2, one for id=3 and three for id=4.
Gene Maguin
 
From:SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Zd Gibbs
Sent: Tuesday, June 18, 2013 10:49 AM
To: [hidden email]
Subject: Creating a new variable from duplicate and non-duplicate records
 
 
Hello
 
In my file I have adult offender ID’s with many court cases. Some IDs have duplicate cases, which I need to keep because they have different hearing outcomes, some cases within the same ID are not duplicates and a few IDs have no duplicate cases.  Within each ID, I want to grab one of the duplicate case types and all of the unique case types and put into a different variable (UniqueCases).  The casetype is numerical but I am using text in the example to illustrate what I am trying to achieve.  
 
How do I get to uniquecases?
 
ID            CaseNumber    CaseType              dup                               UniqueCases
1              68                           theft                      1                           theft
1              68                           theft                      1
1              72                           drugs                    0                           drugs
2              208                         assault                  0                           assault
2              108                         DWI                    0                           DWI
3              319                         Burg                     0                           Burg
4              522                         Drugs                   0                           Drug
4              533                         Theft                    0                           Theft
4              556                         Assault                 1                           Assault
4              556                         Assault                 1
4              556                         Assault                 1
 
Thanks
 
Zeda
--
Bruce Weaver
bweaver@lakeheadu.ca
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

PLEASE NOTE THE FOLLOWING: 
1. My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above.
2. The SPSSX Discussion forum on Nabble is no longer linked to the SPSSX-L listserv administered by UGA (https://listserv.uga.edu/).
Reply | Threaded
Open this post in threaded view
|

Re: Creating a new variable from duplicate and non-duplicate records

Maguin, Eugene
In reply to this post by Zana Dael

Do this:

 

SORT CASES BY ID casenum.

AGGREGATE

  /OUTFILE=*

  /PRESORTED

  /BREAK=ID casenum

  /casetype_first=FIRST(casetype).

 

 

From: Zd Gibbs [mailto:[hidden email]]
Sent: Tuesday, June 18, 2013 11:36 AM
To: Maguin, Eugene; [hidden email]
Subject: Re: Creating a new variable from duplicate and non-duplicate records

 

Gene,

 

I tried that and it just replicated the data from casetype to First(casetype) - I got the same data in each of the two variables (using pasted syntax below). Is it possible to turn the duplicate casetypes into missing so that data is excluded from analyses?

 

SORT CASES BY ID casenum.

AGGREGATE

  /OUTFILE=* MODE=ADDVARIABLES 

  /PRESORTED

  /BREAK=ID casenum

  /casetype_first=FIRST(casetype).

 

Zeda

 


From: "Maguin, Eugene" <[hidden email]>
To: [hidden email]
Sent: Tuesday, June 18, 2013 10:16 AM
Subject: Re: Creating a new variable from duplicate and non-duplicate records



You may want something different but you could use Aggregate and break on id and case number or case type. That would result in two records for id=1, two for id=2, one for id=3 and three for id=4.

Gene Maguin

 

From: SPSSX(r) Discussion [[hidden email]] On Behalf Of Zd Gibbs
Sent: Tuesday, June 18, 2013 10:49 AM
To: [hidden email]
Subject: Creating a new variable from duplicate and non-duplicate records

 

 

Hello

 

In my file I have adult offender ID’s with many court cases. Some IDs have duplicate cases, which I need to keep because they have different hearing outcomes, some cases within the same ID are not duplicates and a few IDs have no duplicate cases.  Within each ID, I want to grab one of the duplicate case types and all of the unique case types and put into a different variable (UniqueCases).  The casetype is numerical but I am using text in the example to illustrate what I am trying to achieve.  

 

How do I get to uniquecases?

 

ID            CaseNumber    CaseType              dup                               UniqueCases

1              68                           theft                      1                           theft

1              68                           theft                      1

1              72                           drugs                    0                           drugs

2              208                         assault                  0                           assault

2              108                         DWI                    0                           DWI

3              319                         Burg                     0                           Burg

4              522                         Drugs                   0                           Drug

4              533                         Theft                    0                           Theft

4              556                         Assault                 1                           Assault

4              556                         Assault                 1

4              556                         Assault                 1

 

Thanks

 

Zeda

 

Reply | Threaded
Open this post in threaded view
|

Re: Triple S exports with multiple variables

Jon Johnson-3
In reply to this post by Jon K Peck

Can I suggest that people who do not know anything about Triple-S refrain from commenting This is actually a very sensible question and is about how to manipulate SPSS before writing it out in a specific file format called Triple-S.

 

Thanks

Jon Johnson

 

 

 

 

From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Jon K Peck
Sent: 18 June 2013 14:26
To: [hidden email]
Subject: Re: Triple S exports with multiple variables

 

I have no idea what Triple S expects, but are you sure that you can't transfer the data in Statistics to the other package using one of the many formats Statistics can write to (Excel, SAS, Stata, csv, fixed ascii, databases,...)?


Jon Peck (no "h") aka Kim
Senior Software Engineer, IBM
[hidden email]
phone: 720-342-5621




From:        Amy_Hynd <[hidden email]>
To:        [hidden email],
Date:        06/18/2013 02:46 AM
Subject:        Re: [SPSSX-L] Triple S exports with multiple variables
Sent by:        "SPSSX(r) Discussion" <[hidden email]>





Hi,

I am using SPSS Statistics and I am using the script (link above) to produce
the dictionary as XML.

I have the data in SPSS but it needs to be imported into another platform
for further research and the quickest way that this can be done is via
triple S. So at this point, no analysis is required.

Jon, I think you are right, and I don't understand triple s entirely, but I
know the variable needs to turn into a spread variable?So it would be B3,
rather than B3_01, B3_02 - in the same way that MRSETS create it I assume?

I'm going to try and refer the script to if it in MRSET =multiple=spread?

Do you think that this may work?

Thanks



--
View this message in context:
http://spssx-discussion.1045642.n5.nabble.com/Triple-S-exports-with-multiple-variables-tp5720731p5720783.html
Sent from the SPSSX Discussion mailing list archive at Nabble.com.

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD

Reply | Threaded
Open this post in threaded view
|

Re: Triple S exports with multiple variables

Mike
I apologize ahead of time for what I am about to say since I have to admit
that I do not know anything about Triple-S.  However, I do know how to
search and locate information.  For general info on Triple-S, see:
 
NOTE:  Triple-S appears to be relevant to analysis of survey data.
 
For some papers and presentation on Triple-S, see:
 
There are utility software for converting Triple-S to different formats,
including one program that converts SPSS files into Triple-S XML; see:
NOTE: the SPSS to Triple-S converting software does not work with
SPSS v19.  People interested in Triple-S might want to examine this
website for additional info though it doesn't seem to me to being kept
up to date.
 
-Mike Palij
New York University
 
 
----- Original Message -----
Sent: Tuesday, June 18, 2013 12:21 PM
Subject: Re: Triple S exports with multiple variables

Can I suggest that people who do not know anything about Triple-S refrain from commenting This is actually a very sensible question and is about how to manipulate SPSS before writing it out in a specific file format called Triple-S.

 

Thanks

Jon Johnson

 

 

 

 

From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Jon K Peck
Sent: 18 June 2013 14:26
To: [hidden email]
Subject: Re: Triple S exports with multiple variables

 

I have no idea what Triple S expects, but are you sure that you can't transfer the data in Statistics to the other package using one of the many formats Statistics can write to (Excel, SAS, Stata, csv, fixed ascii, databases,...)?


Jon Peck (no "h") aka Kim
Senior Software Engineer, IBM
[hidden email]
phone: 720-342-5621




From:        Amy_Hynd <[hidden email]>
To:        [hidden email],
Date:        06/18/2013 02:46 AM
Subject:        Re: [SPSSX-L] Triple S exports with multiple variables
Sent by:        "SPSSX(r) Discussion" <[hidden email]>





Hi,

I am using SPSS Statistics and I am using the script (link above) to produce
the dictionary as XML.

I have the data in SPSS but it needs to be imported into another platform
for further research and the quickest way that this can be done is via
triple S. So at this point, no analysis is required.

Jon, I think you are right, and I don't understand triple s entirely, but I
know the variable needs to turn into a spread variable?So it would be B3,
rather than B3_01, B3_02 - in the same way that MRSETS create it I assume?

I'm going to try and refer the script to if it in MRSET =multiple=spread?

Do you think that this may work?

Thanks



--
View this message in context:
http://spssx-discussion.1045642.n5.nabble.com/Triple-S-exports-with-multiple-variables-tp5720731p5720783.html
Sent from the SPSSX Discussion mailing list archive at Nabble.com.

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD

Reply | Threaded
Open this post in threaded view
|

Re: Triple S exports with multiple variables

Art Kendall
In reply to this post by Jon Johnson-3
It is true that I have not used the specifics of Triple S for at least 15 years. 
StatTransfer supports it as one of its formats.
http://www.stattransfer.com/stattransfer/formats.html
I do not recall that I have had to use StatTransfer since I retired in 2001.

Since SPSS made its I/O .dlls available for free quite some time ago, I have come across very few times that it has been necessary to go outside one of the major packages.  These days I advise agencies that are releasing public use files to prepare the files in SPSS with all of the meta data (data view) filled in then save the data in other formats which retain less of the meta data.
[Jon can probably tell the list when it was that the .dlls were released.]

When SPSS included CTABLES, multilevel modeling, and Categories, it became even less necessary for me to transfer the data in other formats.

I have been on SPSS news groups since at least the early 80's.  Since 1973 I have been teaching people in statistical and methodological consulting that "the presenting question is rarely the question that the client wants answered."  This is the same in psych, education, legal, medical, and other consulting realms.  I do try to get the context in which the question is formulated.

Around 1980, I ditched hundreds of ad hoc programs.  The same about 1992.   As the years went on my experience (YMMV) has been that It is less and less necessary to use single/few purpose pieces of software.

Is it not possible that writing data out in Triple S is a roundabout way to get to a goal?


Art Kendall
Social Research Consultants
On 6/18/2013 12:24 PM, Jon Johnson-3 [via SPSSX Discussion] wrote:

Can I suggest that people who do not know anything about Triple-S refrain from commenting This is actually a very sensible question and is about how to manipulate SPSS before writing it out in a specific file format called Triple-S.

 

Thanks

Jon Johnson

 

 

 

 

From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Jon K Peck
Sent: 18 June 2013 14:26
To: [hidden email]
Subject: Re: Triple S exports with multiple variables

 

I have no idea what Triple S expects, but are you sure that you can't transfer the data in Statistics to the other package using one of the many formats Statistics can write to (Excel, SAS, Stata, csv, fixed ascii, databases,...)?


Jon Peck (no "h") aka Kim
Senior Software Engineer, IBM
[hidden email]
phone: 720-342-5621




From:        Amy_Hynd <[hidden email]>
To:        [hidden email],
Date:        06/18/2013 02:46 AM
Subject:        Re: [SPSSX-L] Triple S exports with multiple variables
Sent by:        "SPSSX(r) Discussion" <[hidden email]>





Hi,

I am using SPSS Statistics and I am using the script (link above) to produce
the dictionary as XML.

I have the data in SPSS but it needs to be imported into another platform
for further research and the quickest way that this can be done is via
triple S. So at this point, no analysis is required.

Jon, I think you are right, and I don't understand triple s entirely, but I
know the variable needs to turn into a spread variable?So it would be B3,
rather than B3_01, B3_02 - in the same way that MRSETS create it I assume?

I'm going to try and refer the script to if it in MRSET =multiple=spread?

Do you think that this may work?

Thanks



--
View this message in context:
http://spssx-discussion.1045642.n5.nabble.com/Triple-S-exports-with-multiple-variables-tp5720731p5720783.html
Sent from the SPSSX Discussion mailing list archive at Nabble.com.

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD




If you reply to this email, your message will be added to the discussion below:
http://spssx-discussion.1045642.n5.nabble.com/Triple-S-exports-with-multiple-variables-tp5720731p5720794.html
To start a new topic under SPSSX Discussion, email [hidden email]
To unsubscribe from SPSSX Discussion, click here.
NAML

Art Kendall
Social Research Consultants
12