Date: Thu, 14 Mar 1996 09:45:38 -0500 Rick DeShon "SAS(r) Discussion" Rick DeShon Proc Mixed problem

Hello Everyone,

I am having some trouble with what *should* be a very simple Proc Mixed analysis. Basically, I would like to analyze a simple, repeated measures design (person by time) and treat person as a factor. I've had no trouble generating and fitting various error structures for the time effect such as SIMPLE, AR(1), UN(1), etc.... However, I cannot get the compound symmetry error structure to work properly. I've tried everythng I can think of and am now seeking help from your collective knowledge. In addition to specifying the CS structure through the "TYPE=" option, I have also attempted to use the "repeated intercept diag / sub =p" method with no luck.

To avoid confusion, I've included the SAS source code that I'm using below. I appreciate your help on this problem.

//////////////////////////////////////////////////////////////////////////// //////

%LET _PRINT_ = ON;

PROC IML; ************* SET SIMULATION PARAMETERS ******************************************;

N = 20; * NUMBER OF PEOPLE *******************; K = 20; * NUMBER OF OCCASIONS *******************;

PVAR = 5.0; * PERSON VARIANCE PARAMETER *****************; OVAR = 5.0; * OCCASION VARIANCE PARAMETER *****************; EVAR = 5.0; * ERROR VARIANCE PARAMETER *****************;

PHI = 5.0; * COMPOUND SYMMETRY PARAMETER *****************;

********************** GENERATE DATA *********************************************; SEED1 =9837; SEED2 = 539374; SEED3 = 2378934; PVAR = PVAR**.5; OVAR = OVAR**.5;

V=EVAR*I(K);

DO I=1 TO K; DO J=1 TO K; V(|I,J|) = V(|I,J|) + PHI; * CREATE COMPOUND SYMMETRY ERROR STRUCTURE ****; END; END;

*PRINT V;

A=ROOT(V); * CHOLESKEY DECOMPOSITION OF V *************;

Z= NORMAL(J(N,K,SEED1)); * GENERATE A MATRIX (Z) OF RANDOM NORMAL VARIABLES;

Y = Z*A; * TRANSFORM Z TO INCLUDE THE CS ERROR STRUCTURE ;

F = OVAR*NORMAL(J(1,K,SEED2)); * GENERATE K NORMAL VARIATES FOR THE OCCASSION EFFECTS; DO I=1 TO N; Y(|I,|) = Y(|I,|) + F; * ADD THE OCCASION EFFECTS TO Y ************; END;

M = PVAR*NORMAL(J(N,1,SEED3)); * GENERATE N NORMAL VARIATES FOR THE PERSON EFFECTS; DO I=1 TO K; Y(|,I|) = Y(|,I|) + M; * ADD THE PERSON EFFECTS TO Y ************; END;

MAT = SHAPE(Y,N*K,1) || (1:N)` @ J(K,1,1) || J(N,1,1) @ (1:K)`; * REORDER DATA FOR INPUT TO PROC MIXED ; CREATE OUT FROM MAT; APPEND FROM MAT;

QUIT;

DATA NEW; SET OUT; X = COL1; P = COL2; O = COL3;

DROP COL1-COL3; RUN;

PROC MIXED; CLASS P O; MODEL X=; RANDOM P O; REPEATED O / SUB = P TYPE=CS; RUN;

QUIT;

\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

The output from this procedure yields: Cov Parm Ratio Estimate Std Error Z Pr > |Z| P 2.76016120 13.55297482 4.47685711 3.03 0.0025 O 0.77772338 3.81878614 1.31875859 2.90 0.0038 O CS 0.00000000 0.00000000 . . . Residual 1.00000000 4.91021133 0.36547829 13.44 0.0001

along with a NPD Hessian error.

Any ideas?

Rick

Richard DeShon Dept. of Psychology Michigan State University East Lansing, MI 48824-1117 E-mail: deshon@pilot.msu.edu Voice: (517) 353-4624 Fax: (517) 353-4873

Back to: Top of message | Previous page | Main SAS-L page