Posts

Final Project

Image
 2022 Shootings Jahnae Edwards | April 28th, 2023 In the wake of the Michigan State shooting, I began thinking about the number of mass shootings that have happened in the United States over the years. I have watched the way that I am educated transform completely due to mass shootings. For this project I wanted to visualize the amount of shootings that have happened in 2022 alone. In order to do this analysis, I found a site called mass shooting archive  which has kept track of all mass shootings in the United States since 2014. According to the site, a shooting is considered a mass shooting when more than 4 people are hurt at one location. According to this dataset, in 2022, 647 mass shootings occurred. To clean this dataset, I began by deleting the last column called "operations" because it is not relevant for this analysis. I then renamed each column and added the column "TotalHurt" which consists of the sum of people killed and injured. A snippet of the cleaned...

Module # 13 Dynamic/interaction and animation Visualization

Image
I found this week's assignment very interesting as I had no idea that you can animate using r, with some research I discovered that there is a package called gganimate that can be used to animate plots. For this assignment, I got a chart I created for another class that would look great animated and added transition_reveal() in order to animate it. I added the stagnant graph below as well as the gif animation. I believe that the results of this created a more visually appealing graph.

Module # 12 Social Network Analysis

Image
 For this visualization, I decided to use ggnet2 in R studio to complete my Social Network analysis. Using the code provided, I was able to create the following graph.  I found an example of using ggnet2 on plotly.com  that uses randomized values are either vowels or constants to create the social network analysis. To make the graph more appealing, I added more random variables, changed the color of the graph and added a title with pink defining if a value is a vowel and black defining if it is a constant. I understand that a legend should be added to this visualization, but  I was not able to figure out how to do so using ggnent2. 

Module # 11 E R. Tufte Work

Image
For this assignment, I decided to visualize the Dot-dash plot in ggplot2 example because I have a preference for scatter plots and enjoy learning about more ways to utilize ggplot2. Code:  ggplot(mtcars, aes(wt, mpg)) + geom_point() + geom_rug() +    theme_tufte(ticks=F) + xlab("Car weight (lb/1000)") + ylab("Miles per gallon of fuel") +    theme(axis.title.x = element_text(vjust=-0.5), axis.title.y = element_text(vjust=1)) + ggtitle("wt vs mpg") The code provided in the instructions outputs the following visual.  Source: http://motioninsocial.com/tufte/#introduction

Module # 10 Time Series and Visualization

Image
In this Module, we are taught about time series, time series models can be used to visualize past and predict future events. When creating a time series model you are looking for any outstanding changes or outliers in the visualization. Yau points out the issue with using discrete points on visualization as it can be difficult to read when there are multiple points. Each type of visualization has its own issues, so when choosing which to use it is situational for the type of data being used. For my graphs, I used the given hotdogs dataset.  Using the barplot function does create a good visualization, but there are some issues, for one, there is no key with the code given so the reader will have to understand the code to get the meaning of the colors. In addition, more lines of code are required as we had to define what the colors meant in another line of code. Creating a similar chart using ggplot2 provides much better results, with one line of code we can create an even better cha...

Module # 9 Visual multivariate

Image
For this visualization, I decided to use the dataset iris to see how the sepal length and with correlates to the petal length. I decided to make the color be based on the species so that we could easily tell the difference between the irises. This visualization shows that the smaller the petal length, typically the wider the sepal with and the shorter the sepal length. We can also see that this is a characteristic of the setosa iris. We can also see that the opposite occurs with the other irises versicolor and virginca where the sepal length and petal length is longer, but the sepal width is usually shorter.  I decided to use ggplot2 to create this visualization. This is one of the best ways to show visual multivariate graphs because of how simple the graph is. The design is aligned as it is sharp, has repetition as it is consistent, has good contrast with the species defining the color, proximity by putting all of this information on one graph, and balance with the structure.

Module # 8 Correlation Analysis and ggplot2

Image
 library(ggplot2) data("mtcars") #regression analysis of mpg to disp reg <- lm(data = mtcars, mpg ~ disp) summary(reg) Call: lm(formula = mpg ~ disp, data = mtcars) Residuals:     Min      1Q  Median      3Q     Max  -4.8922 -2.2022 -0.9631  1.6272  7.2305  Coefficients:              Estimate Std. Error t value Pr(>|t|)     (Intercept) 29.599855   1.229720  24.070  < 2e-16 *** disp        -0.041215   0.004712  -8.747 9.38e-10 *** --- Signif. codes:   0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 Residual standard error: 3.251 on 30 degrees of freedom Multiple R-squared:  0.7183, Adjusted R-squared:  0.709  F-statistic: 76.51 on 1 and 30 DF,  p-value: 9.38e-10 ggplot(mtcars, aes(x=mpg, y=disp)) + geom_point() + stat_smooth(method = "lm", col = "hotpink") For t...