Syntax Question

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

Syntax Question

fgallo
Hi All,



I have several variables:



when plevel1 occurs the value equals 1, plevel2 equals 2, plevel3 equals
3.plevel8 equals 8

when slevel1 occurs the value equals 1. slevel5 equals 5



I would like to compute the frequencies when:    p variables > s variables,
p variables = s variables, p variables < s variables



I appreciate any help with creating syntax for this problem.



Best,

Frank
Reply | Threaded
Open this post in threaded view
|

Re: Syntax Question: Compare 'p' and 's' variable sets

Richard Ristow
At 05:54 PM 4/14/2007, fgallo wrote:

>when plevel1 occurs the value equals 1, plevel2 equals 2, plevel3
>equals
>3.plevel8 equals 8
>
>when slevel1 occurs the value equals 1. slevel5 equals 5
>
>I would like to compute the frequencies when:
>p variables > s variables,
>p variables = s variables,
>p variables < s variables

You don't pose your question very clearly. I am guessing that,
. You mean
THE NUMBER OF VALID VALUES of the p variables >
THE NUMBER OF VALID VALUES of the s variables,
. All variables either have the values you list, or are system missing.

Then (untested).
(WATCH IT: Adding EXECUTE statements can break this code.)

NUMERIC    P_VS_S  (F2).
VAR LABELS P_VS_S
     "Valid value counts, 'plevel' vs. 'slevel' variables".
VAL LABELS P_VS_S
     1 "More valid 'plevel's"
     2 "Equal numbers valid"
     3 "More valid 'slevel's".
COMPUTE #Valid_P = NVALID(plevel1 TO plevel8).
COMPUTE #Valid_S = NVALID(slevel1 TO slevel5).

IF #Valid_P LT #Valid_S   P_VS_S = 1.
IF #Valid_P EQ #Valid_S   P_VS_S = 2.
IF #Valid_P GT #Valid_S   P_VS_S = 3.
..................
Or maybe, you mean
THE MAXIMUM OBSERVED VALUE of the p variables >
THE MAXIMUM OBSERVED VALUE of the s variables

Then, very similar (also untested),

NUMERIC    P_VS_S  (F2).
VAR LABELS P_VS_S
     "Valid value counts, 'plevel' vs. 'slevel' variables".
VAL LABELS P_VS_S
     1 "Largest 'plevel' higher"
     2 "Highest levels equal"
     3 "Largest 'slevel' higher'".
COMPUTE #Max_P = MAX(plevel1 TO plevel8).
COMPUTE #Max_S = MAX(slevel1 TO slevel5).

IF #Max_P LT #Max_S   P_VS_S = 1.
IF #Max_P EQ #Max_S   P_VS_S = 2.
IF #Max_P GT #Max_S   P_VS_S = 3.
Reply | Threaded
Open this post in threaded view
|

Re: Syntax Question

Melissa Ives
In reply to this post by fgallo
Is there a reason you have 8 individual variables for plevel and
presumably for slevel?
Can they be a single variable plevel/slevel where the value is the
response or do the individual values matter?
What happens to plevel1 when plevel is equal to 2?

When you are creating your new indicator--are you looking for one
variable or several?
Can a single record have more than one plevel?  Slevel? Or are you
looking for the highest level?
(if lowest level, change max to min).

If it's one variable indicating the highest level, that's easy...
**.
compute
pleveltop=max(plevel1,plevel2,plevel3,plevel4,plevel5,plevel6,plevel7,pl
evel8).
compute sleveltop=max(plevel1,plevel2,plevel3,plevel4,plevel5).
If (pleveltop>sleveltop) PSstat=1.
If (pleveltop=sleveltop) PSstat=2.
If (pleveltop<sleveltop) PSstat=3.
Value labels Psstat 1 'P>S' 2 'P=S' 3 'P<S'.

I'm guessing you may have something different in mind...
You'll need to provide more information.

Melissa

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of
fgallo
Sent: Saturday, April 14, 2007 4:55 PM
To: [hidden email]
Subject: [SPSSX-L] Syntax Question

Hi All,



I have several variables:



when plevel1 occurs the value equals 1, plevel2 equals 2, plevel3 equals
3.plevel8 equals 8

when slevel1 occurs the value equals 1. slevel5 equals 5



