Posts

Showing posts from February, 2026

Module # 6 Doing math in R part 2

Image
 This week was more on matrixes in R.  For step one we had to make 2 matrixes and then add and subtract them. A = matrix(c(2,0,1,3), ncol=2) B = matrix(c(5,2,4,-1), ncol=2) A + B A - B                                                       Next I was instructed to make a matrix " matrix of size 4 with the following values in the diagonal 4,1,2,3." matrix1 <- diag(c(4, 1, 2, 3))  Finally I was asked to make a very specific matrix using Diag M <- diag(3, 5) M[1, ] <- c(3, 1, 1, 1, 1) M[2:5, 1] <- 2

Module # 5 Doing Math

Image
This week we are looking at matrixes and doing some math with them. To start with we have A which is a 10*10 and B which is a 100*10 matrix(not shown). With the instructions to find the inverse if we used solve(A) it would fail because the determinate is 0. "Error: system is computationally singular" B would fail because it is not square.  There were other instructions like performing multiplication with the Matrixes. for example multiplying the two matrixes together would require inverting B so it is a 10*100 because the inner dimensions need to match. The first few rows of that math are here, the resulting vector is also 10x100.

Module # 4 Programming structure assignment

Image
 This week was about taking raw data and putting them into arrays, converting high and low to numerical values so they can be represented in graphs. and then making a boxplot and histogram to look at the information. I did my side by side boxplot on blood pressure and the final decision on "head of the emergency unit's decision regarding immediate care for the patient". This allows us to see what blood pressure correlates to the decision of admitting them.  As this shows, patients with a blood pressure under 100 were admitted infrequently, and those with blood pressure over 100 were all admitted. I also made a histogram that shows the blood pressure frequency. this allows us to take a look at how many patients were at each blood pressure.  This histogram is right skewed with most patients having blood pressure under 150. As there are extremes outside the norm it may skew the data. Each of those with blood pressure under 150 may be the extreme cases and removing these migh...

Week 3

Image
 This week is about comparing Election poll Results. To start with arranging the 3 variables into a data frame provides us with this. 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 Berine 15 19 We can look at the differences between the two polls. Name ABC_poll_results CBS_poll_results Difference 1 Jeb 4 12 -8 2 Donald 62 75 -13 3 Ted 51 43 8 4 Marco 21 19 2 5 Carly 2 1 1 6 Hillary 14 21 -7 7 Berine 15 19 -4 We can also clearly ...