I have to analyze a questionaire. The questionaire has three versions (A, B, C). Each person answered only one version eg. person1 answered version A, person2 answered version B etc. Each version contains of 13 questions (3 versions x 13 questions = 39 variables).

Now, I had to calculate the aggregated mean for each variable [sum of values/number of persons who answered the corresponding version of the questionaire]. That was the easy task.

The next step is to add up the means of different variables, eg. A1 [version A question1]+B3+C4.

And here is my problem:

The fact that every person only answered one version of the questionaire means that each case has 26 of the 39 variables missing (or 0, if you like).

The dataset looks like:

Code: Select all

```
ID A1 A2 A3 B1 B2 B3 C1 C2 C3
-----------------------------------------
person1 1 4 2 0 0 0 0 0 0
person2 0 0 0 2 3 1 0 0 0
person3 0 0 0 0 0 0 1 1 3
```

RECODE doesn't solve my problem because I don't have fixed values that the 0 could be recoded into (the aggregated means change with every person that is added to the dataset).

The dataset should ideally look like this:

Code: Select all

```
ID A1 A2 A3 B1 B2 B3 C1 C2 C3
-----------------------------------------
person1 1 4 2 2 3 1 1 1 3
person2 1 4 2 2 3 1 1 1 3
person3 1 4 2 2 3 1 1 1 3
```

I could do this by hand via copy&paste but the dataset contains of over 600 cases and 39 variables. A solution via syntax would be the easiest and least time consuming answer.