可視化ツールって、入れたデータを取捨選択することはできないんかな?Flourishはテンプレ変換だから対応する列を選択できる。この過程でデータ列を選ぶことはできる。でもFlourish、ワイド→ロング型変更は簡単だったがロング→ワイドはExploratryほど狙った操作ができなかった。
QJISは入れたもの全部使う、というよりデータそのものの取り扱いまで私が至っていない。関数をコードで入れる場所はある。地物やら見慣れない言葉も多い。
Tableauはデータソース連結、型変換が容易だけど、精査には特化してない。
結論、やっぱりデータ分析はクレンジング8割。やってて実感するから先人たちはあれほど断言するんだな。私自身、可視化ツール内でデータは触りたくない。インポートする時点でNULL処理もターゲットも絞って、可視化は表現特化で考えたい。いくらオーガニック食品でも、泥を付けたままお皿には載せられない。
前置きなが。
今回は犯罪箇所ヒートマップを作ります。
- 使用データ:[ Google Cloud Public Datasets] chicago_crime_data (Chicago Police Department crime data from 2001 to present)
- 期間:2010-01-01 ~ 2014-12-31, 2015-01-01 ~ 2019-12-31(5年×2)
- 犯罪タイプ:PROSTITUTION(売春)
- 位置情報(緯度/経度)
犯罪箇所ヒートマップ:多いほど濃い
©OpenStreetMap
なぜ5年×2にしたのか。前半後半で件数が全く違ってですね(前回記事参照)、さらに売春は場所に特徴がありました。
- ツール:QJIS
- ベース:OpenStreetMap
- データ:シンポロジ・単一定義/シンプルマーカー/1ミリ/ペンなし
- レイヤ:シンポロジ・ヒートマップ/Red/半径10ミリ/レイヤレンダリング:乗算
2010-2019件数(Looker Studio)
前半(10,384件/5年間)、後半(4,253件/5年間)でこんなに数が違うの、なんでだろう。コロナは2020年初めからだから、含まれてないんですよね。
2016年:
- 11月に行われた大統領選挙で、共和党のトランプ氏が勝利
- 米国株式市場は前年12月に行われた9年半ぶりの利上げへの不安や、原油先物価格の大幅下落を受け年初から大きく下落して始まった。(マネックス証券:2016/12/30記事)
- ルイジアナ州立大学とミシガン大学の研究者らは、景気減速中および減速後に暴力犯罪が減少したことを発見した。(NIH:積極的な警察活動を抑制すれば重大犯罪を減らすことができるという証拠)
- シカゴ警察が麻薬所持と売春の取り締まりを強化した後に何が起こったのか(VICE NEWS:2019/12/5)
4の記事内で参考になったのは
減速の証拠は、麻薬所持、武器違反、売春という3つの特定の種類の逮捕が事実上停止したという事実にある。麻薬、武器、売春婦の逮捕は「プロアクティブ」として知られるタイプの取り締まりの指標となるため、これは重要である。このタイプの取り締まりでは、警察官が犯罪の報告なしに市民との接触を開始する。これには、「不審な行動」に基づいて人々を呼び止めることも含まれます。これは、特定の角に立ったり、パトカーから離れたりすることと解釈できます。積極的な取り締まりは、しばしば有色人種が不当に標的にされるため、問題が多く、論争の的となる。
うーん、選挙や景気、加えて短期的には警察が関係する裁判も取り締まりに影響するということかな。特に売春は警官からの動きが含まれていて、この行動意欲が検挙の件数も左右する。明確に原因が見えることってないですよね。
複合要因でどれが目立つのか、重回帰分析でもできればいいけど、数字で表せられない事象が多い。
If a visualisation tool doesn't allow you to select and discard the data you've entered, Flourish is a templated conversion, so you can select the appropriate columns. It is possible to select columns of data. However, Flourish's 'wide to long' type change was easy, but 'long to wide' was not as targeted as Exploratry.
QJIS uses everything I put in, or rather I cannot handle the data command. There are places to put functions in the code. There are a lot of geographic objects and other unfamiliar terms.
Tableau is easy to use for data source linking and type conversion, but it is not specialised for inspection.
The bottom line is that cleansing is still 80% of data analysis. That's why our predecessors claimed so much.
I myself don't want to touch the data in the visualisation tool. I want to prepare both the NULL and the target at the point of import, and think of the visualisation only in terms of representation. Even if the food is organic, I cannot dish it out without washing it.
Long preamble.
In this case, a crime location heatmap is created.
- Data used: [ Google Cloud Public Datasets] chicago_crime_data (Chicago Police Department crime data from 2001 to present)
- Period: 2010-01-01 - 2014-12-31, 2015-01-01 - 2019-12-31 (5 years x 2)
- Crime type: PROSTITUTION
- Location (latitude/longitude).
Crime location heat map: the more, the denser
Why did we make it 5 years x 2? The number of cases was completely different in the first and second halves. (see previous article), and furthermore, prostitution was characterised by location.
- Tool: QJIS
- Base: OpenStreetMap
- Data: sympology, single definition / simple marker / 1 mm / no pen
- Layer: sympology heatmap / Red / 10 mm radius / Layer rendering: multiply
Why are the numbers so different between the first half (10,384 cases/ 5 years) and the second half (4,253 cases/ 5 years)? Corona is not included because it started at the beginning of 2020.
2016:
- Republican Trump wins the presidential election in November.
- The US stock market started the year down sharply due to uncertainty over the first interest rate hike in nine and a half years in December of the previous year and a sharp fall in the price of oil futures. (Monex: 30/12/2016 article)
- Researchers at Louisiana State University and the University of Michigan found that violent crime declined during and after the economic slowdown. (NIH: Evidence that curbing aggressive policing can reduce serious crime)
- What happened after Chicago police stepped up crackdowns on drug possession and prostitution (VICE NEWS: 5 December 2019)
The proof of a slowdown lies in the fact that three particular kinds of arrests virtually stopped: drug possession, weapons violations and prostitution. This is important because narcotics, weapons and prostitution arrests are an indicator of a type of policing known as “proactive,” in which officers initiate encounters with citizens without the report of a crime. This can include stopping people based on “suspicious activity” — which can be interpreted as standing on a particular corner or moving away from a police car. Proactive policing is a fraught and controversial practice, as people of color are often disproportionately targeted.
Hmmm, elections and the economy, plus court cases involving the police in the short term, also affect policing. Prostitution in particular involves being approached by officers, and this willingness to act also influences the number of arrests. It's not always possible to see a clear cause.
It would be nice if we could do a multiple regression analysis to see which of the combined factors stand out, but there are many events that cannot be expressed in numbers.
0コメント