Plotting Assignment for Feb. 7

Hanna Negami

1. Get data.

load("/Users/hnegami/Desktop/DATA VIS/sampDat.dat")

2. Descriptives.

summary(subS)
##     pos            orient          judgori           rt       
##  left :14662   Min.   :  0.01   Min.   :-110   Min.   :0.102  
##  right:14714   1st Qu.: 45.11   1st Qu.:  47   1st Qu.:0.929  
##                Median : 90.38   Median :  90   Median :1.215  
##                Mean   : 90.21   Mean   :  89   Mean   :1.343  
##                3rd Qu.:135.45   3rd Qu.: 132   3rd Qu.:1.615  
##                Max.   :180.00   Max.   : 315   Max.   :4.942  
##                                                               
##     angdiff          validcue        blocknum       trialnum    
##  Min.   :-89.89   FALSE  :    0   Min.   :1.00   Min.   :  1.0  
##  1st Qu.: -8.69   TRUE   :    0   1st Qu.:1.00   1st Qu.: 38.0  
##  Median : -0.06   invalid: 5908   Median :2.00   Median : 76.0  
##  Mean   :  0.16   valid  :23468   Mean   :2.42   Mean   : 75.6  
##  3rd Qu.:  8.89                   3rd Qu.:3.00   3rd Qu.:113.0  
##  Max.   : 89.89                   Max.   :5.00   Max.   :150.0  
##                                                                 
##      userid      tilt       orientToVert    angdiff_TV    
##  701    :  750   l:14735   Min.   : 0.0   Min.   :-89.89  
##  704    :  750   r:14641   1st Qu.:22.7   1st Qu.:-11.68  
##  705    :  750             Median :45.2   Median : -2.50  
##  715L   :  750             Mean   :45.0   Mean   : -3.62  
##  717L   :  750             3rd Qu.:67.5   3rd Qu.:  5.96  
##  718L   :  750             Max.   :90.0   Max.   : 89.89  
##  (Other):24876                                            
##  angdiff_TV_MC    
##  Min.   :-104.65  
##  1st Qu.:  -8.16  
##  Median :   0.00  
##  Mean   :  -0.44  
##  3rd Qu.:   8.03  
##  Max.   : 130.31  
## 

3. Subselect the participants who were in experiment 1.

subexp1 <- subset(subS, (grepl("exp", userid)))

4. Average their performance by trial.

aveperf <- aggregate(angdiff ~ trialnum, data = subexp1, mean)

5. Plot the average performance (y) versus trialnum (x).

library("ggplot2")
p <- ggplot(data = aveperf, aes(x = trialnum, y = angdiff))
p + geom_point() + theme_bw()

plot of chunk unnamed-chunk-5

6. Loess line with confidence intervals.

p + geom_smooth(fill = "light blue") + theme_bw()
## geom_smooth: method="auto" and size of largest group is <1000, so using loess. Use 'method = x' to change the smoothing method.

plot of chunk unnamed-chunk-6