In order to have different random efffect covariance values across levels of some group with the NLMIXED procedure, you need to include group-specific random effects in your linear predictor. When constucting the covariance structure for the random effects, we assume that the group-specific random effects are independent of each other. For the example which you show above, suppose that period has just two values (1 and 2). Then NLMIXED code which would fit the model specified by your MIXED code would be: proc nlmixed data=D; /* construct linear predictor, including random effects */ eta = b0 + b1*time + (u0_1 + u1_1*time)*(period=1) + /* period 1 random effects */ (u0_2 + u1_2*time)*(period=2); /* period 2 random effects */ /* Parameterize the covariance between u0_i and u1_i as */ /* a function of the correlation between u0_i and u1_i. */ /* Parameterize the correlation between u0_i and u1_i */ /* through the inverse Fisher transformation. */ rho_1 = (exp(2*z1) -1) / (exp(2*z1) + 1); /* rho(u0_1, u1_1) */ rho_2 = (exp(2*z2) -1) / (exp(2*z2) + 1); /* rho(u0_2, u1_2) */ /* Specify and fit the model */ model y ~ normal(eta, Vres); random u0_1 u1_1 u0_2 u1_2 ~ normal([0,0,0,0], [Vu0_1, rho_1*sqrt(Vu0_1*Vu1_1), 0, 0, Vu1_1, 0, 0, Vu0_2, rho_2*sqrt(Vu0_2*Vu1_2), Vu1_2]) subject=SubjectID; run; Note that this can quickly become a very difficult estimation problem for NLMIXED because of the need to integrate over all random effects.
... View more