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
- /
- Proc Glimmix data transform and backtransform

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
- Highlight
- Email to a Friend
- Report Inappropriate Content

10-08-2016 09:41 PM

How is data transformed in Glimmix for asin (& backtransformed) like the following code for lognormal transformation?

How about in Proc Mixed?

I need to asin transform data in both Mixed & Glimmix. Just don't know the best way to backtransform vs. just transforming the means, SE, etc..., but have been told not to do that.

**PROC** **GLIMMIX**;

CLASS ID TRT DAY;

MODEL CPK = TRT day trt*day/dist=lognormal ddfm=kr solution;

Random day /residual subject = ID(trt) type =CSH;

LSMEANS TRT day/DIFF ADJUST=simulate;

LSmeans trt*day/slicediff=day adjust=SIMULATE adjdfe=row;

ODS OUTPUT lsmeans=lsmeans;

**PROC** **PRINT**; **RUN**; **quit**;

**data** btlsmeans;

set lsmeans;

omega=exp(stderr*stderr);

btlsmean=exp(estimate)*sqrt(omega);

btvar=exp(**2***estimate)*omega*(omega-**1**);

btsem=sqrt(btvar);

**PROC** **PRINT**; **RUN**;

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

10-09-2016 11:57 PM - edited 11-01-2016 03:06 PM

If transformation is your only option, you must transform your data prior to calling glimmix. And back transform estimates and confidence limits (but not SEs) after.

For example:

```
data test;
call streamInit(767);
do i = 1 to 100;
proportion = rand("uniform");
output;
end;
run;
data trans;
set test;
proportionTrans = arsin(sqrt(proportion));
run;
title "Untransformed";
proc glimmix data=trans;
model proportion=/s cl;
run;
title "Transformed";
proc glimmix data=trans;
model proportionTrans=/s cl;
ods output ParameterEstimates=transPE;
run;
title "Back-transformed";
proc sql;
select
sin(estimate)**2 as Estimate,
Alpha,
sin(lower)**2 as Lower,
sin(upper)**2 as Upper
from transPE
where effect="Intercept";
quit;
```

Depending on the nature of your data, I would suggest to investigate using other statistical models before resorting to the arcsin transform.

~~Note, when using the lognormal distribution in glimmix, use the ilink option to get estimates on the original scale.~~

PG

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

11-01-2016 02:35 PM

First of all, the arcsin(sqrt) transformation is only an approximation to the canonical link function for binomially distributed variables (logit). So, if you are using GLIMMIX, don't bother with the arcsin approximation. Analyze the data without pretransforming, but use the DIST=BINOMIAL option in the MODEL statement. You can then get all of the material on both the linked and original scale, including standard errors and confidence bounds.

For lognormally distributed data, it is a bit more complicated. It is more than just log transforming the data. Lognormal data is such that the logs of the value are normally distributed with a separable error term. Just applying a log link in GLIMMIX assumes that not only are the log(values) normally distributed, but that the errors are multiplicative. As a result, using the ILINK operator for DIST=LOGNORMAL does not return values on the original scale. You will need to backtransform to get on the original scale, recalling that the mean of the lognormal distribution is not just the exponentiated value.

Steve Denham