This may be a basic question but it has been difficult to find a solution on my own. I have data that is organized into multiple groups, including trial, treatment, and replication. I wish to create a new variable for the entire data set using values from an observation presently assigned to a given treatment within a trial and replication (for later use as a covariate). This new variable should be assigned to all other observations with a given trial and replication. Here is what I current have: Data Have; Input Trial Treatment Replication VariableX; datalines; 1 1 1 a 1 1 2 b 1 2 1 c 1 2 2 d 1 3 1 e 1 3 2 f 2 1 1 g 2 1 2 h 2 2 1 i 2 2 2 j 2 3 1 k 2 3 2 l ; This is what I want: Data Want; Input Trial Treatment Replication VariableX VariableY; datalines; 1 1 1 a a 1 1 2 b b 1 2 1 c a 1 2 2 d b 1 3 1 e a 1 3 2 f b 2 1 1 g g 2 1 2 h h 2 2 1 i g 2 2 2 j h 2 3 1 k g 2 3 2 l h ; Any help would be greatly appreciated.
... View more