forked from duongnguyen/Statistics-One
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Homwork Excercise week 2 row.R
13 lines (13 loc) · 861 Bytes
/
Homwork Excercise week 2 row.R
1
2
3
4
5
6
7
8
9
10
11
12
13
#Statistics One, Lecture 6, example script
#Test/retest reliability analysis, collumn format
library(psych)
impact.row <- read.table ("supplemental_STATS1.EX.03.ROW.txt", header=T)
names(impact.row)
describe(impact.row)
print(cor(impact.row$memory.verbal[impact.row$test=="A"], impact.row$memory.verbal[impact.row$test=="B"]))
print(cor(impact.row$memory.visual[impact.row$test=="A"], impact.row$memory.visual[impact.row$test=="B"]))
print(cor(impact.row$speed.vismotor[impact.row$test=="A"], impact.row$speed.vismotor[impact.row$test=="B"]))
print(cor(impact.row$speed.general[impact.row$test=="A"], impact.row$speed.general[impact.row$test=="B"]))
print(cor(impact.row$impulse.control[impact.row$test=="A"], impact.row$impulse.control[impact.row$test=="B"]))
#describe.by used when have two catergory variables
print(describe.by(impact.row, impact.row$test))