Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Correlation Matrix Problem
Alright, so I have a bunch of data from elections, one of the questions was to break the data down by state and look at the racial demographics (percentage of each race that makes up the state population) and compare that to the Republican Relative Vote for 2016 election. I have all of the data in a dataframe where the State acts as the index, it looks like this:

These are the column headings

White (Not Latino) Population : (percentage) for all races
African American Population
Native American Population
Asian American Population
Latino Population
White Asian
Other Race or Races
Republican Relative Vote 08 (decimal percentage)
Republican Relative Vote 12
Republican Relative Vote 16
ST : abbreviation for state

how do I create a correlation matrix from this?

I tried df.corr(), but it just gave me a matrix excluding all of the racial data. I need correlations between each race and the relative vote count, grouped by state.

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  Simple Matrix Assignment m_llaa 10 412 Aug-05-2019, 09:35 AM
Last Post: m_llaa
  [split] building a transition matrix for ion channels satyam2007 1 102 Jul-31-2019, 04:20 AM
Last Post: scidam
  Using map and lambda in a matrix ricardodepaula 3 127 Jul-21-2019, 03:42 PM
Last Post: ricardodepaula
  Correlation of Incidents using time difference Rajhesh 1 113 Jun-27-2019, 03:44 PM
Last Post: Larz60+
  From Dictionaries to Matrix. dervast 1 188 Apr-16-2019, 10:37 AM
Last Post: Larz60+
  Covariance Matrix - Python cesardepaula 2 746 Mar-08-2019, 07:45 AM
Last Post: cesardepaula
  Transposing a Matrix WITHOUT numpy TreasureDragon 5 680 Mar-02-2019, 10:48 PM
Last Post: ichabod801
  Matrix Helmi 7 440 Feb-02-2019, 04:17 PM
Last Post: ichabod801
  Control a dot matrix printer Clement_2000 4 391 Jan-27-2019, 09:00 PM
Last Post: Clement_2000
  How to only extract upper or lower triangular matrix into tabular form SriRajesh 3 2,287 Jan-04-2019, 01:21 AM
Last Post: scidam

Forum Jump:

Users browsing this thread: 1 Guest(s)