Dissemination

Most people have some end goal when looking at statistical information about a certain subject. It might be Different questions lead to different types of answers. For 1 the main factors may be age and income, in which case a scatter plot could be helpful. for 2 that will be simply concentration though you need…

Correlation in R

The variable hosp1 has 2 columns: Latitude and Longitude. We want to see if the pairs of data share a correlation, i.e. is there a relationship between Latitude and Longitude? Does increasing the first variable affect the second variable? So the function is And hosp1$Latitude is the Latitude column and hosp1$Longitude is the Longitude column

Published
Categorised as Data, R

Removing missing data in R

I was playing around with the Latitude and Longitude of hospitals in the UK. When I went to try correlation I got NA because of missing data. To get round this I created a new variable. This basically omits all NA (missing values). So use the simple function na.omit to create a new dataset without…

Published
Categorised as Data, R

Import a csv into R

This can be done with this coderead.csv(“#file url here “) # You need to make sure to have a double backslash in the file path So on my computer I went to the file location and then right-clicked and chose copy path. That gave I then modified it to C:\\Users\\caleb\\Desktop\\Stats\\location.csv #not double backslashes and so…

Published
Categorised as Data, R