Filling in missing data and transposing

Problem

The raw data are structured in the way that the same subject occupies multiple rows, as shown in the following table. There are five items and Q5 are skipped by all examinees, while all the rest are skipped by some examinees.

 

User ID
Item ID
Score

123

Q1

4

123

Q2

2

123

Q3

3

123

Q4

4

124

Q1

3

124

Q2

4

124

Q4

4

125

Q2

2

125

Q3

1

125

Q4

4

The data should be transposed into the following:

 

User ID
Q1
Q2
Q3
Q4
Q5

123

4

2

3

4

.

124

3

4

.

4

.

125

.

2

1

4

.


Solution

In this example, there are only three subjects and give items. It is easier to re-type the data than writing a program. However, it will make a big difference when you have 2000 subjects and 200 items. Before transposing, the missing data must be filled in. The following SAS program shows you how to fill in the missing data and transpose the data.


Thanks Dr. Marlyin Thompson for her input in solving this problem.


 

Navigation

Index

Simplified Navigation

Table of Contents

Search Engine

Contact