library(psych)
#Reading in the data set named "summary_stats_LSS1.csv" which is the data Dr. Franchak gave me from a previous study. 
#I named the data PS1_data which stands for problem set 1.

PS1_data<-read.csv("summary_stats_LSS1.csv")
#The variable I am analyzing is walk_eyex_std, which is the standard deviation of eye exploration in the walking condition of the study.
PS1_data$walk_eyex_std
##  [1] 15.3169 10.6045 12.5895 14.1943 11.8864  8.7622  9.0381 16.6323 10.6609
## [10] 14.4007 10.9927 13.8292 12.7612 13.9169 13.7672 14.1995 11.6026 15.4398
## [19] 12.5735  7.4325 14.0472 15.1056  7.5055 16.0720 10.2745  9.2205 15.6040
## [28]  9.6618 10.1458 13.3745  6.8838 15.8777 11.1905 12.3005 12.7823  8.9730
## [37]  9.4913 12.4400 11.1495 16.4726 11.0737 11.7360 10.9284 12.1724 14.0012
## [46]  8.3598 11.9230  9.2208 11.0370 10.8813 11.2730 12.2139  9.2959 12.0995
## [55] 10.8105  9.4804  6.5061  9.2134  9.0332
#Here I am looking at the measures of central tendency for the variable. "Table" allows me to get the mode.
mean(PS1_data$walk_eyex_std)
## [1] 11.70225
median(PS1_data$walk_eyex_std)
## [1] 11.6026
table(PS1_data$walk_eyex_std)
## 
##  6.5061  6.8838  7.4325  7.5055  8.3598  8.7622   8.973  9.0332  9.0381  9.2134 
##       1       1       1       1       1       1       1       1       1       1 
##  9.2205  9.2208  9.2959  9.4804  9.4913  9.6618 10.1458 10.2745 10.6045 10.6609 
##       1       1       1       1       1       1       1       1       1       1 
## 10.8105 10.8813 10.9284 10.9927  11.037 11.0737 11.1495 11.1905  11.273 11.6026 
##       1       1       1       1       1       1       1       1       1       1 
##  11.736 11.8864  11.923 12.0995 12.1724 12.2139 12.3005   12.44 12.5735 12.5895 
##       1       1       1       1       1       1       1       1       1       1 
## 12.7612 12.7823 13.3745 13.7672 13.8292 13.9169 14.0012 14.0472 14.1943 14.1995 
##       1       1       1       1       1       1       1       1       1       1 
## 14.4007 15.1056 15.3169 15.4398  15.604 15.8777  16.072 16.4726 16.6323 
##       1       1       1       1       1       1       1       1       1
#In this chunk I am getting the measures of variability.
sd(PS1_data$walk_eyex_std)
## [1] 2.514278
var(PS1_data$walk_eyex_std)
## [1] 6.321592
#"describe" is used here to get the skew and kurtosis of the data.

describe(PS1_data$walk_eyex_std)
##    vars  n mean   sd median trimmed  mad  min   max range skew kurtosis   se
## X1    1 59 11.7 2.51   11.6    11.7 3.15 6.51 16.63 10.13 0.07    -0.77 0.33
#In this chunk I use the hist and plot functions to generate the appropriate plots for the data. 
hist(PS1_data$walk_eyex_std)

plot(PS1_data$walk_eyex_std)