Data Import To begin the process of examining the basics of our data, we need to load the actual excel spreadsheet into R: First, we assign a ‘path’, that is, a step-by-step roadmap for R to fin the file (in this case, speadsheet) that we cant examined. When we assign that path to a certain variable (in this case path_to_data), we are able to pull out the exact file adn start our analysis.
path_to_data = '/Users/nickvohra/Documents/ExpDesign/2019 Class/Workshop1_basics/Pre-class_dataset.xlsx'
data1 = read_excel(path_to_data)
Alright, we have imported the data, lets run some simple analysis on it. To do so, we need to separate the Old and Young data. We will use the $ operator to split columns such that they are in their own vectors.
youth_mean = mean(data1$Young)
old_mean = mean(data1$Old)
young_std = sd(data1$Young)
old_std = sd(data1$Old)
Thats one way to split data, but a far simpler one is a one-line solution, but we’ll see even that has its own shortcomings:
summary(data1) #This is the one-line solution
## Young Old
## Min. :0.1682 Min. :0.1613
## 1st Qu.:0.3760 1st Qu.:0.3772
## Median :0.4766 Median :0.5347
## Mean :0.5422 Mean :0.6901
## 3rd Qu.:0.6346 3rd Qu.:0.8838
## Max. :1.6760 Max. :2.9487
#but it does not show us Standard Deviation properly.
old_std
## [1] 0.4521401
young_std
## [1] 0.2501752
This gives us some good dectriptive statistics of both data sets. Now lets visualize them. We can see that the data set is two large sets of 500 axons. The axons themselves dont act as an independent variable, so we need to go ahead and create a boxplot: focus on the inputs of the boxplot function
boxplot(data1$Young, data1$Old, names = c('Young', 'Old'), main = "Differnce in Axon Measurements", xlab = 'Axon Type', ylab = 'Diameter')
Based on the boxplot, teh two data sets do look different from one another. First, the median is higher for Old eyes, as wells the Interquartile Range (IQR) being much higher in old eyes too, this measn there is more variance in the data for Old eyes
As for the final question fo r the pre_data:
One could quantify axon density as well as the dynamic range of the images to test how the grey matter deteriorated.