The participants produced 12 sequences (4 3-syllable sequences, 4 6-syllable sequences, 4 9-syllable sequences) 2 times in one block. They produced these five times over five blocks. They produced each sequence 10 times. So basically what I am interested in is the comparison among three sequence length conditions and blocks mean nothing. The tasks were blocked only to give participants a few minute breaks. Although my research questions do not question about trial effect, I am still interested in it and I assume there might be learning effect when participants repeat the same task over ten times (trial1). So I wanted to include this as one of random or repeated variable in the model. Among 12 sequences, I picked 1 3-syllable sequence, 1 6-syllable sequence, and 1 9-syllable sequence as my target sequences for analysis. The other ones were fillers and were not included in the dataset I provided. 12 sequences were randomly mixed, but I pre-determined this random order before the experiment, so every participant underwent the same order of tasks. I don't know if this design changes any of your codes. Because I face some problems whenever I include random and repeat statements together in one model and somehow your codes work fine, I am careful to change any parts of your code. So if you think your code is not reflecting my design, I am not capable of changing it without causing errors. These are the final codes I used. I am also attaching my final dataset. Could you please help confirming this looks fine? After testing with these codes, normality assumption did not meet even with the log tranformed gmp_syl, so I decided to report only glimmix results. Although both proc glimmix and proc mixed produced the same results. Thanks. /* Import data from xlsx */ libname a1 'C:\Data Analysis\Experimental Results\SAS'; proc import datafile="C:\Data Analysis\Experimental Results\SAS\dissertation.xlsx" out=Work.dissertation dbms=xlsx replace; run; /* Delete unfilled columns and unfilled rows */ data dissertation1; set dissertation; /*drop var20-var56;*/ where whole_1st= 1; run; /* Variable transformation */ data dissertation1; set dissertation1; gmp_syl_log = log(gmp_syl); gmp_syl_sqrt = sqrt(gmp_syl); run; title1 "Coding check"; proc freq data=dissertation1; table group subjectid slc block trial1; run; title1 "Pattern of observations"; proc tabulate data=dissertation1(where=(gmp_syl ne .)); class group subjectid slc trial1 block; table group*subjectid, slc*trial1 / misstext="X"; run; proc sort data=dissertation1; by group subjectid slc trial1; run; title1 "Observed data"; proc sgpanel data=dissertation1 noautolegend; panelby slc group / columns=2; series x=trial1 y=gmp_syl / group=subjectid markers; run; title1 "Observed data, log scale"; proc sgpanel data=dissertation1 noautolegend; panelby slc group / columns=2; series x=trial1 y=gmp_syl_log / group=subjectid markers; run; proc sgpanel data=dissertation1; panelby group subjectid / columns=6; series x=trial1 y=gmp_syl_log / group=slc markers; run; /*unconditional model ICC check*/ proc mixed data=dissertation1 ic; class group subjectid slc trial1; model GMP_syl_log= trial1/solution; random intercept trial1/sub=subjectid(group); run; /*homoscedasticity assumption testing*/ proc mixed data=dissertation1 ic; class group subjectid slc trial1; model GMP_syl_log= group|slc|trial1 /ddfm=kr2 outp=R; random intercept / subject=subjectid(group); repeated trial1 / subject=slc*subjectid(group) type=ar(1); run; data R1; set R; absr=ABS(RESID); run; proc glm data=R1; class group subjectid slc trial1; model ABSR=group|slc|trial1; run; /*normality assumption testing*/ proc mixed data=dissertation1 covtest method=ml;*plots=all; class group slc subjectid trial1; model gmp_syl_log = group|slc|trial1/ ddfm=kr2 outp=R; random intercept / subject=subjectid(group); repeated trial1 / subject=slc*subjectid(group) type=ar(1); /*lsmeans trial1 / diff adjust=simulate(seed=98375); lsmeans group*slc ;*/ run; proc sort data=R; by group slc subjectid trial1; run; ods graphics on; proc univariate data=R normal; BY group slc ; var Resid; histogram / normal ctext = blue; run; title1 "AR(1) among TRIAL1 levels using MIXED"; proc mixed data=dissertation1 covtest ;*plots=all; class group subjectid slc trial1; model gmp_syl_log = group|slc|trial1 / ddfm=kr2; random intercept / subject=subjectid(group); repeated trial1 / subject=slc*subjectid(group) type=ar(1); lsmeans trial1 / diff adjust=simulate(seed=98375); lsmeans group*slc ; run; title1 "AR(1) among TRIAL1 levels using GLIMMIX"; proc glimmix data=dissertation1 plots=(studentpanel boxplot(fixed student)); class group subjectid slc trial1; model gmp_syl_log = group|slc|trial1 / ddfm=kr2; random intercept / subject=subjectid(group); random trial1 / subject=slc*subjectid(group) type=ar(1) residual; lsmeans trial1 / diff adjust=simulate(seed=98375) lines; lsmeans group*slc / plot=meanplot(sliceby=group join cl); lsmestimate group*slc "Group effect: SLC 1 v 2" 1 -1 0 -1 1 0, "Group effect: SLC 1 v 3" 1 0 -1 -1 0 1, "Group effect: SLC 2 v 3" 0 1 -1 0-1 1 / adjust=simulate(seed=29847); run;
... View more