*** MIXED MODELING * Read in the data from {DSST.xls}. ; PROC IMPORT DATAFILE = 'C:\Documents and Settings\richc\My Documents\CPH931F08\DSST.xls' OUT = DSST DBMS = EXCEL REPLACE; SHEET = DSST; GETNAMES = YES; RUN; * Initiate a ``transcript'' in the Word file {DSSTMixed.rtf}. ; ODS RTF FILE = 'C:\Documents and Settings\richc\My Documents\CPH931F08\DSSTMixed.rtf'; * Fit a linear mixed model expressing the expected number of correct trials as a * function of the experimental conditions (DRUG = 1 for amphetamine, DRUG = 0 for * placebo; ACTIVITY = 1 for high-sensation activity, ACTIVITY = 0 for low-sensation * activity; TIME = 2, 3, or 4 for second, third, or fourth measurement), subject's * sensation seeking status based on a personality test (SSSTAT = 1 for those high * on sensation seeking, SSSTAT = 0 for those low on sensation seeking), and baseline * number of correct trials (CORRECTTRIALS_B). Allow for the possibility that * sensation seeking status may interact with the experimental conditions. Include * random effects for subjects. Estimate the expected number of correct trials on * amphetamine following a high-sensation activity at time 3 for someone high on * sensation seeking who scored 60 at baseline. Estimate the expected number of * correct trials on placebo following a low-sensation activity at time 3 for someone * high on sensation seeking who scored 60 at baseline. Estimate the difference * between the two expected values. Repeat for someone low on sensation seeking. * Conduct a test for whether sensation seeking status and its interactions with * experimental conditions can be removed from the model altogether. ; PROC MIXED DATA = DSST method = ML covtest; CLASS SUBJECT DRUG ACTIVITY SSSTAT TIME; MODEL CORRECTTRIALS = DRUG ACTIVITY TIME SSSTAT SSSTAT*DRUG SSSTAT*ACTIVITY SSSTAT*TIME CORRECTTRIALS_B / SOLUTION; RANDOM SUBJECT; ESTIMATE 'High SS in 4th condition at time 3' intercept 1 CORRECTTRIALS_B 60 DRUG 0 1 ACTIVITY 0 1 TIME 0 1 0 SSSTAT 0 1 SSSTAT*DRUG 0 0 0 1 SSSTAT*ACTIVITY 0 0 0 1 SSSTAT*TIME 0 0 0 0 1 0; ESTIMATE 'High SS in 1st condition at time 3' intercept 1 CORRECTTRIALS_B 60 DRUG 1 0 ACTIVITY 1 0 TIME 0 1 0 SSSTAT 0 1 SSSTAT*DRUG 0 1 0 0 SSSTAT*ACTIVITY 0 1 0 0 SSSTAT*TIME 0 0 0 0 1 0; ESTIMATE 'High SS in 4th condition at time 3 vs. 1st condition' DRUG -1 1 ACTIVITY -1 1 SSSTAT*DRUG 0 -1 0 1 SSSTAT*ACTIVITY 0 -1 0 1; ESTIMATE 'Low SS in 4th condition at time 3 vs. 1st condition' DRUG -1 1 ACTIVITY -1 1 SSSTAT*DRUG -1 0 1 0 SSSTAT*ACTIVITY -1 0 1 0; CONTRAST 'Overall relevance of sensation seeking' SSSTAT 1 -1 SSSTAT*DRUG 1 -1 0 0 SSSTAT*ACTIVITY 1 -1 0 0 SSSTAT*TIME 1 0 0 -1 0 0, SSSTAT 1 -1 SSSTAT*DRUG 1 -1 0 0 SSSTAT*ACTIVITY 1 -1 0 0 SSSTAT*TIME 0 1 0 0 -1 0, SSSTAT 1 -1 SSSTAT*DRUG 1 -1 0 0 SSSTAT*ACTIVITY 1 -1 0 0 SSSTAT*TIME 0 0 1 0 0 -1, SSSTAT 1 -1 SSSTAT*DRUG 1 -1 0 0 SSSTAT*ACTIVITY 0 0 1 -1 SSSTAT*TIME 1 0 0 -1 0 0, SSSTAT 1 -1 SSSTAT*DRUG 1 -1 0 0 SSSTAT*ACTIVITY 0 0 1 -1 SSSTAT*TIME 0 1 0 0 -1 0, SSSTAT 1 -1 SSSTAT*DRUG 1 -1 0 0 SSSTAT*ACTIVITY 0 0 1 -1 SSSTAT*TIME 0 0 1 0 0 -1, SSSTAT 1 -1 SSSTAT*DRUG 0 0 1 -1 SSSTAT*ACTIVITY 1 -1 0 0 SSSTAT*TIME 1 0 0 -1 0 0, SSSTAT 1 -1 SSSTAT*DRUG 0 0 1 -1 SSSTAT*ACTIVITY 1 -1 0 0 SSSTAT*TIME 0 1 0 0 -1 0, SSSTAT 1 -1 SSSTAT*DRUG 0 0 1 -1 SSSTAT*ACTIVITY 1 -1 0 0 SSSTAT*TIME 0 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