=========================================================================
Date: Tue, 18 Jul 2006 11:37:04 -0500
Reply-To: "Peck, Jon" <peck@spss.com>
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: "Peck, Jon" <peck@spss.com>
Subject: Re: SV: For those in need of running SAS using an SPSS
file
Content-Type: text/plain; charset="UTF-8"
First, let's correct the facts. SPSS in fact does have a matrix language built in. It has 18 statement types, 59 functions, and 20 operators. Users on this list have posted extensive programs using it.
Second, using the programmability features of SPSS 14, you have access to a vast array of scientifically oriented modules from third parties. For example, scipy and numpy can be downloaded free and used within SPSS.
Here is the summary description of scipy
SciPy is an open source library of scientific tools for Python. SciPy gathers a variety of high level science and engineering modules together as a single package. SciPy provides modules for statistics, optimization, integration, linear algebra, Fourier transforms, signal and image processing, genetic algorithms, ODE solvers, special functions, and more. SciPy requires and supplements NumPy, which provides a multidimensional array object and other basic functionality.
Here are a few random examples of simple things you can do with this library within BEGIN PROGRAM in SPSS. Since you can read the SPSS cases and output in this mode, the inputs can be anything in SPSS.
factorial and combination functions:
import scipy
scipy.factorial(4)
-> array(24.0)
int(scipy.factorial(4))
-> 24
scipy.factorial(4.1)
-> array(27.931753738368371) (Gamma function)
scipy.factorial(50, exact=1)
-> 30414093201713378043612608166064768844377641568960512000000000000L
matrix operations:
import scipy
A = scipy.mat('[1 3 5;2 5 1;2 3 8]')
print A
-> matrix [[1 3 5]
[2 5 1]
[2 3 8]]
print A.I
-> matrix([[-1.48, 0.36, 0.88],
[ 0.56, 0.08, -0.36],
[ 0.16, -0.12, 0.04]])
(A * A.I = identity matrix)
scipy.linalg.det(A)
-> -25
solving linear equations (nonlinear also available):
from scipy import *
A= mat('[1 3 5;2 5 1;2 3 8]')
b = mat('[10;8;3]')
Solve linear equations Ax = b...
A.I*b
or
linalg.solve(A,b)
Regards,
Jon Peck
SPSS
-----Original Message-----
From: SPSSX(r) Discussion [mailto:SPSSX-L@LISTSERV.UGA.EDU] On Behalf Of Joseph Teitelman temp2
Sent: Tuesday, July 18, 2006 9:15 AM
To: SPSSX-L@LISTSERV.UGA.EDU
Subject: Re: [SPSSX-L] SV: For those in need of running SAS using an SPSS file
[snip]
Next, Stat/IML is a matrix programming language which comes along with SAS. It is extremely powerful. SPSS has no matrix programming language. And from what I've been told, neither does Stata.
[>>>Peck, Jon] [snip]
Those were my impressions.
|