Hello ,Dr.Wicklin I purchased your book simulating data with sas it is wonderful book, helped me to learn how to simulate repeated measures data with fixed and random effects .i have a question in constructing R matrix as variance_covariance matrix of random errors in page 233 chapter12 .I appreciate you help me to solve my problem.why are the non-diagonal elements in R matrix, sigma2_R ? should not they be sigma2_CS ? because when i change the place of sigma2_R and sigma2_CS with each other in proc iml , the R matrix becomes exactly the R matrix that i get when i apply the proc mixed. also in do loop i put k instead of s because i want k*k matrix for R .is it the right way or not?. below is my sas code : proc mixed data=mydata; class Subject time treatment ; model response=time | treatment/ solution outpm=outpm; random Subject(treatment); repeated time / type=CS subject=Subject(treatment) R ; ods select R ; ods output R=R ; quit; proc iml; k=15; s=17; sigma2_R=0.02491; sigma2_CS=-0.00001; B=sigma2_CS * j(k,k,1 )+sigma2_R * I(k); R=B; do i=2 to k; R=block(R,b); end; R = I(k) @ B;
... View more