cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • JMP 19 is here! See the new features at jmp.com/new.
  • Register to attend Discovery Summit 2025 Online: Early Users Edition, Sept. 24-25.
Choose Language Hide Translation Bar
rcast15
Level II

Custom Tests in Mixed Model Personality?

Hi,

 

Are you able to calculate custom tests in the Mixed Model personality of fit model?

 

I know if I just have a random intercept, I can use the standard least squares personality and get custom tests that way. But let's say I have/need a more complex random effect structure but still want estimates of specific contrasts of my model, is there a way to get these in Mixed Model?

 

I have attached an example data set with a response (Y), time, ID variable, and 2 grouping variables. Specifically, I am interested in the average slope of a given level of my grouping variable, or the difference in average slopes for any 2 levels of either grouping variable. Can this be done in the Mixed Model personality?

 

I am aware of the Multiple Comparisons option in Mixed Model, but that just gets me least squares means, I am interested in slope estimates for different levels of categorical variables.

 

(I realize that the random effect structure I have specified in my example dataset is returning a negative estimate for the random slope, but ignore that as I am just interested in doing custom tests.)

 

Thanks

1 REPLY 1

Re: Custom Tests in Mixed Model Personality?

Hello, I am Yusuke Ono, Senior Tester at JMP Japan.
 
On the Mixed Model platform in JMP Pro 18 (the current version) or before, there is no command to compare slopes of random coefficient models. On the Mixed Model platform in JMP Pro 19 (the next version), we have a new command, Compare Slopes. So, you can get an average slope in each group, and the difference of slopes between two groups (like "A"&"B", "A"&"C" and so on) in JMP Pro 19's Mixed Model platform.
 
It is complicated that we get an average slope in each Group and the difference of slopes between two Groups on JMP18 or before. But if we do not need to calculate Kenward-Rogers degree of freedome, and if we only need to get point estimates and their standard errors (and to use normal approximation for calculating p-values and confidence intervals) on JMP18 or before, it is relatively easier (althought it is still complicated).
 
You can get a covariance matrix for estimators of fixed effect parameters by Covariance and Correlation Matrices > Covariance of Fixed Effects. After showing the covariance matrix, you can calculate the estimates and standard errors for contrasts by using JSL(JMP Scripting Language).
 
The following is an example for your data.
After you fit the Mixed Model, select Covariance and Correlation MatricesCovariance Fixed Effects, and run the following code, it calcualtes an average slope in each group.
 
r = Current Report();
/* Point Estimates (in Effect-Coding) */
est = r[OutlineBox("Fixed Effects Parameter Estimates")][TabPageBox(2)][NumberColBox("Estimate")]<<Get As Matrix;
/* Covariance matrix for point estimates (in Effect-Coding) */
cov = r["Covariance of Fixed Effects"][MatrixBox(1)]<<Get;

/* Contrast: You need to specify carefully  */
cont = J(4, NCol(cov),0);
cont[0,2] = 1;
cont[1,8] = 1;
cont[2,9] = 1;
cont[3,10] = 1;
cont[4,8] = -1;
cont[4,9] = -1;
cont[4,10] = -1;

/* Caculate point estimates and the covariance matrix */
slopes = cont*est;
covs = cont*cov*cont`;
New Window("Test",
  TableBox(
    NumberColBox("Slopes", slopes),
    NumberColBox("Std Error", Sqrt(VecDiag(covs)))
  )
);
You can get this slope estimates by Multiple Comparison command at least for example.
If we calculate the different of LSMeans with "Group=A, Time=1,Strage Condition=Here" vs "Group=A, Time=0,Strage Condition=Here", it is the average slope in Group=A (because there is no three factor interaction in this example).
 
Yusuke Ono (Senior Tester at JMP Japan)

Recommended Articles