1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;5556 /* ReactionTime2.sas */57 title "Ana's Perception Study: Reaction Time";58 title2 'Repeated Measures with proc mixed';596061 /* Read data from Excel spreadsheet */62 proc import datafile="/folders/myfolders/2453f15/RT_Medians.xls"63 out=rtime1 dbms=xls replace;64 getnames=yes;6566NOTE: The import data set has 30 observations and 11 variables.NOTE: WORK.RTIME1 data set was successfully created.NOTE: PROCEDURE IMPORT used (Total process time):real time 0.02 secondscpu time 0.01 seconds67 data rtime2; /* Convert to univariate data format */68 /* Number of cases = number of reaction times */69 /* output creates a new case. */70 set rtime1;71 length sentencetype $ 11; /* Default is 8 characters */72 context = 'None'; sentencetype = 'Question'; rtime = NCQ; output;73 context = 'None'; sentencetype = 'Exclamation'; rtime = NCE; output;74 context = 'None'; sentencetype = 'Statement'; rtime = NCS; output;7576 context = 'Low'; sentencetype = 'Question'; rtime = LCQ; output;77 context = 'Low'; sentencetype = 'Exclamation'; rtime = LCE; output;78 context = 'Low'; sentencetype = 'Statement'; rtime = LCS; output;7980 context = 'Full'; sentencetype = 'Question'; rtime = CQ; output;81 context = 'Full'; sentencetype = 'Exclamation'; rtime = CE; output;82 context = 'Full'; sentencetype = 'Statement'; rtime = CS; output;8384 label rtime= 'Median Reaction Time';85 keep Participant Language context sentencetype rtime;86NOTE: There were 30 observations read from the data set WORK.RTIME1.NOTE: The data set WORK.RTIME2 has 270 observations and 5 variables.NOTE: DATA statement used (Total process time):real time 0.05 secondscpu time 0.05 seconds87 proc print;88 run;NOTE: There were 270 observations read from the data set WORK.RTIME2.NOTE: PROCEDURE PRINT used (Total process time):real time 0.67 secondscpu time 0.67 seconds8990 proc mixed;91 title3 'All Three Tasks';92 class Language Context SentenceType Participant;93 model rtime = Language|Context|SentenceType;94 repeated / type=cs subject=Participant r;95 /* r means give the estimated within-case covariance matrix */96 lsmeans Language|Context|SentenceType;9798 /* Again, set Full context aside and analyze separately. */99NOTE: 4 observations are not included because of missing values.NOTE: Convergence criteria met.NOTE: PROCEDURE MIXED used (Total process time):real time 0.39 secondscpu time 0.37 seconds100 proc mixed;101 title3 'Just no context and low context';102 where Context ne 'Full'; /* So easy */103 class Language Context SentenceType Participant;104 model rtime = Language|Context|SentenceType;105 repeated / type=cs subject=Participant;106 lsmeans Context|SentenceType; /* Selected after looking at results */107NOTE: 1 observation is not included because of missing values.NOTE: Convergence criteria met.NOTE: PROCEDURE MIXED used (Total process time):real time 0.19 secondscpu time 0.19 seconds108 proc mixed;109 title3 'Full context only: Langrage by Sentence Type';110 where Context = 'Full';111 class Language SentenceType Participant;112 model rtime = Language|SentenceType;113 repeated / type=cs subject=Participant;114 lsmeans SentenceType / pdiff adjust=bon; /* Selected after looking at results */115116 /* Try to replicate that last result with a mixed model */117NOTE: 3 observations are not included because of missing values.NOTE: Convergence criteria met.NOTE: PROCEDURE MIXED used (Total process time):real time 0.19 secondscpu time 0.18 seconds118 proc mixed;119 title3 'A true mixed (nested) model';120 where Context = 'Full';121 class Language SentenceType Participant;122 model rtime = Language|SentenceType;123 random participant(Language);124125 /* Note random effects are not specified in the model statement. */126127128129 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;141