[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Xtab with strings/compute question
From: |
John Darrington |
Subject: |
Re: Xtab with strings/compute question |
Date: |
Wed, 27 Oct 2010 07:49:16 +0000 |
User-agent: |
Mutt/1.5.18 (2008-05-17) |
On Tue, Oct 26, 2010 at 10:44:39AM -0700, Sierra Bravo wrote:
Dear all
I'm trying to crosstabulate two string variables, and it seems to be
instantly crashing the system. The syntax I'm using is the following:
CROSSTABS
/TABLES= Col1 Col2 BY Col44
/FORMAT=AVALUE LABELS TABLES PIVOT
/STATISTICS=CHISQ
/CELLS=COUNT ROW COLUMN TOTAL.
Col1, Col2 and Col44 are string variables (1 & 2 are variables such as
'Agree', 'Diagree' and 44 is 'a. 1-3 years', 'b. 3-5 years', 'c. 5-8
years'
etc). Is there some other recommended way to do a cross tab of this kind?
You don't mention which version of PSPP you are using. There have been several
bugs
with crosstabs fixed recently. Perhaps it would be worth trying a later
version.
Also, I tried to create a new variable as follows (in order to extract the
first letter):
COMPUTE CAT=SUBSTRING(Col44,1,1)
The function is "substr" not "substring". Also, string variables (unlike
numeric ones) must be explicitly declared before they are assigned. So
something like:
STRING CAT (A1).
COMPUTE CAT=SUBSTR(Col44,1,1)
should do what you're attempting.
J'
--
PGP Public key ID: 1024D/2DE827B3
fingerprint = 8797 A26D 0854 2EAB 0285 A290 8A67 719C 2DE8 27B3
See http://pgp.mit.edu or any PGP keyserver for public key.
signature.asc
Description: Digital signature