I would like to compute the frequencies when:    p variables > s
variables,
p variables = s variables, p variables < s variables



I appreciate any help with creating syntax for this problem.



Best,

Frank


PRIVILEGED AND CONFIDENTIAL INFORMATION
This transmittal and any attachments may contain PRIVILEGED AND
CONFIDENTIAL information and is intended only for the use of the
addressee. If you are not the designated recipient, or an employee
or agent authorized to deliver such transmittals to the designated
recipient, you are hereby notified that any dissemination,
copying or publication of this transmittal is strictly prohibited. If
you have received this transmittal in error, please notify us
immediately by replying to the sender and delete this copy from your
system. You may also call us at (309) 827-6026 for assistance.
Reply | Threaded
Open this post in threaded view
|

SPSS 15.0 - an improvement or a nightmare?

Judith Saebel
Dear All,

After having read some of your posts re the erratic behaviour of the
latest SPSS (15.0) version, I'm a bit weary of switching from 14.0 to
15.0.  At the moment I can choose between the two, so I want delay the
changeover as long as possible.

Am I being overly cautious or do the advantages outweigh the problems?

Any advice will be appreciated.

Thanks,

Judith
Reply | Threaded
Open this post in threaded view
|

Re: SPSS 15.0 - an improvement or a nightmare?

Lemon, John S.
Judith et al.

I have now been using 15 for a number of months and find it to be
reliable and robust, I haven't experienced the problems other users have
indicated but perhaps I don't push it as hard as they do !

I do know that when I have to help students on version 14 I feel
frustrated that the new features I have available to be are not there.
New versions of SPSS, including 15, always arrive too late to be
installed in the classrooms for the start of the year.

You can have both versions installed on your machine at the same time so
perhaps you could try that - I think you will move to 15 fairly quickly
!!!

Best Wishes

John S. Lemon
DIT - University of Aberdeen
Edward Wright Building: Room G51
Tel:  +44 1224 273350
Fax: +44 1224 273372



> -----Original Message-----
> From: SPSSX(r) Discussion [mailto:[hidden email]]
> On Behalf Of Judith Saebel
> Sent: Wednesday, April 18, 2007 4:44 AM
> To: [hidden email]
> Subject: SPSS 15.0 - an improvement or a nightmare?
>
> Dear All,
>
> After having read some of your posts re the erratic behaviour of the
> latest SPSS (15.0) version, I'm a bit weary of switching from 14.0 to
> 15.0.  At the moment I can choose between the two, so I want delay the
> changeover as long as possible.
>
> Am I being overly cautious or do the advantages outweigh the problems?
>
> Any advice will be appreciated.
>
> Thanks,
>
> Judith
>
Reply | Threaded
Open this post in threaded view
|

SQL/ODBC: best practices?

Albert-Jan Roskam
Hi all,

I just started working with a number of very large
databases (Microsoft SQL databases of at least 10
million records, and 40-or-so variables), and I would
like to hear some 'best practices' or experiences
about this.

