Tuesday, February 6, 2024

LIS 4370 R Programming - Module 5 Assignment

For this assignment, I will be doing math with the following matrices:

For the most part, I used the explanation that was provided through the course announcements as a guide to doing this assignment. To begin, it is important to note that these two matrices above will not produce any inverses. 

We can check for inverses by using the det() function which gives us the determinant of a matrix. Entering into R det(A) and det(B), we can see in the console that det(A) will come out with zero while det(B) will give an error because det(B) is not a square matrix.

Now, what is a square matrix exactly? Well, it's a matrix with the same number of rows and columns which allows for one to add and multiply with it. Looking at the structure of the matrix when we transpose the matrices, we can immediately see that the rows greatly outnumber the columns whereas the A matrix does contain the same number of rows and columns (10 rows by 10 columns).

Moving on in the code, we are asked to create two vectors called a and b and since we intend to multiply them by the above matrices, we must make sure that the vector length matches the number of matrix rows. We then create the following vectors:

Moving onto the multiplication of the vectors and matrices, we can execute the following piece of code to perform the calculation:

The calculation is then saved to a table under the following variables:

result_1:

result_2:

The next step is to reassign the vectors a and b to equal the number of rows of the column for the corresponding matrix:

By executing the code, both a and b become of length 10.

Lastly, we are asked to multiply the matrices which can done through the following piece of code:

A taste of the output can be seen in the following image:

Here's a link to the code on GitHub:

Module 5 Code

~ Katie

LIS 4317 Visual Analytics - Module 5 Assignment

For this assignment, I will be working with a dataset containing data regarding average position and time. Following the part to whole design framework, I decided to focus on the part of  the data where time spans from half a second (0.5) to the maximum time recorded (3.8).

With a filtered dataset, I created a simple scatter plot with Plot.ly to graph the data.

Here's the plot:


Observing the plot, we can quickly see that as time increases, average position increases too. However, it appears that average position levels off around 1. More data is definitely needed to further understand why the data points seems to stop at this point.

Thinking about the Part to Whole Design Framework and how it applies to this plot, the first thing I appreciate is its ability to zoom in on an aspect of the data like time from 0.5 to 3.8. Sometimes, looking at the full picture of the data can be a bit overwhelming and you may miss key information. By taking a part of the data, we can clearly see that steady climb in position and time. 

Here's a link to the plot:

Module 5 Scatter Plot

~ Katie

Wednesday, January 31, 2024

LIS4317 Visual Analytics - Module 4 Assignment

For this assignment, I will generate visualizations based on monthly modal time series data from Data.gov. 

In the visualizations, I decided to use the following 6 variables:

Primary USA City, Year, Vehicle Revenue Miles, Vehicle Revenue Hours, Ridership, Collisions with Motor Vehicle, and Collisions with Person

Thinking about how to best visualize this data, the first thing I wanted to see was the overall rate of collisions over the years recorded.

To do this, I went with a bubble chart and as you can see, 2019 had the lowest rate of collisions compared to the others.

Legend for reference:

While this is interesting, I wanted to further compare collisions across select US major cities and came up with the following:


Legend for reference:

The top line chart represents collisions with motor vehicles while the bottom chart shows collisions with people. Immediately, we can see that New York City experiences the highest number of collisions but it is interesting to see how it trends downward very quickly in the course of a year between 2018 and 2019. Further, the other cities trended downward as well but look steady compared to New York City. 

See the visualizations up close here:

Bubble Chart

Line Chart

~ Katie


Tuesday, January 30, 2024

LIS4370 R Programming - Module 4 Assignment

For this assignment, I will analyzing data that came from a local hospital that contains general patient information like blood pressure as well as the decisions made by the general doctor, external doctor, and the final decision made the head of the emergency unit. Additionally, I will generate a boxplot and histogram representing patient blood pressure and the decisions made by the healthcare professionals.

To begin, I organized the data and created the following data frame called patientInfo which consists of 10 observations of 5 variables.

Immediately, we can see that the column first contains an NA value. While I could remove it, seeing that it is such a small dataset, I instead convert the row to numeric.

 Moving on to plotting, let's take a look at the boxplot containing all the variables of patientInfo:

