Copying variable attributes

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

Copying variable attributes

Mike Pritchard-4
I think I'm looking for a way to copy variable attributes to other in bulk.  But it is probably a good idea to explain the background in case the list members have better ideas on how to tackle my problem.

I've got one SPSS file as an export from my survey tool - call it File A.  The file has fairly good labels and value labels but the variable names are just the internal variable names from the tool (which has regressed in this respect from previous versions).  This file is also incomplete because something in my survey is breaking the export, so the support people created a file for me manually while the problem is being addressed.

The second SPSS file (File B) was created from Excel from a CSV export from the survey tool with the complete set of responses.  This has good variable names, but of course no labels or values.

To add a little more complexity, the files don't exactly match in the variables or attributes.  There are some differences in the reference variables at the beginning that are easily handled.  Some variables from the original questionnaire aren't present in the Excel file (I think just because nobody chose that option); some variables are strings in File B with the Other included but separate variables in File A; File A has checkbox variables as 0 or 1 while File B has them coded as the option number.  These are things that can be handled with recoding. 

The reason I don't want to just do this manually is that there are 121 variables for each of 10 categories, plus a few others.  Apart from the time and tedium, it is pretty error prone, so the more I can automate the better.  Right now I'm copying variable labels and values from File A to File B, and then adjusting for the differences.

Any suggestions would be most appreciated.

Thanks!
Mike

Reply | Threaded
Open this post in threaded view
|

Re: Copying variable attributes

Jon K Peck

Take a look at APPLY DICTIONARY.  Probably the easiest way would be to do one massive rename so that the variables match up, and then you can copy selected properties keyed by the matching names.

HTH,
Jon Peck
SPSS, an IBM Company
[hidden email]
312-651-3435



From: Mike Pritchard <[hidden email]>
To: [hidden email]
Date: 09/01/2010 08:54 AM
Subject: [SPSSX-L] Copying variable attributes
Sent by: "SPSSX(r) Discussion" <[hidden email]>





I think I'm looking for a way to copy variable attributes to other in bulk.  But it is probably a good idea to explain the background in case the list members have better ideas on how to tackle my problem.

I've got one SPSS file as an export from my survey tool - call it File A.  The file has fairly good labels and value labels but the variable names are just the internal variable names from the tool (which has regressed in this respect from previous versions).  This file is also incomplete because something in my survey is breaking the export, so the support people created a file for me manually while the problem is being addressed.

The second SPSS file (File B) was created from Excel from a CSV export from the survey tool with the complete set of responses.  This has good variable names, but of course no labels or values.

To add a little more complexity, the files don't exactly match in the variables or attributes.  There are some differences in the reference variables at the beginning that are easily handled.  Some variables from the original questionnaire aren't present in the Excel file (I think just because nobody chose that option); some variables are strings in File B with the Other included but separate variables in File A; File A has checkbox variables as 0 or 1 while File B has them coded as the option number.  These are things that can be handled with recoding. 

The reason I don't want to just do this manually is that there are 121 variables for each of 10 categories, plus a few others.  Apart from the time and tedium, it is pretty error prone, so the more I can automate the better.  Right now I'm copying variable labels and values from File A to File B, and then adjusting for the differences.

Any suggestions would be most appreciated.

Thanks!
Mike


Reply | Threaded
Open this post in threaded view
|

Re: Copying variable attributes

Mike Pritchard

Thanks Jon,  that helped.  I’ve still got a few messy variables because the types in Excel weren’t created consistently – because of content – but I’m a lot closer now.

 

Mike

 

_________________________________________________________________________
Mike Pritchard | [hidden email] | 5 Circles Research | 425-444-3410
Helping companies delight their customers to increase profits

The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential, proprietary, and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from all computers.

From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Jon K Peck
Sent: Wednesday, September 01, 2010 8:16 AM
To: [hidden email]
Subject: Re: Copying variable attributes

 


Take a look at APPLY DICTIONARY.  Probably the easiest way would be to do one massive rename so that the variables match up, and then you can copy selected properties keyed by the matching names.

HTH,
Jon Peck
SPSS, an IBM Company
[hidden email]
312-651-3435


From:

Mike Pritchard <[hidden email]>

To:

[hidden email]

Date:

09/01/2010 08:54 AM

Subject:

[SPSSX-L] Copying variable attributes

Sent by:

"SPSSX(r) Discussion" <[hidden email]>

 





I think I'm looking for a way to copy variable attributes to other in bulk.  But it is probably a good idea to explain the background in case the list members have better ideas on how to tackle my problem.

I've got one SPSS file as an export from my survey tool - call it File A.  The file has fairly good labels and value labels but the variable names are just the internal variable names from the tool (which has regressed in this respect from previous versions).  This file is also incomplete because something in my survey is breaking the export, so the support people created a file for me manually while the problem is being addressed.

The second SPSS file (File B) was created from Excel from a CSV export from the survey tool with the complete set of responses.  This has good variable names, but of course no labels or values.

To add a little more complexity, the files don't exactly match in the variables or attributes.  There are some differences in the reference variables at the beginning that are easily handled.  Some variables from the original questionnaire aren't present in the Excel file (I think just because nobody chose that option); some variables are strings in File B with the Other included but separate variables in File A; File A has checkbox variables as 0 or 1 while File B has them coded as the option number.  These are things that can be handled with recoding. 

The reason I don't want to just do this manually is that there are 121 variables for each of 10 categories, plus a few others.  Apart from the time and tedium, it is pretty error prone, so the more I can automate the better.  Right now I'm copying variable labels and values from File A to File B, and then adjusting for the differences.

Any suggestions would be most appreciated.

Thanks!
Mike