Path to mathematics-SPSS memo (1), path to mathematics-spss memo
1. import data.
Create a script to open the seismic data.
Open an excel file
Get data/TYPE = XLSX
/FILE = 'H: \ mybook \ 4.5_month.xlsx'
/SHEET = name '4. 5_month'
/CELLRANGE = full
/READNAMES = on
/ASSUMEDSTRWIDTH = 32767.
EXECUTE.
Dataset name dataset 1 WINDOW = FRONT.
Save it as openxls. sps, and then run it
Open a csv file
Get data/TYPE = TXT
/FILE = "H: \ mybook \ 4.5_month.csv"
/DELCASE = LINE
/DELIMITERS = ","
/ARRANGEMENT = DELIMITED
/FIRSTCASE = 2
/IMPORTCASE = ALL
/VARIABLES =
Time A24
Latitude F8.4
Longpolling F9.4
Depth F6.2
Mag F3.1
MagType A3
Nst F2.0
Gap F5.1
Dmin F10.8
Rms F4.2
Net A2
Id A10
Updated A24
Place A17
Type A12
CACHE.
EXECUTE.
Dataset name: seismic data WINDOW = FRONT.
All content of this blog is original, if reproduced please indicate the source http://blog.csdn.net/myhaspl/
3. Save as a sav File
SAVEOUTFILE = 'H: \ mybook \ src \ 4.5 _ month. sav'
/COMPRESSED.
4. Open the sav File
And add a field
Get file = 'H: \ mybook \ machine learning version 3rd-2 \ src \ 4.5 _ month. sav'
/KEEP time depthmag
/RENAME time = time depth = earthquake depth mag = Magnitude.
STRING seismic category (A12 ).
IF (magnitude GT 3 AND magnitude LT 5) earthquake type = "Weak Earthquake ".
IF (magnitude GE 5 AND magnitude LT 7) Seismic Category = "Strong Earthquake ".
IF magnitude GE 7 earthquake type = "earthquake ".
EXECUTE.