Week 5 Validity

A test has validity if it measures what it purports to measure. There are three types of validities; content validity, criterion-related validity, and construct validity. In this chapter, we will focus on the criterion-validity and demonstrate how to obtain a validity coefficient \(\rho_{XY}\).

5.1 read.table

Let’s download the two datasets from the following link and save them in your local computer:

Before importing a data file from a local directory, you need to set the working directory of RStudio. On the View pane, click on ... and set the directory where your data file is located.

Then click on More -> Set as Working Directory.

Then RStudio will be able to import data sets located under your working directory. Let’s import the two data files using read.table() function.

test1 <- read.table("test1.txt")
test2 <- read.table("test2.txt")

Let’s check the number of rows and columns.

nrow(test1)
## [1] 100
nrow(test2)
## [1] 100
ncol(test1)
## [1] 20
ncol(test2)
## [1] 20

Both data sets contain responses from 100 subjects and 20 items.