HW Exercise 0323-4

The following zip file contains one subject’s laser-event potentials (LEP) data for 4 separate conditions (different level of stimulus intensity), each in a plain text file (1w.dat, 2w.dat, 3w.dat and 4w.dat). The rows are time points from -100 to 800 ms sampled at 2 ms per record. The columns are channel IDs. Input all the files into R for graphical exploration.

unzip data, create a list for these 4 dataset and assign the column name

graphical exploration

## Warning: package 'ggplot2' was built under R version 3.6.3

HW Exercise 0323-5

The ASCII (plain text) file schiz.asc contains response times (in milliseconds) for 11 non-schizophrenics and 6 schizophrenics (30 measurements for each person). Summarize and compare descriptive statistics of the measurements from the two groups. Source: Belin, T., & Rubin, D. (1995). The analysis of repeated-measures data on schizophrenic reaction times using mixture models. Statistics in Medicine 14(8), 747-768.

read the data and check structure

create variables

Long format

## Warning: package 'reshape' was built under R version 3.6.3
## 
## Attaching package: 'reshape'
## The following objects are masked from 'package:reshape2':
## 
##     colsplit, melt, recast

average RT for each subject

##    dtalong$ID dtalong$RT
## 1           1   311.0667
## 2           2   366.6667
## 3           3   306.2000
## 4           4   303.6000
## 5           5   265.2000
## 6           6   339.8000
## 7           7   358.1333
## 8           8   268.4667
## 9           9   257.7333
## 10         10   325.6667
## 11         11   309.3333
## 12         12   303.5333
## 13         13   419.0667
## 14         14   635.8667
## 15         15   599.8667
## 16         16   594.3333
## 17         17   488.5333

box plot

ANOVA

## 
## Error: ID
##       Df  Sum Sq Mean Sq
## schiz  1 3503780 3503780
## 
## Error: ID:time
##           Df  Sum Sq Mean Sq F value Pr(>F)
## Residuals 29 1232036   42484               
## 
## Error: Within
##            Df   Sum Sq Mean Sq F value   Pr(>F)    
## schiz       1  1042372 1042372   39.92 6.05e-10 ***
## Residuals 478 12479824   26108                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1