Login  Register

getting state by state pop electoral votes etc, from a web page table

Posted by Art Kendall on Oct 30, 2012; 6:56pm
URL: http://spssx-discussion.165.s1.nabble.com/getting-state-by-state-pop-electoral-votes-etc-from-a-web-page-table-tp5715953.html

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
Art Kendall
Social Research Consultants