#Loading Required Packages
library(ez)# For conducting ANOVA easily
library(multcomp)# For conducting post-hoc tests
library(nlme) # Just in case we want to run a multilevel model
library(pastecs) # To run descriptive analyses
library(reshape) # If I have to reshape the table
library(WRS) # to conduct robust tests
library(tidyverse)
library(dplyr)
rm(list = ls())
library(foreign)
GRADE_MARSI <- read.spss("Overton Summer 2021 School Data.sav")
GRADE_MARSI <- as.data.frame(GRADE_MARSI)
str(GRADE_MARSI)
'data.frame': 20 obs. of 112 variables:
$ LastName : Factor w/ 20 levels "Bobbitt","Boney",..: 1 2 3 4 5 6 7 8 9 10 ...
$ FirstName : Factor w/ 20 levels "Makynna","Hattie",..: 1 2 3 4 5 6 7 8 9 10 ...
$ Gender : Factor w/ 2 levels "Male","Female": 2 2 2 1 2 2 2 1 1 1 ...
$ Ethnicity : num NA NA NA NA NA NA NA NA NA NA ...
$ Grade : Factor w/ 3 levels "Third Grade",..: 1 1 1 1 1 1 2 2 2 2 ...
$ Teacher : Factor w/ 4 levels "Maryanna Luna",..: 1 1 1 1 1 1 2 2 2 2 ...
$ Attendance : num 16 18 11 17 14 15 17 10 15 18 ...
$ Wordsread : num 51858 28575 49406 38867 33160 ...
$ MARSIGRSPre : num 2.4 1.8 3.2 3.4 3 3.4 1.6 2.2 3.4 2.6 ...
$ MARSIGRSPost : num 3.2 3.4 NA 4 3.2 3.2 2.6 NA 5 3.8 ...
$ MARSIPSSPre : num 3 4 3.4 2.6 4.4 3.8 3.8 2 4 2.2 ...
$ MARSIPSSPost : num 3 5 NA 2.6 3.8 3.8 3 NA 5 4.2 ...
$ MARSISRSPre : num 2.8 2 3 3 4 3.6 3.6 3.6 4.2 3.4 ...
$ MARSISRSPost : num 2.8 4.2 NA 3 3.4 4.2 4 NA 5 2.8 ...
$ MARSITotalPre : num 2.73 2.6 3.2 3 3.8 3.8 3 2.6 3.86 2.73 ...
$ MARSITotalPost : num 3 4.2 NA 3.2 3.46 3.73 3.2 NA 5 3.6 ...
$ GRADEWRRawPre : num 27 28 23 28 24 28 NA NA NA NA ...
$ GRADEWRRawPost : num 28 29 NA 30 24 26 NA NA NA NA ...
$ GRADEWRStaninePre : num 4 5 3 5 3 5 NA NA NA NA ...
$ GRADEWRStaninePost : num 5 6 NA 8 3 4 NA NA NA NA ...
$ GRADEWRGEPre : num NA NA NA NA NA NA NA NA NA NA ...
$ GRADEWRGEPost : num NA NA NA NA NA NA NA NA NA NA ...
$ GRADEWRSSPre : num NA NA NA NA NA NA NA NA NA NA ...
$ GRADEWRSSPost : num NA NA NA NA NA NA NA NA NA NA ...
$ GRADEWRNCEPre : num NA NA NA NA NA NA NA NA NA NA ...
$ GRADEWRNCEPost : num NA NA NA NA NA NA NA NA NA NA ...
$ GRADEWRGSVPre : num NA NA NA NA NA NA NA NA NA NA ...
$ GRADEWRGSVPost : num NA NA NA NA NA NA NA NA NA NA ...
$ GRADEVocRSPre : num 20 16 15 7 14 21 19 15 19 15 ...
$ GRADEVocRSPost : num 12 18 NA 6 15 NA 14 NA 17 13 ...
$ GRADEVocStaninePre : num 5 4 4 2 3 5 4 4 4 3 ...
$ GRADEVocStaninePost : num 3 4 NA 1 4 NA 4 NA 5 4 ...
$ GRADEVocGEPre : num NA NA NA NA NA NA 4.2 3.4 4.2 3.4 ...
$ GRADEVocGEPost : num NA NA NA NA NA NA 3.2 NA 3.8 3 ...
$ GRADEVocSSPre : num NA NA NA NA NA NA 95 93 95 87 ...
$ GRADEVocSSPost : num NA NA NA NA NA NA 91 NA 96 89 ...
$ GRADEVocNCEPre : num NA NA NA NA NA NA 43 40 43 32 ...
$ GRADEVocNCEPost : num NA NA NA NA NA NA 37 NA 44 35 ...
$ GRADEVocGSVPre : num NA NA NA NA NA NA NA NA NA NA ...
$ GRADEVocGSVPost : num NA NA NA NA NA NA NA NA NA NA ...
$ GRADEVocCompRSPre : num 47 44 38 35 38 49 NA NA NA NA ...
$ GRADEVocCompRSPost : num 40 47 NA 36 39 NA NA NA NA NA ...
$ GRADEVocCompStaninePre : num 5 4 3 2 3 5 NA NA NA NA ...
$ GRADEVocCompStaninePost : num 3 5 NA 3 3 NA NA NA NA NA ...
$ GRADEVocCompGEPre : num 2.5 2.3 2 1.9 2 2.7 NA NA NA NA ...
$ GRADEVocCompGEPost : num 2.1 2.5 NA 1.9 2 NA NA NA NA NA ...
$ GRADEVocCompSSPre : num 97 93 86 82 86 100 NA NA NA NA ...
$ GRADEVocCompSSPost : num 88 96 NA 83 86 NA NA NA NA NA ...
$ GRADEVocCompNCEPre : num 46 40 30 25 30 50 NA NA NA NA ...
$ GRADEVocCompNCEPost : num 33 44 NA 26 30 NA NA NA NA NA ...
$ GRADEVocCompGSVPre : num NA NA NA NA NA NA NA NA NA NA ...
$ GRADEVocCompGSVPost : num NA NA NA NA NA NA NA NA NA NA ...
$ GRADESenCompRSPre : num 14 14 10 8 13 15 13 8 15 13 ...
$ GRADESenCompRSPost : num 9 17 NA 8 12 NA 13 NA 12 10 ...
$ GRADESenCompStaninePre : num 4 4 3 2 4 4 5 3 5 5 ...
$ GRADESenCompStaninePost : num 3 4 NA 2 3 NA 5 NA 4 4 ...
$ GRADESenCompGEPre : num NA NA NA NA NA NA NA NA NA NA ...
$ GRADESenCompGEPost : num NA NA NA NA NA NA NA NA NA NA ...
$ GRADESenCompSSPre : num NA NA NA NA NA NA NA NA NA NA ...
$ GRADESenCompSSPost : num NA NA NA NA NA NA NA NA NA NA ...
$ GRADESenCompNCEPre : num NA NA NA NA NA NA NA NA NA NA ...
$ GRADESenCompNCEPost : num NA NA NA NA NA NA NA NA NA NA ...
$ GRADESenCompGSVPre : num NA NA NA NA NA NA NA NA NA NA ...
$ GRADESenCompGSVPost : num NA NA NA NA NA NA NA NA NA NA ...
$ GRADEPassCompRSPre : num 9 9 8 6 11 12 12 11 10 14 ...
$ GRADEPassCompRSPost : num 9 17 NA 4 14 NA 18 NA 11 11 ...
$ GRADEPassCompStaninePre : num 3 3 3 2 4 4 4 4 3 5 ...
$ GRADEPassCompStaninePost: num 3 5 NA 1 4 NA 5 NA 4 4 ...
$ GRADEPassCompGEPre : num NA NA NA NA NA NA NA NA NA NA ...
$ GRADEPassCompGEPost : num NA NA NA NA NA NA NA NA NA NA ...
$ GRADEPassCompSSPre : num NA NA NA NA NA NA NA NA NA NA ...
$ GRADEPassCompSSPost : num NA NA NA NA NA NA NA NA NA NA ...
$ GRADEPassCompNCEPre : num NA NA NA NA NA NA NA NA NA NA ...
$ GRADEPassCompNCEPost : num NA NA NA NA NA NA NA NA NA NA ...
$ GRADEPassCompGSVPre : num NA NA NA NA NA NA NA NA NA NA ...
$ GRADEPassCompGSVPost : num NA NA NA NA NA NA NA NA NA NA ...
$ GRADECompCompRSPre : num 23 23 18 14 24 27 25 19 25 27 ...
$ GRADECompCompRSPost : num 18 34 NA 12 26 NA 31 NA 23 21 ...
$ GRADECompCompStaninePre : num 3 3 3 2 4 4 4 3 4 4 ...
$ GRADECompCompStaninePost: num 3 5 NA 2 4 NA 5 NA 4 4 ...
$ GRADECompCompGEPre : num 2.1 2.1 1.8 1.5 2.2 2.5 3.4 2.6 3.4 3.7 ...
$ GRADECompCompGEPost : num 1.8 3.4 NA 1.3 2.4 NA 4.4 NA 3.1 2.9 ...
$ GRADECompCompSSPre : num 88 88 82 77 90 93 90 88 90 92 ...
$ GRADECompCompSSPost : num 82 102 NA 74 92 NA 102 NA 93 91 ...
$ GRADECompCompNCEPre : num 33 33 25 18 36 40 36 33 36 39 ...
$ GRADECompCompNCEPost : num 25 53 NA 13 39 NA 53 NA 40 37 ...
$ GRADECompCompGSVPre : num NA NA NA NA NA NA NA NA NA NA ...
$ GRADECompCompGSVPost : num NA NA NA NA NA NA NA NA NA NA ...
$ GRADETotalTRSPre : num 70 67 56 49 62 76 44 34 44 42 ...
$ GRADETotalTRSPost : num 58 81 NA 48 65 NA 45 NA 40 34 ...
$ GRADETotalTStaninePre : num 4 4 3 2 3 5 4 4 4 4 ...
$ GRADETotalTStaninePost : num 3 5 NA 2 4 NA 5 NA 4 4 ...
$ GRADETotalTGEPre : num 2.4 2.3 2 1.8 2.1 2.7 3.7 2.8 3.7 3.5 ...
$ GRADETotalTGEPost : num 2 3.1 NA 1.8 2.2 NA 3.8 NA 3.3 2.8 ...
$ GRADETotalTSSPre : num 92 90 84 79 87 96 91 90 91 90 ...
$ GRADETotalTSSPost : num 84 100 NA 78 89 NA 98 NA 95 90 ...
$ GRADETotalTNCEPre : num 39 36 28 21 32 44 37 36 37 36 ...
$ GRADETotalTNCEPost : num 28 50 NA 19 35 NA 47 NA 43 36 ...
$ GRADETotalTGSVPre : num 406 401 385 375 394 415 434 417 434 430 ...
[list output truncated]
Grade_Data <- dplyr::select(GRADE_MARSI,"LastName", "Gender","Grade", "Attendance", "Wordsread","GRADEVocStaninePre","GRADEVocStaninePost","GRADESenCompStaninePre","GRADESenCompStaninePost","GRADEPassCompStaninePre","GRADEPassCompStaninePost","GRADECompCompStaninePre","GRADECompCompStaninePost","GRADETotalTStaninePre","GRADETotalTStaninePost","GRADEListCompStaninePre","GRADEListCompStaninePost")
Grade_Data
LastName Gender Grade Attendance Wordsread
1 Bobbitt Female Third Grade 16 51858
2 Boney Female Third Grade 18 28575
3 Devora Female Third Grade 11 49406
4 Holland Male Third Grade 17 38867
5 Nelson Female Third Grade 14 33160
6 Valenzuela Female Third Grade 15 108885
7 Hawkins Female Fourth Grade 17 16631
8 Mair Male Fourth Grade 10 NA
9 Martinez Male Fourth Grade 15 19578
10 Murphy Male Fourth Grade 18 21316
11 Valdetero Female Fourth Grade 18 19662
12 Beck Female Fifth Grade 3 NA
13 Boney_duplicated_13 Male Fifth Grade 14 30453
14 Hamilton Female Fifth Grade 17 31066
15 Harvey Female Fifth Grade 17 71353
16 Holleman Female Fifth Grade 16 48149
17 Johnson Female Fifth Grade 18 36191
18 Nelson_duplicated_18 Female Fifth Grade 5 NA
19 Williams Male Fifth Grade 2 NA
20 Gurley Female Fourth Grade 1 NA
GRADEVocStaninePre GRADEVocStaninePost GRADESenCompStaninePre
1 5 3 4
2 4 4 4
3 4 NA 3
4 2 1 2
5 3 4 4
6 5 NA 4
7 4 4 5
8 4 NA 3
9 4 5 5
10 3 4 5
11 2 4 4
12 4 NA 5
13 4 4 3
14 3 4 2
15 3 4 3
16 5 5 5
17 5 3 5
18 4 NA 4
19 NA NA NA
20 NA NA NA
GRADESenCompStaninePost GRADEPassCompStaninePre GRADEPassCompStaninePost
1 3 3 3
2 4 3 5
3 NA 3 NA
4 2 2 1
5 3 4 4
6 NA 4 NA
7 5 4 5
8 NA 4 NA
9 4 3 4
10 4 5 4
11 4 4 4
12 NA 6 NA
13 2 2 4
14 3 2 4
15 5 3 4
16 5 6 7
17 4 4 4
18 NA 6 NA
19 NA NA NA
20 NA 3 NA
GRADECompCompStaninePre GRADECompCompStaninePost GRADETotalTStaninePre
1 3 3 4
2 3 5 4
3 3 NA 3
4 2 2 2
5 4 4 3
6 4 NA 5
7 4 5 4
8 3 NA 4
9 4 4 4
10 4 4 4
11 3 4 3
12 6 NA 5
13 2 3 3
14 2 4 2
15 3 4 3
16 6 6 6
17 4 4 5
18 5 NA 5
19 NA NA NA
20 NA NA NA
GRADETotalTStaninePost GRADEListCompStaninePre GRADEListCompStaninePost
1 3 5 3
2 5 3 3
3 NA 5 NA
4 2 3 2
5 4 3 2
6 NA 7 3
7 5 7 3
8 NA 4 NA
9 4 9 3
10 4 5 1
11 4 7 2
12 NA 3 NA
13 3 5 5
14 4 7 5
15 4 3 2
16 6 4 7
17 4 1 3
18 NA 3 NA
19 NA NA NA
20 NA 5 NA
Grade_Data <- Grade_Data[-c(3,6,8,12,18,19,20),]
Grade_Data
LastName Gender Grade Attendance Wordsread
1 Bobbitt Female Third Grade 16 51858
2 Boney Female Third Grade 18 28575
4 Holland Male Third Grade 17 38867
5 Nelson Female Third Grade 14 33160
7 Hawkins Female Fourth Grade 17 16631
9 Martinez Male Fourth Grade 15 19578
10 Murphy Male Fourth Grade 18 21316
11 Valdetero Female Fourth Grade 18 19662
13 Boney_duplicated_13 Male Fifth Grade 14 30453
14 Hamilton Female Fifth Grade 17 31066
15 Harvey Female Fifth Grade 17 71353
16 Holleman Female Fifth Grade 16 48149
17 Johnson Female Fifth Grade 18 36191
GRADEVocStaninePre GRADEVocStaninePost GRADESenCompStaninePre
1 5 3 4
2 4 4 4
4 2 1 2
5 3 4 4
7 4 4 5
9 4 5 5
10 3 4 5
11 2 4 4
13 4 4 3
14 3 4 2
15 3 4 3
16 5 5 5
17 5 3 5
GRADESenCompStaninePost GRADEPassCompStaninePre GRADEPassCompStaninePost
1 3 3 3
2 4 3 5
4 2 2 1
5 3 4 4
7 5 4 5
9 4 3 4
10 4 5 4
11 4 4 4
13 2 2 4
14 3 2 4
15 5 3 4
16 5 6 7
17 4 4 4
GRADECompCompStaninePre GRADECompCompStaninePost GRADETotalTStaninePre
1 3 3 4
2 3 5 4
4 2 2 2
5 4 4 3
7 4 5 4
9 4 4 4
10 4 4 4
11 3 4 3
13 2 3 3
14 2 4 2
15 3 4 3
16 6 6 6
17 4 4 5
GRADETotalTStaninePost GRADEListCompStaninePre GRADEListCompStaninePost
1 3 5 3
2 5 3 3
4 2 3 2
5 4 3 2
7 5 7 3
9 4 9 3
10 4 5 1
11 4 7 2
13 3 5 5
14 4 7 5
15 4 3 2
16 6 4 7
17 4 1 3
ID <- as.data.frame(paste("Student", 1:13))
colnames(ID)[1] <- "Std_ID"
# Checking
ID
Std_ID
1 Student 1
2 Student 2
3 Student 3
4 Student 4
5 Student 5
6 Student 6
7 Student 7
8 Student 8
9 Student 9
10 Student 10
11 Student 11
12 Student 12
13 Student 13
Grd_Data <- cbind(ID, Grade_Data)
# Checking
Grd_Data
Std_ID LastName Gender Grade Attendance Wordsread
1 Student 1 Bobbitt Female Third Grade 16 51858
2 Student 2 Boney Female Third Grade 18 28575
4 Student 3 Holland Male Third Grade 17 38867
5 Student 4 Nelson Female Third Grade 14 33160
7 Student 5 Hawkins Female Fourth Grade 17 16631
9 Student 6 Martinez Male Fourth Grade 15 19578
10 Student 7 Murphy Male Fourth Grade 18 21316
11 Student 8 Valdetero Female Fourth Grade 18 19662
13 Student 9 Boney_duplicated_13 Male Fifth Grade 14 30453
14 Student 10 Hamilton Female Fifth Grade 17 31066
15 Student 11 Harvey Female Fifth Grade 17 71353
16 Student 12 Holleman Female Fifth Grade 16 48149
17 Student 13 Johnson Female Fifth Grade 18 36191
GRADEVocStaninePre GRADEVocStaninePost GRADESenCompStaninePre
1 5 3 4
2 4 4 4
4 2 1 2
5 3 4 4
7 4 4 5
9 4 5 5
10 3 4 5
11 2 4 4
13 4 4 3
14 3 4 2
15 3 4 3
16 5 5 5
17 5 3 5
GRADESenCompStaninePost GRADEPassCompStaninePre GRADEPassCompStaninePost
1 3 3 3
2 4 3 5
4 2 2 1
5 3 4 4
7 5 4 5
9 4 3 4
10 4 5 4
11 4 4 4
13 2 2 4
14 3 2 4
15 5 3 4
16 5 6 7
17 4 4 4
GRADECompCompStaninePre GRADECompCompStaninePost GRADETotalTStaninePre
1 3 3 4
2 3 5 4
4 2 2 2
5 4 4 3
7 4 5 4
9 4 4 4
10 4 4 4
11 3 4 3
13 2 3 3
14 2 4 2
15 3 4 3
16 6 6 6
17 4 4 5
GRADETotalTStaninePost GRADEListCompStaninePre GRADEListCompStaninePost
1 3 5 3
2 5 3 3
4 2 3 2
5 4 3 2
7 5 7 3
9 4 9 3
10 4 5 1
11 4 7 2
13 3 5 5
14 4 7 5
15 4 3 2
16 6 4 7
17 4 1 3
Grd_Data <- Grd_Data[,-2]
# Checking
Grd_Data
Std_ID Gender Grade Attendance Wordsread GRADEVocStaninePre
1 Student 1 Female Third Grade 16 51858 5
2 Student 2 Female Third Grade 18 28575 4
4 Student 3 Male Third Grade 17 38867 2
5 Student 4 Female Third Grade 14 33160 3
7 Student 5 Female Fourth Grade 17 16631 4
9 Student 6 Male Fourth Grade 15 19578 4
10 Student 7 Male Fourth Grade 18 21316 3
11 Student 8 Female Fourth Grade 18 19662 2
13 Student 9 Male Fifth Grade 14 30453 4
14 Student 10 Female Fifth Grade 17 31066 3
15 Student 11 Female Fifth Grade 17 71353 3
16 Student 12 Female Fifth Grade 16 48149 5
17 Student 13 Female Fifth Grade 18 36191 5
GRADEVocStaninePost GRADESenCompStaninePre GRADESenCompStaninePost
1 3 4 3
2 4 4 4
4 1 2 2
5 4 4 3
7 4 5 5
9 5 5 4
10 4 5 4
11 4 4 4
13 4 3 2
14 4 2 3
15 4 3 5
16 5 5 5
17 3 5 4
GRADEPassCompStaninePre GRADEPassCompStaninePost GRADECompCompStaninePre
1 3 3 3
2 3 5 3
4 2 1 2
5 4 4 4
7 4 5 4
9 3 4 4
10 5 4 4
11 4 4 3
13 2 4 2
14 2 4 2
15 3 4 3
16 6 7 6
17 4 4 4
GRADECompCompStaninePost GRADETotalTStaninePre GRADETotalTStaninePost
1 3 4 3
2 5 4 5
4 2 2 2
5 4 3 4
7 5 4 5
9 4 4 4
10 4 4 4
11 4 3 4
13 3 3 3
14 4 2 4
15 4 3 4
16 6 6 6
17 4 5 4
GRADEListCompStaninePre GRADEListCompStaninePost
1 5 3
2 3 3
4 3 2
5 3 2
7 7 3
9 9 3
10 5 1
11 7 2
13 5 5
14 7 5
15 3 2
16 4 7
17 1 3
# 1. Demographic Table
Table_Demographic <- select(Grd_Data, 1:5)
Table_Demographic
Std_ID Gender Grade Attendance Wordsread
1 Student 1 Female Third Grade 16 51858
2 Student 2 Female Third Grade 18 28575
4 Student 3 Male Third Grade 17 38867
5 Student 4 Female Third Grade 14 33160
7 Student 5 Female Fourth Grade 17 16631
9 Student 6 Male Fourth Grade 15 19578
10 Student 7 Male Fourth Grade 18 21316
11 Student 8 Female Fourth Grade 18 19662
13 Student 9 Male Fifth Grade 14 30453
14 Student 10 Female Fifth Grade 17 31066
15 Student 11 Female Fifth Grade 17 71353
16 Student 12 Female Fifth Grade 16 48149
17 Student 13 Female Fifth Grade 18 36191
# 2. Pretest Table
Table_Pretest <- select(Grd_Data,1, 6, 8, 10,12,14,16)
Table_Pretest
Std_ID GRADEVocStaninePre GRADESenCompStaninePre GRADEPassCompStaninePre
1 Student 1 5 4 3
2 Student 2 4 4 3
4 Student 3 2 2 2
5 Student 4 3 4 4
7 Student 5 4 5 4
9 Student 6 4 5 3
10 Student 7 3 5 5
11 Student 8 2 4 4
13 Student 9 4 3 2
14 Student 10 3 2 2
15 Student 11 3 3 3
16 Student 12 5 5 6
17 Student 13 5 5 4
GRADECompCompStaninePre GRADETotalTStaninePre GRADEListCompStaninePre
1 3 4 5
2 3 4 3
4 2 2 3
5 4 3 3
7 4 4 7
9 4 4 9
10 4 4 5
11 3 3 7
13 2 3 5
14 2 2 7
15 3 3 3
16 6 6 4
17 4 5 1
# 3. Posttest Table
Table_Posttest <- select(Grd_Data,1, 7, 9, 11,13,15,17)
Table_Posttest
Std_ID GRADEVocStaninePost GRADESenCompStaninePost
1 Student 1 3 3
2 Student 2 4 4
4 Student 3 1 2
5 Student 4 4 3
7 Student 5 4 5
9 Student 6 5 4
10 Student 7 4 4
11 Student 8 4 4
13 Student 9 4 2
14 Student 10 4 3
15 Student 11 4 5
16 Student 12 5 5
17 Student 13 3 4
GRADEPassCompStaninePost GRADECompCompStaninePost GRADETotalTStaninePost
1 3 3 3
2 5 5 5
4 1 2 2
5 4 4 4
7 5 5 5
9 4 4 4
10 4 4 4
11 4 4 4
13 4 3 3
14 4 4 4
15 4 4 4
16 7 6 6
17 4 4 4
GRADEListCompStaninePost
1 3
2 3
4 2
5 2
7 3
9 3
10 1
11 2
13 5
14 5
15 2
16 7
17 3
# Melting the 6 Columns in 2, i.e., ‘variable’ and ‘value’ (default) Columns
Table_Pretest1 <- melt(Table_Pretest, id = "Std_ID", measured = c("GRADEVocStaninePre","GRADESenCompStaninePre","GRADEPassCompStaninePre","GRADECompCompStaninePre","GRADETotalTStaninePre","GRADEListCompStaninePre"))
# Checking
head((Table_Pretest1),15)
Std_ID variable value
1 Student 1 GRADEVocStaninePre 5
2 Student 2 GRADEVocStaninePre 4
3 Student 3 GRADEVocStaninePre 2
4 Student 4 GRADEVocStaninePre 3
5 Student 5 GRADEVocStaninePre 4
6 Student 6 GRADEVocStaninePre 4
7 Student 7 GRADEVocStaninePre 3
8 Student 8 GRADEVocStaninePre 2
9 Student 9 GRADEVocStaninePre 4
10 Student 10 GRADEVocStaninePre 3
11 Student 11 GRADEVocStaninePre 3
12 Student 12 GRADEVocStaninePre 5
13 Student 13 GRADEVocStaninePre 5
14 Student 1 GRADESenCompStaninePre 4
15 Student 2 GRADESenCompStaninePre 4
colnames(Table_Pretest1) <- c("Std_ID", "Score_Types", "Pretest_Scores")
# Checking
head(Table_Pretest1)
Std_ID Score_Types Pretest_Scores
1 Student 1 GRADEVocStaninePre 5
2 Student 2 GRADEVocStaninePre 4
3 Student 3 GRADEVocStaninePre 2
4 Student 4 GRADEVocStaninePre 3
5 Student 5 GRADEVocStaninePre 4
6 Student 6 GRADEVocStaninePre 4
Table_Pretest1$Score_Types <- factor(Table_Pretest1$Score_Types, labels = c("Vocabulary","Sentence Comprehension","Passage Comprehension","Comprehension Composite","Total Test","Listening Comprehension"))
# Checking
Table_Pretest1
Std_ID Score_Types Pretest_Scores
1 Student 1 Vocabulary 5
2 Student 2 Vocabulary 4
3 Student 3 Vocabulary 2
4 Student 4 Vocabulary 3
5 Student 5 Vocabulary 4
6 Student 6 Vocabulary 4
7 Student 7 Vocabulary 3
8 Student 8 Vocabulary 2
9 Student 9 Vocabulary 4
10 Student 10 Vocabulary 3
11 Student 11 Vocabulary 3
12 Student 12 Vocabulary 5
13 Student 13 Vocabulary 5
14 Student 1 Sentence Comprehension 4
15 Student 2 Sentence Comprehension 4
16 Student 3 Sentence Comprehension 2
17 Student 4 Sentence Comprehension 4
18 Student 5 Sentence Comprehension 5
19 Student 6 Sentence Comprehension 5
20 Student 7 Sentence Comprehension 5
21 Student 8 Sentence Comprehension 4
22 Student 9 Sentence Comprehension 3
23 Student 10 Sentence Comprehension 2
24 Student 11 Sentence Comprehension 3
25 Student 12 Sentence Comprehension 5
26 Student 13 Sentence Comprehension 5
27 Student 1 Passage Comprehension 3
28 Student 2 Passage Comprehension 3
29 Student 3 Passage Comprehension 2
30 Student 4 Passage Comprehension 4
31 Student 5 Passage Comprehension 4
32 Student 6 Passage Comprehension 3
33 Student 7 Passage Comprehension 5
34 Student 8 Passage Comprehension 4
35 Student 9 Passage Comprehension 2
36 Student 10 Passage Comprehension 2
37 Student 11 Passage Comprehension 3
38 Student 12 Passage Comprehension 6
39 Student 13 Passage Comprehension 4
40 Student 1 Comprehension Composite 3
41 Student 2 Comprehension Composite 3
42 Student 3 Comprehension Composite 2
43 Student 4 Comprehension Composite 4
44 Student 5 Comprehension Composite 4
45 Student 6 Comprehension Composite 4
46 Student 7 Comprehension Composite 4
47 Student 8 Comprehension Composite 3
48 Student 9 Comprehension Composite 2
49 Student 10 Comprehension Composite 2
50 Student 11 Comprehension Composite 3
51 Student 12 Comprehension Composite 6
52 Student 13 Comprehension Composite 4
53 Student 1 Total Test 4
54 Student 2 Total Test 4
55 Student 3 Total Test 2
56 Student 4 Total Test 3
57 Student 5 Total Test 4
58 Student 6 Total Test 4
59 Student 7 Total Test 4
60 Student 8 Total Test 3
61 Student 9 Total Test 3
62 Student 10 Total Test 2
63 Student 11 Total Test 3
64 Student 12 Total Test 6
65 Student 13 Total Test 5
66 Student 1 Listening Comprehension 5
67 Student 2 Listening Comprehension 3
68 Student 3 Listening Comprehension 3
69 Student 4 Listening Comprehension 3
70 Student 5 Listening Comprehension 7
71 Student 6 Listening Comprehension 9
72 Student 7 Listening Comprehension 5
73 Student 8 Listening Comprehension 7
74 Student 9 Listening Comprehension 5
75 Student 10 Listening Comprehension 7
76 Student 11 Listening Comprehension 3
77 Student 12 Listening Comprehension 4
78 Student 13 Listening Comprehension 1
# Checking
Table_Posttest1
Std_ID Score_Types Posttest_Scores
1 Student 1 Vocabulary 3
2 Student 2 Vocabulary 4
3 Student 3 Vocabulary 1
4 Student 4 Vocabulary 4
5 Student 5 Vocabulary 4
6 Student 6 Vocabulary 5
7 Student 7 Vocabulary 4
8 Student 8 Vocabulary 4
9 Student 9 Vocabulary 4
10 Student 10 Vocabulary 4
11 Student 11 Vocabulary 4
12 Student 12 Vocabulary 5
13 Student 13 Vocabulary 3
14 Student 1 Sentence Comprehension 3
15 Student 2 Sentence Comprehension 4
16 Student 3 Sentence Comprehension 2
17 Student 4 Sentence Comprehension 3
18 Student 5 Sentence Comprehension 5
19 Student 6 Sentence Comprehension 4
20 Student 7 Sentence Comprehension 4
21 Student 8 Sentence Comprehension 4
22 Student 9 Sentence Comprehension 2
23 Student 10 Sentence Comprehension 3
24 Student 11 Sentence Comprehension 5
25 Student 12 Sentence Comprehension 5
26 Student 13 Sentence Comprehension 4
27 Student 1 Passage Comprehension 3
28 Student 2 Passage Comprehension 5
29 Student 3 Passage Comprehension 1
30 Student 4 Passage Comprehension 4
31 Student 5 Passage Comprehension 5
32 Student 6 Passage Comprehension 4
33 Student 7 Passage Comprehension 4
34 Student 8 Passage Comprehension 4
35 Student 9 Passage Comprehension 4
36 Student 10 Passage Comprehension 4
37 Student 11 Passage Comprehension 4
38 Student 12 Passage Comprehension 7
39 Student 13 Passage Comprehension 4
40 Student 1 Comprehension Composite 3
41 Student 2 Comprehension Composite 5
42 Student 3 Comprehension Composite 2
43 Student 4 Comprehension Composite 4
44 Student 5 Comprehension Composite 5
45 Student 6 Comprehension Composite 4
46 Student 7 Comprehension Composite 4
47 Student 8 Comprehension Composite 4
48 Student 9 Comprehension Composite 3
49 Student 10 Comprehension Composite 4
50 Student 11 Comprehension Composite 4
51 Student 12 Comprehension Composite 6
52 Student 13 Comprehension Composite 4
53 Student 1 Total Test 3
54 Student 2 Total Test 5
55 Student 3 Total Test 2
56 Student 4 Total Test 4
57 Student 5 Total Test 5
58 Student 6 Total Test 4
59 Student 7 Total Test 4
60 Student 8 Total Test 4
61 Student 9 Total Test 3
62 Student 10 Total Test 4
63 Student 11 Total Test 4
64 Student 12 Total Test 6
65 Student 13 Total Test 4
66 Student 1 Listening Comprehension 3
67 Student 2 Listening Comprehension 3
68 Student 3 Listening Comprehension 2
69 Student 4 Listening Comprehension 2
70 Student 5 Listening Comprehension 3
71 Student 6 Listening Comprehension 3
72 Student 7 Listening Comprehension 1
73 Student 8 Listening Comprehension 2
74 Student 9 Listening Comprehension 5
75 Student 10 Listening Comprehension 5
76 Student 11 Listening Comprehension 2
77 Student 12 Listening Comprehension 7
78 Student 13 Listening Comprehension 3
pretest_posttest <- merge(Table_Pretest1,Table_Posttest1, by = c("Std_ID","Score_Types"))
pretest_posttest
Std_ID Score_Types Pretest_Scores Posttest_Scores
1 Student 1 Comprehension Composite 3 3
2 Student 1 Listening Comprehension 5 3
3 Student 1 Passage Comprehension 3 3
4 Student 1 Sentence Comprehension 4 3
5 Student 1 Total Test 4 3
6 Student 1 Vocabulary 5 3
7 Student 10 Comprehension Composite 2 4
8 Student 10 Listening Comprehension 7 5
9 Student 10 Passage Comprehension 2 4
10 Student 10 Sentence Comprehension 2 3
11 Student 10 Total Test 2 4
12 Student 10 Vocabulary 3 4
13 Student 11 Comprehension Composite 3 4
14 Student 11 Listening Comprehension 3 2
15 Student 11 Passage Comprehension 3 4
16 Student 11 Sentence Comprehension 3 5
17 Student 11 Total Test 3 4
18 Student 11 Vocabulary 3 4
19 Student 12 Comprehension Composite 6 6
20 Student 12 Listening Comprehension 4 7
21 Student 12 Passage Comprehension 6 7
22 Student 12 Sentence Comprehension 5 5
23 Student 12 Total Test 6 6
24 Student 12 Vocabulary 5 5
25 Student 13 Comprehension Composite 4 4
26 Student 13 Listening Comprehension 1 3
27 Student 13 Passage Comprehension 4 4
28 Student 13 Sentence Comprehension 5 4
29 Student 13 Total Test 5 4
30 Student 13 Vocabulary 5 3
31 Student 2 Comprehension Composite 3 5
32 Student 2 Listening Comprehension 3 3
33 Student 2 Passage Comprehension 3 5
34 Student 2 Sentence Comprehension 4 4
35 Student 2 Total Test 4 5
36 Student 2 Vocabulary 4 4
37 Student 3 Comprehension Composite 2 2
38 Student 3 Listening Comprehension 3 2
39 Student 3 Passage Comprehension 2 1
40 Student 3 Sentence Comprehension 2 2
41 Student 3 Total Test 2 2
42 Student 3 Vocabulary 2 1
43 Student 4 Comprehension Composite 4 4
44 Student 4 Listening Comprehension 3 2
45 Student 4 Passage Comprehension 4 4
46 Student 4 Sentence Comprehension 4 3
47 Student 4 Total Test 3 4
48 Student 4 Vocabulary 3 4
49 Student 5 Comprehension Composite 4 5
50 Student 5 Listening Comprehension 7 3
51 Student 5 Passage Comprehension 4 5
52 Student 5 Sentence Comprehension 5 5
53 Student 5 Total Test 4 5
54 Student 5 Vocabulary 4 4
55 Student 6 Comprehension Composite 4 4
56 Student 6 Listening Comprehension 9 3
57 Student 6 Passage Comprehension 3 4
58 Student 6 Sentence Comprehension 5 4
59 Student 6 Total Test 4 4
60 Student 6 Vocabulary 4 5
61 Student 7 Comprehension Composite 4 4
62 Student 7 Listening Comprehension 5 1
63 Student 7 Passage Comprehension 5 4
64 Student 7 Sentence Comprehension 5 4
65 Student 7 Total Test 4 4
66 Student 7 Vocabulary 3 4
67 Student 8 Comprehension Composite 3 4
68 Student 8 Listening Comprehension 7 2
69 Student 8 Passage Comprehension 4 4
70 Student 8 Sentence Comprehension 4 4
71 Student 8 Total Test 3 4
72 Student 8 Vocabulary 2 4
73 Student 9 Comprehension Composite 2 3
74 Student 9 Listening Comprehension 5 5
75 Student 9 Passage Comprehension 2 4
76 Student 9 Sentence Comprehension 3 2
77 Student 9 Total Test 3 3
78 Student 9 Vocabulary 4 4
Grd_Long <- merge(Table_Demographic,pretest_posttest, by = "Std_ID")
str(Grd_Long)
'data.frame': 78 obs. of 8 variables:
$ Std_ID : chr "Student 1" "Student 1" "Student 1" "Student 1" ...
$ Gender : Factor w/ 2 levels "Male","Female": 2 2 2 2 2 2 2 2 2 2 ...
$ Grade : Factor w/ 3 levels "Third Grade",..: 1 1 1 1 1 1 3 3 3 3 ...
$ Attendance : num 16 16 16 16 16 16 17 17 17 17 ...
$ Wordsread : num 51858 51858 51858 51858 51858 ...
$ Score_Types : Factor w/ 6 levels "Vocabulary","Sentence Comprehension",..: 4 6 3 2 5 1 4 6 3 2 ...
$ Pretest_Scores : num 3 5 3 4 4 5 2 7 2 2 ...
$ Posttest_Scores: num 3 3 3 3 3 3 4 5 4 3 ...
write.csv(Grd_Long, file = "Grd_Long.csv", row.names = FALSE)
head(Grd_Data)
Std_ID Gender Grade Attendance Wordsread GRADEVocStaninePre
1 Student 1 Female Third Grade 16 51858 5
2 Student 2 Female Third Grade 18 28575 4
4 Student 3 Male Third Grade 17 38867 2
5 Student 4 Female Third Grade 14 33160 3
7 Student 5 Female Fourth Grade 17 16631 4
9 Student 6 Male Fourth Grade 15 19578 4
GRADEVocStaninePost GRADESenCompStaninePre GRADESenCompStaninePost
1 3 4 3
2 4 4 4
4 1 2 2
5 4 4 3
7 4 5 5
9 5 5 4
GRADEPassCompStaninePre GRADEPassCompStaninePost GRADECompCompStaninePre
1 3 3 3
2 3 5 3
4 2 1 2
5 4 4 4
7 4 5 4
9 3 4 4
GRADECompCompStaninePost GRADETotalTStaninePre GRADETotalTStaninePost
1 3 4 3
2 5 4 5
4 2 2 2
5 4 3 4
7 5 4 5
9 4 4 4
GRADEListCompStaninePre GRADEListCompStaninePost
1 5 3
2 3 3
4 3 2
5 3 2
7 7 3
9 9 3
Grd_Data$Std_ID <- as.factor(Grd_Data$Std_ID)
Voc_Table <- select(Grd_Data, 1, 6,7)
Sen_Comp <- select(Grd_Data,1,8,9)
Pass_Comp <- select(Grd_Data,1,10,11)
Comp_Comp <- select(Grd_Data,1,12,13)
Total_Table <- select(Grd_Data,1,14,15)
List_Comp <- select(Grd_Data,1,16,17)
head(List_Comp)
Std_ID GRADEListCompStaninePre GRADEListCompStaninePost
1 Student 1 5 3
2 Student 2 3 3
4 Student 3 3 2
5 Student 4 3 2
7 Student 5 7 3
9 Student 6 9 3
library(reshape)
#A. Vocabulary Table
Voc_Table1 <- melt(Voc_Table, id="Std_ID", measured=c("GRADEVocStaninePre","GRADEVocStaninePost"))
colnames(Voc_Table1) <- c("Std_ID", "Test_Type", "Vocabulary_Stanine_Score")
Voc_Table1$Test_Type <- factor(Voc_Table1$Test_Type, labels=c("Pretest", "Posttest"))
#Voc_Table1
# B. Sentence Comprehension Table
Sen_Comp1 <-melt(Sen_Comp, id = "Std_ID", measured= c("GRADESenCompStaninePre","GRADESenCompStaninePost"))
colnames(Sen_Comp1) <- c("Std_ID", "Test_Type", "Sentence_Comprehension_Score")
Sen_Comp1$Test_Type <- factor(Sen_Comp1$Test_Type, labels=c("Pretest", "Posttest"))
# C. Passage Comprehension Table
Pass_Comp1 <- melt(Pass_Comp, id = "Std_ID", measured= c("GRADEPassCompStaninePre","GRADEPassCompStaninePost"))
colnames(Pass_Comp1) <- c("Std_ID", "Test_Type", "Passage_Comprehension_Score")
Pass_Comp1$Test_Type <- factor(Pass_Comp1$Test_Type, labels=c("Pretest", "Posttest"))
# D. Comprehension Composite Table
Comp_Comp1 <- melt(Comp_Comp, id = "Std_ID", measured= c("GRADECompCompStaninePre","GRADECompCompStaninePost"))
colnames(Comp_Comp1) <- c("Std_ID", "Test_Type", "Comprehension_Composite_Score")
Comp_Comp1$Test_Type <- factor(Comp_Comp1$Test_Type, labels=c("Pretest", "Posttest"))
# E. Total Table
Total_Table1 <- melt(Total_Table, id = "Std_ID", measured= c("GRADETotalTStaninePre","GRADETotalTStaninePost"))
colnames(Total_Table1) <- c("Std_ID", "Test_Type", "Total_Score")
Total_Table1$Test_Type <- factor(Total_Table1$Test_Type, labels=c("Pretest", "Posttest"))
# F. Listening Comprehension Table
List_Comp1 <- melt(List_Comp, id = "Std_ID", measured= c("GRADEListCompStaninePre","GRADEListCompStaninePost"))
colnames(List_Comp1) <- c("Std_ID", "Test_Type", "Listening_Comprehension_Score")
List_Comp1$Test_Type <- factor(List_Comp1$Test_Type, labels=c("Pretest", "Posttest"))
List_Comp1
Std_ID Test_Type Listening_Comprehension_Score
1 Student 1 Pretest 5
2 Student 2 Pretest 3
3 Student 3 Pretest 3
4 Student 4 Pretest 3
5 Student 5 Pretest 7
6 Student 6 Pretest 9
7 Student 7 Pretest 5
8 Student 8 Pretest 7
9 Student 9 Pretest 5
10 Student 10 Pretest 7
11 Student 11 Pretest 3
12 Student 12 Pretest 4
13 Student 13 Pretest 1
14 Student 1 Posttest 3
15 Student 2 Posttest 3
16 Student 3 Posttest 2
17 Student 4 Posttest 2
18 Student 5 Posttest 3
19 Student 6 Posttest 3
20 Student 7 Posttest 1
21 Student 8 Posttest 2
22 Student 9 Posttest 5
23 Student 10 Posttest 5
24 Student 11 Posttest 2
25 Student 12 Posttest 7
26 Student 13 Posttest 3
score1 <- merge(Voc_Table1, Sen_Comp1, by = c("Std_ID", "Test_Type"))
score2 <- merge(score1, Pass_Comp1, by = c("Std_ID", "Test_Type"))
score3 <- merge(score2, Comp_Comp1, by = c("Std_ID", "Test_Type"))
score4 <- merge(score3, List_Comp1, by = c("Std_ID", "Test_Type"))
score <- merge(score4, Total_Table1, by = c("Std_ID", "Test_Type"))
Grd_Long2 <- merge(Table_Demographic, score, by = "Std_ID")
Grd_Long2
Std_ID Gender Grade Attendance Wordsread Test_Type
1 Student 1 Female Third Grade 16 51858 Posttest
2 Student 1 Female Third Grade 16 51858 Pretest
3 Student 10 Female Fifth Grade 17 31066 Posttest
4 Student 10 Female Fifth Grade 17 31066 Pretest
5 Student 11 Female Fifth Grade 17 71353 Posttest
6 Student 11 Female Fifth Grade 17 71353 Pretest
7 Student 12 Female Fifth Grade 16 48149 Posttest
8 Student 12 Female Fifth Grade 16 48149 Pretest
9 Student 13 Female Fifth Grade 18 36191 Posttest
10 Student 13 Female Fifth Grade 18 36191 Pretest
11 Student 2 Female Third Grade 18 28575 Posttest
12 Student 2 Female Third Grade 18 28575 Pretest
13 Student 3 Male Third Grade 17 38867 Posttest
14 Student 3 Male Third Grade 17 38867 Pretest
15 Student 4 Female Third Grade 14 33160 Posttest
16 Student 4 Female Third Grade 14 33160 Pretest
17 Student 5 Female Fourth Grade 17 16631 Posttest
18 Student 5 Female Fourth Grade 17 16631 Pretest
19 Student 6 Male Fourth Grade 15 19578 Posttest
20 Student 6 Male Fourth Grade 15 19578 Pretest
21 Student 7 Male Fourth Grade 18 21316 Posttest
22 Student 7 Male Fourth Grade 18 21316 Pretest
23 Student 8 Female Fourth Grade 18 19662 Posttest
24 Student 8 Female Fourth Grade 18 19662 Pretest
25 Student 9 Male Fifth Grade 14 30453 Posttest
26 Student 9 Male Fifth Grade 14 30453 Pretest
Vocabulary_Stanine_Score Sentence_Comprehension_Score
1 3 3
2 5 4
3 4 3
4 3 2
5 4 5
6 3 3
7 5 5
8 5 5
9 3 4
10 5 5
11 4 4
12 4 4
13 1 2
14 2 2
15 4 3
16 3 4
17 4 5
18 4 5
19 5 4
20 4 5
21 4 4
22 3 5
23 4 4
24 2 4
25 4 2
26 4 3
Passage_Comprehension_Score Comprehension_Composite_Score
1 3 3
2 3 3
3 4 4
4 2 2
5 4 4
6 3 3
7 7 6
8 6 6
9 4 4
10 4 4
11 5 5
12 3 3
13 1 2
14 2 2
15 4 4
16 4 4
17 5 5
18 4 4
19 4 4
20 3 4
21 4 4
22 5 4
23 4 4
24 4 3
25 4 3
26 2 2
Listening_Comprehension_Score Total_Score
1 3 3
2 5 4
3 5 4
4 7 2
5 2 4
6 3 3
7 7 6
8 4 6
9 3 4
10 1 5
11 3 5
12 3 4
13 2 2
14 3 2
15 2 4
16 3 3
17 3 5
18 7 4
19 3 4
20 9 4
21 1 4
22 5 4
23 2 4
24 7 3
25 5 3
26 5 3
write.csv(Grd_Long2, file = "Grd_Long2.csv", row.names = FALSE)
Great Job!! You Made it!!