turn on suggestions

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

Showing results for

Find a Community

- Home
- /
- Analytics
- /
- Stat Procs
- /
- Categorical heterocedasticity in models

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
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

11-04-2014 06:17 AM

I would like to know how I can implements different variances per categorical factor in Proc GLIMMIX of SAS.

I have done a generalized lineal mixed model with a beta distribution with 1 categorical fixed factor, and 3 random factors, with the result of a model with heteroscedasticity along my categorical fixed factors.

Now I want to add a variance structure like "varIdent" in the package nlme of R as is recommended in the book "Mixed Effects Models and Extensions in Ecology with R" Zuur et al., 2009.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to RubenPnx

11-04-2014 08:51 AM

To get separate variance estimates for each level of your categorical fixed effect (called fixedeffectname in the code below) you can add a RANDOM statement:

random _residual_/group=fixedeffectname;

Note that you will now need to look at marginal means rather than conditional means, as the method=laplace and method=quad options do not support R-side estimation.

Not familiar enough with Zuur's variance structure to know if this is exactly what you want.

Steve Denham

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to SteveDenham

11-24-2014 07:37 AM

I mean to take into account the** heterogeneity variance of the residual spread in a fixed variable**.

How I can take into account the **different residual spread** varying per level (in a nominal variable) or in a continuous explanatory variable?

An example of this problem of different residual spread is in the Glimmix SAS Manual in the figure 38.21 (Chapter 38, page 2284) but with a nominal random variable.

file:///E:/Ruben/Ciencia/SAS/GLIMMIX/manual_glimmix.pdf

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to RubenPnx

11-24-2014 11:31 AM

Well, that link didn't come through, but I refer you to the GROUP= option in the RANDOM statement.

If you have a continuous variable that results in a different residual spread, I would suggest transforming the continuous variable in such a way that the residuals look better in a QQ plot.

Steve Denham

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to SteveDenham

11-25-2014 11:28 AM

Excuse me for the link. SAS/STAT 9.2 User's Guide The GLIMMIX Procedure (Book Excerpt):

https://support.sas.com/documentation/cdl/en/statugglmmix/61788/PDF/default/statugglmmix.pdf

So if I want to take into account the diverse spread of the residuals in categorical predictors I have to:

**1)** Put "group=" and the caterical variable that suffers it in their levels, without any specification in "type=".

**2)** Make again the covtest to check that the spread of the residuals have no statistical different between the levels.

**3)** If it keep being significantly different I have to change the "type=" and to probe again with the covtest?

**Doubts:**

**A)** Which is the most recommended kind of covariance matrix (type=) to control the heterocedasticity?

**B)** In the case that the transformation of the variable don't solve the problem of heterocedasticity in a continuous variable (predictor lineal), which kind of covariance structure I should introduce in the model? (e.g. cl, vc, vcorr...)

Thanks in advance

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to RubenPnx

12-02-2014 10:55 AM

Selection of the covariance type will depend strongly on the design. See what happens first with step 1 of your list, and see if the hetereogeneity is solved. You could then explore other covariance types. Note however that the heterogeneity in the fixed effects is a separate issue from the design, and that combining a covariance type= with group= will greatly increase the number of covariance parameters to be estimated.

For instance, suppose you fit a heterogeneous autoregressive covariance structure to four points. You would estimate 5 parameters. Now suppose you add group= for a categorical variable with 6 levels. You would now have to estimate 30 parameters, 5 for each level of the categorical variable. This may lead to inability to converge, or poor estimates and standard errors, or a non-positive definite Hessian matrix.

Steve Denham

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to RubenPnx

11-24-2014 01:08 PM

Citing a particular chapter, section, or page number in the User's Guide isn't automatically helpful because there are different versions of SAS in use, and the chapter number and page number are different in the relevant User's Guide for each version.