BookmarkSubscribeRSS Feed
Reeza
Super User

It's hard to see what your doing now, since the forum doesn't sort the responses. So no way to tell which reply goes with which post. In the future please just do one response. This isn't your fault - limitation of the forum. 

 

Did you post your original distribution? Also, what is the variable, in laymans terms. Context can help with deciding what type of transformation to use, and there are certain standard transformation in diff industries. 

Ksharp
Super User
Or you could check Box-Cox transformation . 
PROC TRANSREG  or PROC MCMC can do that.
Check example of them in documentation.

mantubiradar19
Quartz | Level 8
I found this code from SAS documentation. I have 10,000 observations. So I need to use i=1 to 10,000 right?

data x;
call streaminit(17);
z = 0;
do i = 1 to 10000;
FASTING_GLUCOSE = rand('lognormal');
output;
end;
run;

proc transreg maxiter=0 nozeroconstant;
model BoxCox(FASTING_GLUCOSE) = identity(z);
output;
run;

proc univariate noprint;
histogram FASTING_GLUCOSE tFASTING_GLUCOSE;
run;
Ksharp
Super User
Interesting. I got this:



data x;
call streaminit(17);
do i = 1 to 10000;
FASTING_GLUCOSE = rand('lognormal');
x=rand('normal');
output;
end;
run;
proc transreg data=x details pbo noprint;
model boxcox(FASTING_GLUCOSE  / convenient lambda=-2 to 2 by 0.01) = identity(x);
output out=trans;
run;

proc univariate data=trans plots;
histogram FASTING_GLUCOSE tFASTING_GLUCOSE ;
run;



x.png
mantubiradar19
Quartz | Level 8
Thank you very much! Let me try this and get back to you! Cheers
Ksharp
Super User
I also found if you LOG10(x), you can also get what you want.
mantubiradar19
Quartz | Level 8
I tried the log10 transformation but still the distribution is not so
normal!

##- Please type your reply above this line. Simple formatting, no
attachments. -##
mantubiradar19
Quartz | Level 8

In layman terms I'm dealing with a contineous variable! Here is the distrubution before and after the log transformation!


Capture.JPG
Reeza
Super User

@mantubiradar19 wrote:

In layman terms I'm dealing with a contineous variable! Here is the distrubution before and after the log transformation!


What type of continuous variable, blood pressure, stock price, number of asteroids heading towards earth? 


SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 25 replies
  • 2739 views
  • 2 likes
  • 5 in conversation