Printing string variables

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

Printing string variables

Luniana KitKat
I would like to be able to print out the responses in a string variable.  At the moment I am asking SPSS to show me the tables using the "SUMMARIZE" command.  The problem is SPSS also shows the instances where the field has been left blank, making for a long, mostly empty table.  How do I tell SPSS to only include instances where something has been written in the field, and not all the fields?  

This is the syntax I am currently using:

SUMMARIZE
  /TABLES=FNUM q1
  /FORMAT=VALIDLIST NOCASENUM TOTAL LIMIT=100
  /TITLE='Q1 Family Name'
  /MISSING=VARIABLE
  /CELLS=COUNT .

Thank you for your help,
Carrie Fischer


_________________________________________________________________
Use fowl language with Chicktionary. Click here to start playing!
http://puzzles.sympatico.msn.ca/chicktionary/index.html?icid=htmlsig
====================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: Printing string variables

ViAnn Beadle
You can filter the set of cases being read by the SUMMARIZE command using
the SELECT IF or FILTER command. Specify a logical expression for SELECT IF
such as

SELECT IF (q1 ne '').

Filter takes a variable name whose values are 0 or 1 so you could compute a
variable which takes on the value 1 when the variable is non-empty:

IF (q1 ne '') q1answered = 1.
FILTER BY q1answered.

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of
Luniana KitKat
Sent: Thursday, January 03, 2008 4:40 PM
To: [hidden email]
Subject: Printing string variables

I would like to be able to print out the responses in a string variable.  At
the moment I am asking SPSS to show me the tables using the "SUMMARIZE"
command.  The problem is SPSS also shows the instances where the field has
been left blank, making for a long, mostly empty table.  How do I tell SPSS
to only include instances where something has been written in the field, and
not all the fields?

This is the syntax I am currently using:

SUMMARIZE
  /TABLES=FNUM q1
  /FORMAT=VALIDLIST NOCASENUM TOTAL LIMIT=100
  /TITLE='Q1 Family Name'
  /MISSING=VARIABLE
  /CELLS=COUNT .

Thank you for your help,
Carrie Fischer


_________________________________________________________________
Use fowl language with Chicktionary. Click here to start playing!
http://puzzles.sympatico.msn.ca/chicktionary/index.html?icid=htmlsig
=======
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

=====================
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: Printing string variables

Oliver, Richard
Alternatively:

MISSING VALUES q1 (' ').
SUMMARIZE
  /TABLES=fnum q1
  /FORMAT=VALIDLIST NOCASENUM TOTAL
  /TITLE='Q1 Family Name'
  /MISSING=TABLE
  /CELLS=COUNT.

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of ViAnn Beadle
Sent: Thursday, January 03, 2008 7:47 PM
To: [hidden email]
Subject: Re: Printing string variables

You can filter the set of cases being read by the SUMMARIZE command using
the SELECT IF or FILTER command. Specify a logical expression for SELECT IF
such as

SELECT IF (q1 ne '').

Filter takes a variable name whose values are 0 or 1 so you could compute a
variable which takes on the value 1 when the variable is non-empty:

IF (q1 ne '') q1answered = 1.
FILTER BY q1answered.

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of
Luniana KitKat
Sent: Thursday, January 03, 2008 4:40 PM
To: [hidden email]
Subject: Printing string variables

I would like to be able to print out the responses in a string variable.  At
the moment I am asking SPSS to show me the tables using the "SUMMARIZE"
command.  The problem is SPSS also shows the instances where the field has
been left blank, making for a long, mostly empty table.  How do I tell SPSS
to only include instances where something has been written in the field, and
not all the fields?

This is the syntax I am currently using:

SUMMARIZE
  /TABLES=FNUM q1
  /FORMAT=VALIDLIST NOCASENUM TOTAL LIMIT=100
  /TITLE='Q1 Family Name'
  /MISSING=VARIABLE
  /CELLS=COUNT .

Thank you for your help,
Carrie Fischer


_________________________________________________________________
Use fowl language with Chicktionary. Click here to start playing!
http://puzzles.sympatico.msn.ca/chicktionary/index.html?icid=htmlsig
=======
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

=====================
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

=====================
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: Printing string variables

Oliver, Richard
In reply to this post by Luniana KitKat
Minor clarification:

Prior to SPSS 16, you could not assign missing values to long string variables (string variables with a defined width of more than 8 bytes).

-----Original Message-----
From: Oliver, Richard
Sent: Friday, January 04, 2008 8:06 AM
To: 'ViAnn Beadle'; [hidden email]
Subject: RE: Re: Printing string variables

Alternatively:

MISSING VALUES q1 (' ').
SUMMARIZE
  /TABLES=fnum q1
  /FORMAT=VALIDLIST NOCASENUM TOTAL
  /TITLE='Q1 Family Name'
  /MISSING=TABLE
  /CELLS=COUNT.

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of ViAnn Beadle
Sent: Thursday, January 03, 2008 7:47 PM
To: [hidden email]
Subject: Re: Printing string variables

You can filter the set of cases being read by the SUMMARIZE command using
the SELECT IF or FILTER command. Specify a logical expression for SELECT IF
such as

SELECT IF (q1 ne '').

Filter takes a variable name whose values are 0 or 1 so you could compute a
variable which takes on the value 1 when the variable is non-empty:

IF (q1 ne '') q1answered = 1.
FILTER BY q1answered.

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of
Luniana KitKat
Sent: Thursday, January 03, 2008 4:40 PM
To: [hidden email]
Subject: Printing string variables

I would like to be able to print out the responses in a string variable.  At
the moment I am asking SPSS to show me the tables using the "SUMMARIZE"
command.  The problem is SPSS also shows the instances where the field has
been left blank, making for a long, mostly empty table.  How do I tell SPSS
to only include instances where something has been written in the field, and
not all the fields?

This is the syntax I am currently using:

SUMMARIZE
  /TABLES=FNUM q1
  /FORMAT=VALIDLIST NOCASENUM TOTAL LIMIT=100
  /TITLE='Q1 Family Name'
  /MISSING=VARIABLE
  /CELLS=COUNT .

Thank you for your help,
Carrie Fischer


_________________________________________________________________
Use fowl language with Chicktionary. Click here to start playing!
http://puzzles.sympatico.msn.ca/chicktionary/index.html?icid=htmlsig
=======
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

=====================
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

=====================
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: Printing string variables

Hal 9000
Luniana,

My favorite for on-the-fly data checking is:

temp.
select if (state conditions defining values you want to exclude here).
list vars.

-Gary

=====================
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