Art
If you are going to do any subsequent analysis using such long variable names, that requires a lot of typing if you use syntax rather than the GUI. Why not use something like:
rename var (var00001 to var00012 = x1 to x12).
var lab
x1 ‘Rank in the Fifty States 2011’
x2 ‘Rank in all states amp territories 2010’
x3 ’State or territory’
x4 ‘Population estimate for July 12011’
x5 ‘Census population April 1 2010’
x6 .Census population April 1 2000’
x7 ‘Seats in US House 2003 â 2013’
x8 ‘Presidential Electors 2012 â 2020’
x9 ‘@ 2010 Census Popper House seat4’
x10 ‘@ 2000 Census Popper House seat’
x11 ‘@ 2000 Census Popper Pres Elector’
x12 ‘Pct Total US Pop 2010’.
format x1 x2 (f2.0) /x3 (a26)
/x4 to x6 x9 to x11 (comma10)
/x7 x8 (f3.0).
alter type x12 (pct7.2).
sort cases by x3.
Etc etc
Watching Sandy in horror over here in France. Thinking of you all.
John F Hall (Mr)
Email: [hidden email]
Website: www.surveyresearch.weebly.com
-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Art Kendall
Sent: 30 October 2012 19:56
To: [hidden email]
Subject: getting state by state pop electoral votes etc, from a web page table
This is how I was able to pick up a table from a web page on wiki.
*
open
http://en.wikipedia.org/wiki/List_of_U.S._states_and_territories_by_population
highlight upper left and lower right corners, paste into a data window.
rename variables (var00001 to var00012 =
RankintheFiftyStates2011
Rankinallstatesampterritories2010
Stateorterritory
PopulationestimateforJuly12011
CensuspopulationApril12010
CensuspopulationApril12000
SeatsinUSHouse2003â2013
PresidentialElectors2012â2020
@2010CensusPopperHouseseat4
@2000CensusPopperHouseseat
@2000CensusPopperPresElector
PctTotalUSPop2010).
formats
RankintheFiftyStates2011
Rankinallstatesampterritories2010 (f2)
Stateorterritory (a26)
PopulationestimateforJuly12011
CensuspopulationApril12010
CensuspopulationApril12000 (comma10)
SeatsinUSHouse2003â2013
PresidentialElectors2012â2020 (f3)
@2010CensusPopperHouseseat4
@2000CensusPopperHouseseat
@2000CensusPopperPresElector(comma10).
alter type PctTotalUSPop2010 (pct7.2).
sort cases by Stateorterritory.
DATASET NAME WIKI.
SAVE OUTFILE='C:\project\wiki.sav'
/COMPRESSED.
Later I'll post this data with FIPScodes PO codes, and whether they were affected by Hurricane Sandy.
Also, if I get it to work I'll post the syntax to map states affected by Sandy.
--
Art Kendall
Social Research Consultants
=====================
To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD
Free forum by Nabble | Edit this page |