Time Series and Visualization
This post covers the early 2015 “Occupancy Detection Data Set” from the UC Irvine Machine Learning Repository – data is here.
Verbatim information for the data set follows:
“Abstract: Experimental data used for binary classification (room occupancy) from Temperature, Humidity, Light and CO2. Ground-truth occupancy was obtained from time stamped pictures that were taken every minute."
The data set includes 3 files that were bound together. The 3 files did not have contiguous times, so the plot will have some non-recorded values. The overall data set I used has a cleaned dimension of 20560 x 7.
The variables show that when the office room is occupied (teal color), some lights are turned on (measured in Lux) and the temperature in the room increases. This latter makes sense as it is early February and the heater is most likely turned on. The CO2 levels measure exhaled air. It is interesting to see the higher levels on 9 February and it's possible to speculate that maybe there was a meeting held in that room. The 2 humidity variables also seem to validate room occupancy.
Related files can be obtained from GitHub @ git-me .
References
Luis M. Candanedo, Véronique. Accurate occupancy detection of an office room from light, temperature, humidity and CO2 measurements using statistical learning models. Feldheim. Energy and Buildings. Volume 112, 15 January 2016, Pages 28-39.
Multivariate Analysis using corrgram and lattice
Multivariate analysis allows us to consider the effects that various variables may have on another condition. I used the "birthwt" data set from the "MASS" package. The data sets' dimension is 189 x 10. For brevity, I just considered two variables with a focus on design principles.
The five basic principles of design include alignment, repetition, contrast, proximity, and balance. This two-page assignment includes all of these principles except for contrast.
The two pages show repetition by title (Birth Weights) and usage of somewhat consistent graphs (histograms). Page one shows asymmetrical balance with some usage of vertical and horizontal alignment. Also, page one shows visual connection through proximity by placing the legend near the correlation diagram. Page two clearly shows symmetrical balance with alignments.
Related files can be obtained from GitHub @ git-me .
Correlation or Regression Analysis Using ggplot2
Scatter plot matrix.
This is a scatter plot matrix from the urine data set in the boot package. The matrix has a dimension of 79 x 7.
A scatter plot matrix is a great first tool as part of the exploratory phase. This kind of matrix allows for a quick and rich understanding of the interrelationships between variables.
This particular plot extends the pairs{base} function with the ggpairs{GGally} function. By default, it adds a density graph on the diagonal along with correlation statistics.
Related files can be obtained from GitHub @ git-me .
Visual Distribution Analysis
S&P 500 Distribution of Monthly Returns
Given the current state of the coronavirus and the stock markets, I decided to look at the monthly performance of the SPY since January 1993.
The data was obtained from Yahoo Finance, analyzed in RStudio and then modified in Adobe Illustrator.
The code, pdf, and related files can be obtained from GitHub @ git-me .
Visual Differences and Deviation Analysis
Florida Counties Relative Health Importance
This is a visualization from the Community Health Status Indicators (CHSI) data set. This particular indicator domain has been filtered for Florida counties and still contains 1474 data points covering 22 unique variables for 66 counties.
With so many data points, the heat map provides a quick way to spot differences and compare across multiple variables. One thing that isn’t apparent by perusing the data set but that the visualization brings out, is the clustering of missing or non-reported data.
The .csv file was obtained from healthdata.gov, analyzed in RStudio and then modified in Adobe Illustrator.
The code, pdf, and related files can be obtained from GitHub @ git-me
Part to Whole and Ranking Analysis using Plotly
Leading Causes of Death for Florida from 1999 - 2017
The provided dashboard consists of three charts that respectively show causes as a yearly percentage, causes by ratio-linear, and causes by ratio-logarithmic. The logarithmic scale is provided as a means to zoom for two reasons: (1) bunching of data at the lower linear end and (2) more easily observe comparative changes over time.
The interactive dashboard can be found here: Plotly dashboard.
An image of the three dashboard charts is provided below.
Note:
Display data using bar graph
Population Size and Density
This visualization shows the relationship between a state's counties' population size and its density. Bar length shows population size and color shows its density. Density is defined as persons per square mile.
For quite a few states, the data shows that size and density are not always related. A shown below, Pinellas County has less than half of Miami-Dade County's population but it is more than twice Miami-Dade's density.
If this visualization was published as a Tableau Dashboard or Story, the user could select other states and view its information.