Hi. I'm new to SAS so I'd greatly appreciate any help anyone could provide me. So say, I have a data set with ~500 observations and my ultimate goal is to run ANCOVA of this data set with response variable y, factors i and j, and possible covariates k and l. I have 5 levels of i and two levels of j. Since, I first want to try to run a completely balanced ANCOVA, I don't want to use the entire data set, just the first n observations (according to ID) for each of the ten factor-level combinations. I initially wrote a line with IF (ID > 10*n) then delete; before realizing how stupid that is. How would I go about doing this? Here's a mockup of what part of the data looks like: ID i j k l y 1 3 1 2 3 1 3 2 1 4 4 1 5 5 2 6 1 1 7 4 2 8 2 2 9 3 1 10 5 2 11 1 1 12 3 2 13 2 1 14 1 2 15 5 1 ... So i=1, j=1, would have ID 11 as the first observation. and i=2, j=1, would have ID 3, ID 13, etc. It feels like this should be a pretty simple thing to do but I cannot for the life of me figure out how to do it. Would anybody be able to point me in the right direction? Thanks in advance for your help!
... View more