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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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