27.03.2013 Views

SPSS® 12.0 Command Syntax Reference

SPSS® 12.0 Command Syntax Reference

SPSS® 12.0 Command Syntax Reference

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

894<br />

MAPS<br />

Example<br />

one instance of each value of the key variable in the file, the x/y coordinates are taken from<br />

the first occurrence of that value in the data. (The assumption is that all occurrences of the<br />

same key value, such as the identity of an office at a particular location, will have the same<br />

x/y coordinates.)<br />

MAPS<br />

/XY = VAR(x) VAR(y) VAR(company)<br />

/GSET = ’United States’<br />

/SYMBOLMAP= VAR(sales) SUM=(SUM).<br />

• Each company in the data file has unique coordinates, designated x and y. (If some companies<br />

had more than one location, it would be necessary to have a variable that designated<br />

each location so that all locations would be shown.)<br />

• A new layer named Company (XY) is created in the geoset.<br />

• The total (sum) of sales to each company will be represented in the size of a symbol at<br />

each of the x/y points.<br />

LOOKUP Subcommand<br />

Example<br />

The LOOKUP subcommand extends the capability of the XY subcommand. It allows you to<br />

use coordinates from an existing table to create a new layer in your geoset. For example, if<br />

you have zip codes in your data but no x/y coordinates to represent zip codes on your map,<br />

and your geoset does not contain a zip code layer, you can instruct SPSS Maps to look up the<br />

coordinates in a table and create a new layer, just as in XY binding. In this case, you provide<br />

the name of the variable that you want to match to geographic coordinates and the name of<br />

the file that contains those coordinates. The data are aggregated on that variable and then<br />

matched to values in the lookup table (exactly as geographic variables are matched), and the<br />

resulting layer is included in the geoset.<br />

The lookup file can be any table in the MapInfo format to which data could be bound. The<br />

layer constructed by LOOKUP contains points only for points present in the data, not for all<br />

points that might be present in the lookup file. Therefore, the LOOKUP subcommand can be<br />

useful whenever you want to create a layer containing just the points of interest to you—a<br />

selection of cities, perhaps, instead of all of the cities in a geoset layer.<br />

MAPS<br />

/LOOKUP = VAR(zip) ’C:\\Program Files\spss10\Maps\ZIPCODE.TAB’<br />

/GSET = ’United States’<br />

/SYMBOLMAP= VAR(sales) SUM=(SUM).<br />

• The SPSS data file contains the zip codes in the variable ZIP.<br />

• The file ZIPCODE.TAB contains zip codes and the x/y coordinates of their centroids.<br />

• A new layer containing the coordinates of each zip code in the SPSS data file is added to<br />

the geoset.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!