Multiple rows per subject - how to tell sas each subject has multiple rows

Reply
N/A
Posts: 1

Multiple rows per subject - how to tell sas each subject has multiple rows

Help!  I am trying to run a repeated measure MANOVA and each subject has multiple lines of data.  I need to figure out how to tell SAS this.  Here is my design:

Between subjects factor: sex

Repeated measures Location (4 levels) and Time (3 levels).

Dependent variables : ALpha, Beta, and Delta bandwidths of QEEG data

Here is what my data looks like (jsut a brief example so you can see the structure of the data)

Input ID sex time location alpha beta delta

        1    1      1    1          4        5      6

         1     1     1     2          .     .     .

          1     1     1     3        ..     .     .    

          1     1     1     4          .     .     .    

          1     1     2     1

          1     1     2     2    

          1     1     2     3    

          1     1     2     4

          1     1     3     1

          1     1     3     2

          1     1     3     3    

          1     1     3     4

.....................

          2     1     1     1

          2     1     1     2

          2     1     1     3    

          2     1     1     4

AND SO ON..

What I can't figure out is how to tell SAS to recognize that subjects are identified by the ID variable.  When I run the analyses of course I get 300 observations when I actually have 25 subjects.  I've searched all over and I cannot find what would probably be a simple syntax for this.  Can anyone help me?  I need to defend my dissertation asap and this roadblock is the only thing holding me up.  ,

Trusted Advisor
Posts: 3,215

Re: Multiple rows per subject - how to tell sas each subject has multiple rows

There are a lot of ways for having many input lines belonging to one observation. Remember the old hollerith age when SAS started where you need to deal with small sizes as all was big data.

1/ Fixed number of input records belonging to one observation

- read all input records using the input statement and advancing to the next record using a "/"

2/ Many type of record-structures each having a fixed lay-out

- read the identifaction part holding you record using the "@" in the input statement and then read each of them (select when construction)

3/ Variable length records, using the length option in the infile statement using a first input statement holding the line "@".

You are with a ficed number (12) for one record. That is easy SAS(R) 9.3 Statements: Reference   Read those 12 advancing to the next line using a "/"
As a check you can read the repeated id's as a shadow and abend when it is not the same (input validation)

---->-- ja karman --<-----
Trusted Advisor
Posts: 1,230

Re: Multiple rows per subject - how to tell sas each subject has multiple rows

What syntax are you using for MANOVA?

Ask a Question
Discussion stats
  • 2 replies
  • 349 views
  • 0 likes
  • 3 in conversation