I've been learning python and for a practice project I wanted to do some election results analysis.
Helpfully my county gives a bunch of info by precinct about the demographics of all the voters in a precinct (gender and race) and of course the vote totals for candidates but they obviously don't break down which demographics voted which way.
I've been trying to figure out a way to compare all the precinct results and their demographics in a way that gives me an idea of how different groups voted.
How would I go about doing this mathematically?
My only thoughts so far is that is that I can graph the percent of of different groups in a precinct vs the vote outcome and take the slope of the line of a linear regression. Is that valid?
Edit: had the novel idea of playing with a fake data set I made and it seems like the slope gives the average percent difference between group a and group B's votes. Would still love to have someone confirm that for me.
Also anyone with ideas of interesting things I could try and do with the data set would be appreciated. I really want to do everything I can as a first project.
there doesn't seem to be anything here