Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- JMP User Community
- :
- Discussions
- :
- Re: Save columns option with mixed model

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Save columns option with mixed model

Jul 18, 2018 6:11 AM
(1831 views)

Hello everybody,

When we run a mixed model using the Fit Model platform, we can save residuals and predicted values but we also have the possibility to save Conditional residuals and Conditional predicted values (which take into account both fixed and random effects). However we do not have similar options for the studentized residuals and the StdErr Pred Formula columns.

What is the best way to get or maybe re-calculate the "conditional verison" of these two columns?

Note that I am not working with JMP Pro.

Thanks in advance for your help!

8 REPLIES 8

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: Save columns option with mixed model

You can studentize the conditional residuals by dividing by their standard errors. Save both columns to the table and then compute the studentized values with a column formula. I'm not immediately sure how to help you with the Std Error Pred Formula.

-- Cameron Willden

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: Save columns option with mixed model

Thank you for your answer Cameron!

However if you saved the Std Err of residuals I think it is related to those which do not include random effect and not to the conditional residuals. It seems not possible to save the Conditional Std Err of residuals. I think we can redo the calculation based on the Hats values but the problem is the same: they are probably linked to the "basic residuals".

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: Save columns option with mixed model

You're right. Duh. I don't have access to JMP Pro, so I can't check it out, but I don't think you'll be able to get all the components you'd need to compute the standardized conditional residuals directly from the report. PredSE column gives the X matrix as the second argument of Vec Quadratic(), and the report gives you the MSE. You would have to construct G and Z.

You could get Z from something like:

`Design Nom( :RandomEffectCol << Get Values, {list of levels})`

If you have multiple random effects, you could just concatenate those together.

To get G, that would depend on your chosen correlation structure. If you have a simple correlation structure with all 0's on the off-diagonals, then you can construct G by multipling your vector of variance components with an identity matrix.

Once you have X, G, Z, and the MSE, then you could compute the variance of the error matrix like so:

```
n = N Row(dt);
V = Z*G*Z` + MSE*Identity(n);
K = Identity(n) - Z*G*Z`*Inv(V);
Q = X*Inv(X`*Inv(V)*X)*X`;
Var_e = K*(V-Q)*K`;
```

From there, you would take the sqrt of the diagonal elements of Var_e to get the conditional standard errors for your conditional residuals. I don't think JMP has a function to return just the diagonal elements of the matrix, but here's a simple one that will do the trick:

```
getDiag = function({X},
n = ncol(X);
diags = {};
for(i=1, i<=N Col(X),i++,
Insert Into(diags,X[i,i])
)
);
```

That's a lot of effort! Sorry, I wish I knew of an easier way.

-- Cameron Willden

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: Save columns option with mixed model

Thank you Cameron for this detailled answer, I will test it!

But indeed it is not an easy way to get what we want. I wonder why it is not directly available from the save columns menu.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: Save columns option with mixed model

You can suggest this feature in the Wish List part of the JMP Community.

Learn it once, use it forever!

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: Save columns option with mixed model

Yes that is right I will do that!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: Save columns option with mixed model

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: Save columns option with mixed model

Hello GM,

Yes you are right we can extract the standard errors of random effects like that, but what I am looking for are

the standard errors of residuals and of the predicted values. I do no think it is the same information here.