Posts

Showing posts from January, 2024

Module # 4 Programming structure in R [ R Programming ]

Image
 [CODE]  # Data Frequency <- c(0.6, 0.3, 0.4, 0.4, 0.2, 0.6, 0.3, 0.4, 0.9, 0.2) BloodPressure <- c(103, 87, 32, 42, 59, 109, 78, 205, 135, 176) FirstAssessment <- c(1, 1, 1, 1, 0, 0, 0, 0, NA, 1) SecondAssessment <- c(0, 0, 1, 1, 0, 1, 1, 1, 1, 1) FinalDecision <- c(0, 1, 0, 1, 0, 1, 0, 1, 1, 1) # Create a data frame hospital_data <- data.frame(Frequency, BloodPressure, FirstAssessment, SecondAssessment, FinalDecision) # Boxplot par(mfrow=c(1,2))  # Set up a 1x2 grid for side-by-side plots boxplot(BloodPressure ~ FirstAssessment, data=hospital_data, main="Blood Pressure vs. First Assessment", xlab="First Assessment", ylab="Blood Pressure") boxplot(BloodPressure ~ SecondAssessment, data=hospital_data, main="Blood Pressure vs. Second Assessment", xlab="Second Assessment", ylab="Blood Pressure") # Histogram hist(BloodPressure, main="Histogram of Blood Pressure", xlab="Blood Pressure", ylab=...

Module # 3 Data.frame

[CODE]  # Creating the data Name <- c("Jeb", "Donald", "Ted", "Marco", "Carly", "Hillary", "Bernie") ABC_poll_results <- c(4, 62, 51, 21, 2, 14, 15) CBS_poll_results <- c(12, 75, 43, 19, 1, 21, 19) # Creating a data frame poll_data <- data.frame(Name, ABC_poll_results, CBS_poll_results) # Displaying the data poll_data [OUTPUT]  Name ABC_poll_results CBS_poll_results 1 Jeb 4 12 2 Donald 62 75 3 Ted 51 43 4 Marco 21 19 5 Carly 2 1 6 Hillary 14 21 7 Bernie 15 19 CBS has a higher percentage of popularity for Bernie, Hillary, Donald, and Jeb. As for ABC Ted, Marco, and Carly, all have higher percentages here compared to CBS.

Module # 2 Google Table, Tableau and Geographic map

Image
  For this week's dataset, I looked into the 5000 fastest private growing companies in the United States over 4 years. Using Tableau I created a visual to show me where the most successful companies were based. On the map, the darker states correspond with both the rank and amount of workers in each of the companies. Darker shades led to more workers and higher rank, while lighter shades represented the opposite.  Here we can see South Dakota as one of the lighter-colored states in the United States, with a rank of 4,937 and only 64 workers we can see why it is so lightly shaded.  Compared to that of New York's darker-shaded state, showing a much more significant ranking of 794,043 and 77k plus workers.  Ways to improve this map would be a legend on the side of the United States map, here 2-4 different shades could be added. Showing the general difference between the state's rank and workers. Gestalt Laws would also be useful here, as the bigger ranked states could b...

Module # 2 Introduction to basic R functions and Data Structures

 assignment2 <- c(16, 18, 14, 22, 27, 17, 19, 17, 17, 22, 20, 22) myMean <- function(assignment2) { return(sum(assignment2)/length(assignment2)) } result <- myMean(assignment2) result [1] 19.41667  Explanation:  The 'myMean' function takes a vector of numbers as input and calculates the mean by dividing the sum of the numbers by the length of the vector.  The function works correctly because it follows the formula for calculating the mean, which is the sum of all values divided by the number of values. 

Visual Analytics - Module #1 First Assignment

 The first visual analytics that has caught my eye in recent weeks has been that of NFL stats provided by the Amazon AWS system. Mainly through Thursday Night Football, the broadcast shows the probability of the offense as if they go for it on 4th down rather than punting it away. Not only does it benefit the offense, but the system also allows for the defense to figure out which paths are best for pass rushers to attack and sack the quarterback. The system enhances the understanding of the game for both the offenses and defense. It provides insights into strategic decisions, helping teams and viewers make informed choices based on the analyzed data. The system also improves as more games are played and wearable technology develops.  The use of probability models indicated the integration of predictive models within the visual analytics system.  I added a video from YouTube displaying how the Amazon AWS system works along with NFL Next Gen Stats to come up with such numbe...