Just looking at the graph, the first thing that sticks out as the variable bloodp against the other variables. For the most part, the other variables seem to be clustered around the 0 mark while bloodp appears to have the median line a little below 100. Furthermore, we can see the outliers of 42 and 205 clearly represented. It makes sense to see first, second, and finaldecision around 0 and 1 as the values primarily consisted of these numbers. Additionally, frequency of visit was represented as a decimal so it makes sense to see it around 0 as well.  

As for histograms, I decided to make use of ggplot to plot each of the variables:

Freq:

bloodp:

first:

second:

finaldecision:


Looking at the histograms, what first sticks out to me is the various blood pressure readings from the patients in the bloodp histogram. For the most part, the blood pressure readings seem to mostly be around 100 but there are few high readings and low readings. As for the decisions made by the general doctor, external doctor, and the head of the emergency unit, one can first see that general doctor rated the health of the patients as bad (1) more so than good (0). With the external doctor, they rated the patients as high (1) more so than low (0). Lastly, with the finaldecision by emergency unit head, they also tended to rate the patients as high (1) than as low (0). 

Naturally, more information is needed to understand the meanings of high and low by the medical professionals but looking at graphs, it appears that high may mean someone is in poor health than in good health and hopefully this means that the medical professionals are making the right decision for their patients.

Here's a link to the full code via GitHub:

Module 4 Code

~ Katie

Tuesday, January 23, 2024

LIS 4317 Visual Analytics - Module 3 Assignment

For this week's assignment, I will be using Adobe Illustrator to add vector graphics to my map visualization that I made using Tableau Public.

Here is the original map for reference:

Here is the improved map using Adobe Illustrator:

As you can see, the first notable change is the map itself. In Tableau, the map was originally set to "Light" mode and the focal point was the green points representing the Starbucks locations. I went into that setting and changed it to "Street" so you can make out the cities and other notable landmarks if you zoomed into the map. 

Thinking about how I could have the map make the most sense visually, I decided to focus on the concentration density of the stores themselves and show the viewer which states have the most or least number of stores. Using a magnifying glass vector image and hiding a zoomed-in map image within it, one can see how it adds depth to the map. For decoration, I added the Starbucks logo and a cat holding a cup of coffee. Additionally, a frame and coffee cup background was placed behind the map to make it a bit more visually appealing.

~ Katie

Saturday, January 20, 2024

LIS 4370 R Programming - Module 3 Post

For this assignment, I will be working with data based off the 2016 Presidential Election. The data consists of three variables: Name, ABC poll results, and CBS poll results. Upon further analysis of the data, one can see that the Name variable is of type character while the poll result variables are of type numeric. 

At the beginning, the data looks something like this:

Immediately, one can see that this data may be a bit easier to read if put into a data frame. 

To place the data into a data frame, one can use the following piece of code:

Executing this piece of code, the data frame will look like the following:

Taking a look at the data frame via str(election), there are 7 observations for the 3 variables.

You can look at the code in its entirety by clicking the GitHub link below:

Module 3 Code

~ Katie

Thursday, January 18, 2024

LIS 4317 Visual Analytics - Module 2 Post

For this assignment, I will be using Public Tableau to visualize all Starbucks locations in the USA. Although I did have the opportunity to visualize all Starbucks in the entire world, to keep things simple, I will focus on the USA as the map gets a little hard to read!

Here's a link to the main visualization:

Starbucks Locations by State


The larger the points, the greater number of stores present:

So, the state with least number of stores is Vermont with 11 stores while the state with the greatest number of stores is California with 2,983 stores. This was surprising as I would have thought it would have been Washington state as that was where the coffee shop originated from.

Vermont:


California:


Washington:

While there are only 742 stores in the state, we can still see quite a few Starbucks in the Seattle area.


 

Look! It's the Starbucks at the USF Library!


Thinking about how to make this map more communicative, the first thing that comes to mind is changing the green points to the Starbucks mermaid logo to make it more distinctive. Second, it would be more interesting to see an actual map underneath the points instead of an arbitrary general landscape. It would be neat to see buildings, roads, and other notable landmarks alongside these Starbucks. Third, it might be a good idea to create another viz to color code the states based on which ones are the most populated with Starbucks.

~ Katie

LIS 4370 R Programming - sentimentTextAnalyzer2 Final Project

For this class's major final project, I set out to make the process of analyzing textual files and URL links for sentiment insights much...