Text fields

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

Text fields

Bob Schacht-3
Seems to me that I recall that someone mentioned that SPSS can do variable
length text fields, like Microsoft Access does. Is this true, and if so, is
this capability available in ver. 12?

Also, I have heard that SPSS can do more "relational" database things than
it used to be able to handle, like linking two databases (at least 1:1)
without merging them. Is this true, and if so, is this capability available
in ver. 12?

The basic reason for my question is that I'm working with a survey that is
mostly fixed response (Yes/No; multiple choice), but has some open-ended
fields. The problem with old-style flat tables, of course, is that you had
to make every field wide enough to hold the widest data for that field, so
that if you have an open-ended response item that 90% never answer, 9%
provide a short answer, and 1% provide a really long answer, then you still
have to allocate space for the field based on the longest answer, which of
course wastes a lot of space, and impairs the use of flat tables for
qualitative analysis.

How are others handling these problems now?

Thanks,
Bob

Robert M. Schacht, Ph.D. <[hidden email]>
Pacific Basin Rehabilitation Research & Training Center
1268 Young Street, Suite #204
Research Center, University of Hawaii
Honolulu, HI 96814
Reply | Threaded
Open this post in threaded view
|

Re: Text fields

Richard Ristow
At 04:06 PM 8/11/2006, Bob Schacht wrote:

>Seems to me that I recall that someone mentioned that SPSS can do
>variable length text fields, like Microsoft Access does. Is this true,
>and if so, is this capability available in ver. 12?

Alas, no, nor in any actual or contemplated version I know of.

>Also, I have heard that SPSS can things like linking two databases (at
>least 1:1)
>without merging them.

Not that, either, again in any version I know of.

>The problem is with a field that 90% never answer, 9% provide a short
>answer, and 1% provide a really long answer. O, of course, is that you
>have to make every field wide enough to hold the widest data for that
>fieldd, so that if you have an open-ended response item that 90% never
>answer, 9% provide a short answer, and 1% provide a really long
>answer, then you still have to allocate space for the field based on
>the longest answer, which of course wastes a lot of space

First, this is one case where save-file compression (it's the default,
but can also be specified) may help a lot. Try a test with a large
subset of the file, and compare actual saved size vs. worst-case size.
You may be all right.

Second, you don't have to like this, but if you can live with your file
always sorted by Rspdt_ID, and three saved files, you can do something
like this (code not tested). It assumes file handles MAIN, Long_Ans,
Shrt_Ans, whose meanings should become clear. I'll give your
long-response variable the name VERBOSE.
.  It may not save enough additional space to be worth using file
Shrt_Ans. Try it.
.  You can extend this to any number of such fields. You need two (or
one) auxiliary files for each, and separate DO IF/ XSAVE logic for
each.


*  To write the survey file:         .
*  --------------------------------- .

<Code to read the survey records, including VERBOSE in its long form>

*  The following COMPUTE is a general good idea:.

COMPUTE VERBOSE = LTRIM(VERBOSE).

*  Skip the following if you don't need it:     .

SORT CASES BY Rspdt_ID.

*  Write three files: Long responses, short responses,.
*  and everything else.                               .
*  (Choose length of CONCISE as appropriate, but to   .
*  get best use of it, its length should be a         .
*  multiple of 8)                                     .

STRING  CONCISE (A8).
DO IF   LENGTH(RTRIM(VERBOSE)) GT 8.
.  XSAVE OUTFILE = LONG_ANS
        /KEEP = Rspdt_ID VERBOSE.
ELSE IF LENGTH(RTRIM(VERBOSE)) GT 1.
.  COMPUTE CONCISE = VERBOSE.
.  XSAVE OUTFILE = Shrt_Ans
        /KEEP = Rspdt_ID CONCISE.
END IF.
SAVE OUTFILE= MAIN
        /DROP= VERBOSE CONCISE.

*  To read  the survey file:         .
*  --------------------------------- .
*  This reloads VERBOSE. In runs that.
*  don't use VERBOSE, a simple       .
*  .  GET FILE MAIN.                 .
*  will suffice.                     .

MATCH FILES
   /FILE=MAIN
   /FILE=Long_Ans
   /FILE=Shrt_Ans
   /BY Rspdt_ID.
IF (VERBOSE EQ ' ')
     VERBOSE = CONCISE.
Reply | Threaded
Open this post in threaded view
|

Re: Text fields

Jeff-125
In reply to this post by Bob Schacht-3
At 03:06 PM 8/11/2006, you wrote:

>The basic reason for my question is that I'm working with a survey that is
>mostly fixed response (Yes/No; multiple choice), but has some open-ended
>fields. The problem with old-style flat tables, of course, is that you had
>to make every field wide enough to hold the widest data for that field, so
>that if you have an open-ended response item that 90% never answer, 9%
>provide a short answer, and 1% provide a really long answer, then you still
>have to allocate space for the field based on the longest answer, which of
>course wastes a lot of space, and impairs the use of flat tables for
>qualitative analysis.
>
>How are others handling these problems now?
>
>Thanks,
>Bob


...pretty much as you mentioned in terms of an informal "relational
database" - 2 tables, one for the traditional main survey where each
row is a respondent and each column is a survey answer. the second
table contains only three columns, a) respondent ID (matched to the
main table), b) question number, c) question answer

You still have to allocate enough space in c to hold the maximum
answer length, but now you only use 1 row and 1 column for each
actual answer provided to the open-ended questions rather than 1
column per question per row regardless of whether the questions were
answered or not. Given your scenario where 90% never answer, this
will save a great deal of space, but it won't do anything to minimize
the space taken by the 9% who only give the short answer since that
will still take the same space as the 1% with the long answers.

by the way, are you aware that your computer is about a year and a
half off on its date?

Jeff
Reply | Threaded
Open this post in threaded view
|

Re: Text fields

Dennis Deck
In reply to this post by Bob Schacht-3
I'm not sure about your terminology but options are:

A) read each of the 2 database tables (eg from Access) using GET DATA
and then join them using MATCH FILES

B) set up a query to do the join in the database and then point the GET
DATA wizard to the query rather than the original tables.

In general I prefer option B.  It saves steps and the SQL code in the
GET DATA can simply be "SELECT * FROM qryMyQuery"



Dennis Deck, PhD
RMC Research Corporation
[hidden email]

-----Original Message-----
From: Bob Schacht [mailto:[hidden email]]
Sent: Friday, August 11, 2006 1:07 PM
Subject: Text fields

Seems to me that I recall that someone mentioned that SPSS can do
variable
length text fields, like Microsoft Access does. Is this true, and if so,
is
this capability available in ver. 12?

Also, I have heard that SPSS can do more "relational" database things
than
it used to be able to handle, like linking two databases (at least 1:1)
without merging them. Is this true, and if so, is this capability
available
in ver. 12?

The basic reason for my question is that I'm working with a survey that
is
mostly fixed response (Yes/No; multiple choice), but has some open-ended
fields. The problem with old-style flat tables, of course, is that you
had
to make every field wide enough to hold the widest data for that field,
so
that if you have an open-ended response item that 90% never answer, 9%
provide a short answer, and 1% provide a really long answer, then you
still
have to allocate space for the field based on the longest answer, which
of
course wastes a lot of space, and impairs the use of flat tables for
qualitative analysis.

How are others handling these problems now?

Thanks,
Bob

Robert M. Schacht, Ph.D. <[hidden email]>
Pacific Basin Rehabilitation Research & Training Center
1268 Young Street, Suite #204
Research Center, University of Hawaii
Honolulu, HI 96814