I want to analyze, albeit loosely, the rate at which black and white offender populations are killed by police (because often people argue disproportionate killings by police are explained by disproportionate crime rates, so I want to investigate this). Now, there aren't any published data on the statistics here so I feel compelled to come up with my own.
Say we pick the year 2017. According to Statisa, 457 white people were killed and 223 black people were killed by police. According to census, that same year white people composed 77% of the population and black people composed 13% of the population. Now I can find the proportionate value that should have been killed, $X$, assuming both populations are killed at an equal rate \begin{align*} \cfrac{0.77}{457}&=\cfrac{0.13}{X} \\ 0.77X &= 59.41 \\ X &= 77.15 \\ \therefore X &=77 \end{align*}
So assuming an equal rate, the real amount killed, say $K$, should have been 77. But this wasn't the case. Instead it is 223. So $\frac{223}{77}=2.89$, meaning black people are killed at a rate 2.89 times greater than white people are. But at this point, this is when people argue black people commit homicide at a disproportionately greater rate, typically using the FBI's data table 6 in 2017 where 47% of homicide offenders are white and another 47% are black.
I think it makes sense to take 47% of the total amount killed by police, and only look at those populations by race in order to consider only offender populations. 457 turns into 215, and 223 turns into 105. I used the same proportion equation and found $X=36$ while $K=105$, $K/X=2.91$, and so it follows black homicide offenders are still killed 2.91 times more than white homicide offenders. This revelation should dispel racist counter-arguments used to justify a pandemic of police brutality, yes? If a disparity dependent on race did not exist, then $K/X$ should be 1 or very close to 1 in both offender and non-offender populations killed by police.
Are there any flaws with my math or anything I can do to make it better? If my approach is correct, then I could apply it to data that spans say, over a decade to get an average rate over the years.
No, this is not the way to go about this. You got the same proportion because you reduced both numbers by the same proportion. You’re not using the data that would be required (at a minimum) to draw the sort of conclusions you want to draw.
You have no data about the prevalence of homicide. For all you know from the data you cite, anything from none to all of the people killed by police could be killers. If none were, the homicide data disaggregated by race would be irrelevant, and the conclusion that black people are being killed disproportionately would stand. If all were, the conclusion would be that the police are actually disproportionately killing white people, since equal proportions of the homicidal population were white and black and more white killers got killed.
And that’s just the beginning. As Osama Ghani rightly warned, there are lots of contextual aspects that would need to be taken into account. For instance, the FBI data on homicide offenders doesn’t necessarily reflect actual proportions of homicide offenders; it could be biased against black people because homicides by black people tend to be investigated and prosecuted more thoroughly.