Of course, I can use ODBC in SPSS (we're using v11.5)
to run queries, but I doubt whether this is the best
practice. After all, SPSS is a statistical
application, and although it has some SQL
functionality, I doubt whether this is the best
approach. In particular, SPSS may not be the right
medium for the more complicated queries and
subqueries.

What I would like to do is write queries with an SQL
tool (is SQL Query Analyzer a good choice? I found
that the databases are simply too large for MS
Access),
and run SPSS on the resulting tables. Would this be a
good approach? A very important marginal condition is
that these processes run efficiently (ie., are not too
time-consuming), I found that even the simplest
data-pass requiring activities require
aaaaaaaaaaaaaaaages in SPSS, not to mention caching
these data.

Thank you in advance for your replies!

Albert-Jan

Cheers!
Albert-Jan

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Did you know that 87.166253% of all statistics claim a precision of results that is not justified by the method employed? [HELMUT RICHTER]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
Reply | Threaded
Open this post in threaded view
|

Re: SPSS 15.0 - an improvement or a nightmare?

Mark A Davenport MADAVENP
In reply to this post by Judith Saebel
I wouldn't shy away from 15 in favor of 14.  With the exception of the MS
Vista incompatability (which I would assume also appears with earlier
versions of SPSS), 15 is not particularly unstable; at least no more than
a patched 14.  In fact, my initial impression of 15 is that it was one of
the better initial releases.

***************************************************************************************************************************************************************
Mark A. Davenport Ph.D.
Senior Research Analyst
Office of Institutional Research
The University of North Carolina at Greensboro
336.256.0395
[hidden email]

'An approximate answer to the right question is worth a good deal more
than an exact answer to an approximate question.' --a paraphrase of J. W.
Tukey (1962)






Judith Saebel <[hidden email]>
Sent by: "SPSSX(r) Discussion" <[hidden email]>
04/17/2007 11:43 PM
Please respond to
Judith Saebel <[hidden email]>


To
[hidden email]
cc

Subject
SPSS 15.0 - an improvement or a nightmare?






Dear All,

After having read some of your posts re the erratic behaviour of the
latest SPSS (15.0) version, I'm a bit weary of switching from 14.0 to
15.0.  At the moment I can choose between the two, so I want delay the
changeover as long as possible.

Am I being overly cautious or do the advantages outweigh the problems?

Any advice will be appreciated.

Thanks,

Judith
Reply | Threaded
Open this post in threaded view
|

Re: SQL/ODBC: best practices?

David Wasserman
In reply to this post by Albert-Jan Roskam
In a similar situation seven years ago, I found it was effective to learn
enough SQL to extract just the data (in terms of both records and fields) I
wanted from a large relational database, save the extracted files in .dbf
format, and then read them into SPSS for further analysis.  With the
enhancements to SPSS since then, this may no longer be the most efficient
approach, but it worked well at the time.  The SQL statements would produce
a flat file from the various joined tables, so that the data management in
SPSS was limited to added labels.

David Wasserman
Custom Data Analysis and SPSS Programming

----- Original Message -----
From: "Albert-jan Roskam" <[hidden email]>
To: <[hidden email]>
Sent: Wednesday, April 18, 2007 6:09 AM
Subject: SQL/ODBC: best practices?


> Hi all,
>
> I just started working with a number of very large
> databases (Microsoft SQL databases of at least 10
> million records, and 40-or-so variables), and I would
> like to hear some 'best practices' or experiences
> about this.
>
> Of course, I can use ODBC in SPSS (we're using v11.5)
> to run queries, but I doubt whether this is the best
> practice. After all, SPSS is a statistical
> application, and although it has some SQL
> functionality, I doubt whether this is the best
> approach. In particular, SPSS may not be the right
> medium for the more complicated queries and
> subqueries.
>
> What I would like to do is write queries with an SQL
> tool (is SQL Query Analyzer a good choice? I found
> that the databases are simply too large for MS
> Access),
> and run SPSS on the resulting tables. Would this be a
> good approach? A very important marginal condition is
> that these processes run efficiently (ie., are not too
> time-consuming), I found that even the simplest
> data-pass requiring activities require
> aaaaaaaaaaaaaaaages in SPSS, not to mention caching
> these data.
>
> Thank you in advance for your replies!
>
> Albert-Jan
>
> Cheers!
> Albert-Jan
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Did you know that 87.166253% of all statistics claim a precision of
> results that is not justified by the method employed? [HELMUT RICHTER]
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
Reply | Threaded
Open this post in threaded view
|

Re: SQL/ODBC: best practices?

Dennis Deck
In reply to this post by Albert-Jan Roskam
There are probably a number of good answers to the question depending on
certain factors. Some thoughts:

1) If the data change frequently I read directly from the database as
needed and typically do not save as SAV file.

2) If the data change infrequently and I have to do lots of recodes and
parsing to put the data in useful format, I create a program to do all
this preprocessing and write a SAV file for statistical processing.  I
rerun the program when I get the next update.

3) Regardless of what from the source is in (database or SAV file),
processing will be *much* faster if you limit both the records and
fields you try to load (ie, use /Keep or /Drop to limit fields and
SELECT IF to limit records).

4) Use N OF CASES or use SELECT IF to test your analysis on a subset of
cases to ensure that the program is debugged before doing your
production run.

5) If I have complex joins that would be tricky to setup and debug in
the SPSS GET DATA command I create the join in SQL (or a query tool) and
then point GET DATA to the query rather than the source tables.

