Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Importing Labels and Values

2,276 views
Skip to first unread message

Parag

unread,
Jul 15, 2010, 9:43:00 PM7/15/10
to
How may I import Labels and Values which are stored in a separate data
files to the primary data I've imported?

I assume this would need the use of a script?

I am aware you can copy/paste Labels & Values from say an Excel file,
but this assumes two things:

1. The row (or columns are equal)
2. For every single variable there is only 1 label or value.

In my case, we have for example, a 1-10 likert scale for one variable
and say a Yes/No for another variable.

Accordingly, I have a file which is structured like this:

Variable1 Label1 Value1
Variable1 Label2 Value2
Variable1 Label3 Value3
Variable2 Label1 Value1
Variable3 Label1 Value1
Variable3 Label2 Value2

I would be appreciative of any help. I am unsure why its so difficult
to import labels and values into SPSS when this is something you'd be
able to simply import to?

For large data sets, are SPSS users seriously entering these in
manually?

JKPeck

unread,
Jul 15, 2010, 10:26:05 PM7/15/10
to

Look at the APPLY DICTIONARY command. It allows you to copy various
variable and data file properties from one SAV file to the active
file.

HTH,
Jon Peck

Bruce Weaver

unread,
Jul 16, 2010, 7:23:12 AM7/16/10
to

This did not strike me as an APPLY DICTIONARY problem--i.e., I didn't
see anything that made me think there was an existing .SAV file with
all of the desired labels. Rather, I understood the OP to be saying
that they have one Excel file (or worksheet) that contains the actual
data, and another Excel file/worksheet that contains value labels. So
the question is how to convert

Variable1 Label1 Value1
Variable1 Label2 Value2
Variable1 Label3 Value3
Variable2 Label1 Value1
Variable3 Label1 Value1
Variable3 Label2 Value2

into:

VALUE LABELS
Variable1 {value1} "Label1"
{value2} "Label2"
{value3} "Label3" /
Variable2 {value1} "Label1" /
Variable3 {value1} "Label1"
{value2} "Label2"
.

--
Bruce Weaver
bwe...@lakeheadu.ca
http://sites.google.com/a/lakeheadu.ca/bweaver/Home
"When all else fails, RTFM."

JKPeck

unread,
Jul 16, 2010, 8:41:31 AM7/16/10
to
> bwea...@lakeheadu.cahttp://sites.google.com/a/lakeheadu.ca/bweaver/Home

> "When all else fails, RTFM."

If you are right, Bruce, my approach would be to read in the Excel
label file as an SPSS dataset and then build the labels. This would
require a program, but it would be pretty simple. I can work out
details if we have confirmation

Regards,
Jon

fred....@lsc.gov.uk

unread,
Jul 19, 2010, 4:20:28 AM7/19/10
to
Don't you just need a formula in excel that adds all the info
together, something like

=IF(A2=A1," "&C2&" @"&B2&"@"," /"&A1&" "&C2&" @"&B2&"@")

then copy the results into a syntax file and find and replace the @
with quotes, something goes screwy when you transfer quotes from excel
to spss

> Jon- Hide quoted text -
>
> - Show quoted text -

nrst...@gmail.com

unread,
Feb 11, 2014, 10:59:56 AM2/11/14
to
I see this is an old thread, but I was wondering if anyone figured this issue out.

I have an excel worksheet with variable names, codes, and labels just as Parag originally described. This is a separate worksheet to my database.

I used ODK to create a survey form on mobile phones using an excel format which lists out variable codes and labels. The data is exported in XLS or CSV and when I move that into SPSS I'd love to save myself the effort of entering all of the variable codes and labels manually.

Any help would be great.
Thanks!
Nick

lars.o...@gmail.com

unread,
Feb 13, 2015, 4:36:20 AM2/13/15
to
0 new messages