6) We use SQL Server as our backend for web databases but find that
Access works well as a front end.  The Access query tool makes short
work of most queries but you can resort to SQL if need be.


Dennis Deck, PhD
RMC Research Corporation
[hidden email]

-----Original Message-----
From: Albert-jan Roskam [mailto:[hidden email]]
Sent: Wednesday, April 18, 2007 5:09 AM
Subject: SQL/ODBC: best practices?

Hi all,

I just started working with a number of very large
databases (Microsoft SQL databases of at least 10
million records, and 40-or-so variables), and I would
like to hear some 'best practices' or experiences
about this.

Of course, I can use ODBC in SPSS (we're using v11.5)
to run queries, but I doubt whether this is the best
practice. After all, SPSS is a statistical
application, and although it has some SQL
functionality, I doubt whether this is the best
approach. In particular, SPSS may not be the right
medium for the more complicated queries and
subqueries.

What I would like to do is write queries with an SQL
tool (is SQL Query Analyzer a good choice? I found
that the databases are simply too large for MS
Access),
and run SPSS on the resulting tables. Would this be a
good approach? A very important marginal condition is
that these processes run efficiently (ie., are not too
time-consuming), I found that even the simplest
data-pass requiring activities require
aaaaaaaaaaaaaaaages in SPSS, not to mention caching
these data.

Thank you in advance for your replies!

Albert-Jan

Cheers!
Albert-Jan

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Did you know that 87.166253% of all statistics claim a precision of
results that is not justified by the method employed? [HELMUT RICHTER]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
Reply | Threaded
Open this post in threaded view
|

AW: SPSS 15.0 - an improvement or a nightmare?

Georg Maubach
In reply to this post by Judith Saebel
Dear Judith,

we are using SPSS 15.0 German version on three different machines on Windows XP and did not encounter any problems doing so. In my opinion you could switch to 15.

Regards

Georg Maubach
Market Analyst

-----Ursprüngliche Nachricht-----
Von: SPSSX(r) Discussion [mailto:[hidden email]] Im Auftrag von Judith Saebel
Gesendet: Mittwoch, 18. April 2007 05:44
An: [hidden email]
Betreff: SPSS 15.0 - an improvement or a nightmare?

Dear All,

After having read some of your posts re the erratic behaviour of the
latest SPSS (15.0) version, I'm a bit weary of switching from 14.0 to
15.0.  At the moment I can choose between the two, so I want delay the
changeover as long as possible.

Am I being overly cautious or do the advantages outweigh the problems?

Any advice will be appreciated.

Thanks,

Judith
Reply | Threaded
Open this post in threaded view
|

Re: AW: SPSS 15.0 - an improvement or a nightmare?

Mark A Davenport MADAVENP
Having been a beta tester for several versions and an active participant
on this list for years, I really don't think the stability differences
people mention are that profound.   Computers come with all sorts of
garbage preinstalled, customized with various whistles, all of which make
comprehensive testing a nightmare.  This says nothing of the multitude of
people that knowingly or unknowingly change settings on their machines.
Despite the horror stories you read about, 15 is no more (in fact,
probably less so) unstable that 14 was.   Frankly, you find this problom
with all technology consumer-based reporting.  For every person that
absolutely hated the product and took the time, effort, and expense to
tell the world about it, there are thousands upon thousands of other users
who had no problems (so they had nothing to report).

That said, if you could say more about the type of environment you will be
installing in (on a network of XP machines, language version, will it be
installed with the 15.0.1 patch before people start using it, etc.) you
might be able to get more useful feedback about the honest potential for
you to have problems.

Georg Maubach below and others using the German Language version will
likely be your best source of information for your sepecific needs.

***************************************************************************************************************************************************************
Mark A. Davenport Ph.D.
Senior Research Analyst
Office of Institutional Research
The University of North Carolina at Greensboro
336.256.0395
[hidden email]

'An approximate answer to the right question is worth a good deal more
than an exact answer to an approximate question.' --a paraphrase of J. W.
Tukey (1962)






Georg Maubach <[hidden email]>
Sent by: "SPSSX(r) Discussion" <[hidden email]>
05/17/2007 10:05 AM
Please respond to
[hidden email]


To
[hidden email]
cc

Subject
AW:      SPSS 15.0 - an improvement or a nightmare?






Dear Judith,

we are using SPSS 15.0 German version on three different machines on
Windows XP and did not encounter any problems doing so. In my opinion you
could switch to 15.

Regards

Georg Maubach
Market Analyst

-----Ursprüngliche Nachricht-----
Von: SPSSX(r) Discussion [mailto:[hidden email]] Im Auftrag von
Judith Saebel
Gesendet: Mittwoch, 18. April 2007 05:44
An: [hidden email]
Betreff: SPSS 15.0 - an improvement or a nightmare?

Dear All,

After having read some of your posts re the erratic behaviour of the
latest SPSS (15.0) version, I'm a bit weary of switching from 14.0 to
15.0.  At the moment I can choose between the two, so I want delay the
changeover as long as possible.

Am I being overly cautious or do the advantages outweigh the problems?

Any advice will be appreciated.

Thanks,

Judith
Reply | Threaded
Open this post in threaded view
|

Re: AW: SPSS 15.0 - an improvement or a nightmare?

zstatman
Well said Mark. I also am a long time beta site and receive several emails a
day regarding SPSS enhancements and/or stability questions. Performance, for
me, has remained on the high side for several versions (I run both V14+ &
V15+ on the same machine [XP Pro, P4 2.4GHz with 512 MB of RAM]). I do run 3
HDs so spread out the work load but this shouldn't affect SPSS' stability,
etc.

WMB
Statistical Services

=========================================
mailto:[hidden email]
http://home.earthlink.net/~statmanz
=========================================

Virus Scan Notice: This email is certified to be virus free.

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of
Mark A Davenport MADAVENP
Sent: Thursday, May 17, 2007 10:33 AM
To: [hidden email]
Subject: Re: AW: SPSS 15.0 - an improvement or a nightmare?

Having been a beta tester for several versions and an active participant on
this list for years, I really don't think the stability differences
people mention are that profound.   Computers come with all sorts of
garbage preinstalled, customized with various whistles, all of which make
comprehensive testing a nightmare.  This says nothing of the multitude of
people that knowingly or unknowingly change settings on their machines.
Despite the horror stories you read about, 15 is no more (in fact,
probably less so) unstable that 14 was.   Frankly, you find this problom
with all technology consumer-based reporting.  For every person that
absolutely hated the product and took the time, effort, and expense to tell
the world about it, there are thousands upon thousands of other users who
had no problems (so they had nothing to report).

That said, if you could say more about the type of environment you will be
installing in (on a network of XP machines, language version, will it be
installed with the 15.0.1 patch before people start using it, etc.) you
might be able to get more useful feedback about the honest potential for you
to have problems.

Georg Maubach below and others using the German Language version will likely
be your best source of information for your sepecific needs.

****************************************************************************
****************************************************************************
*******
Mark A. Davenport Ph.D.
Senior Research Analyst
Office of Institutional Research
The University of North Carolina at Greensboro
336.256.0395
[hidden email]

'An approximate answer to the right question is worth a good deal more than
an exact answer to an approximate question.' --a paraphrase of J. W.
Tukey (1962)






Georg Maubach <[hidden email]>
Sent by: "SPSSX(r) Discussion" <[hidden email]>
05/17/2007 10:05 AM
Please respond to
[hidden email]


To
[hidden email]
cc

Subject
AW:      SPSS 15.0 - an improvement or a nightmare?






Dear Judith,

we are using SPSS 15.0 German version on three different machines on
Windows XP and did not encounter any problems doing so. In my opinion you
could switch to 15.

Regards

Georg Maubach
Market Analyst

-----Ursprüngliche Nachricht-----
Von: SPSSX(r) Discussion [mailto:[hidden email]] Im Auftrag von
Judith Saebel
Gesendet: Mittwoch, 18. April 2007 05:44
An: [hidden email]
Betreff: SPSS 15.0 - an improvement or a nightmare?

Dear All,

After having read some of your posts re the erratic behaviour of the
latest SPSS (15.0) version, I'm a bit weary of switching from 14.0 to
15.0.  At the moment I can choose between the two, so I want delay the
changeover as long as possible.

Am I being overly cautious or do the advantages outweigh the problems?

Any advice will be appreciated.

Thanks,

Judith
Will
Statistical Services
 
============
info.statman@earthlink.net
http://home.earthlink.net/~z_statman/
============