The way of creating the same distribution

by Irina 14. April 2007 06:41

Sometimes We want to create the same distribution .

We can do it in this way : The ttt limits the commulative distribution of another variable, which we can receive from proc freq )

DATA  SAME_DISTR;
SET SAME_DISTR;
IF TARGET =0 THEN DO;
ttt=ranuni(31311115)*100;
if ttt<=5 then kod=200502;
else if ttt<=28 then kod=200503;
else if ttt<=40 then kod=200504;
else if ttt<=52 then kod=200505;
else if ttt<=62 then kod=200506;
else if ttt<=71 then kod=200507;
else if ttt<=80 then kod=200508;
else if ttt<=88 then kod=200509;
else if ttt<=93 then kod=200510;
else if ttt<=100 then kod=200511;
end;
if target=1 then kod=100* year( Loan_Value_Date)+month(Loan_Value_Date);
run;

This is more wise way to do the same:


proc freq DATA = required_destribution;
tables Loan_Value_Date /out = outkod outcum noprint;
run; data _null_ ; length kod_str pct_str $5000;
set outkod end=eof;
retain kod_str pct_str;
kod_str=compress(kod_str||','||Loan_Value_Date);
pct_str=compress(pct_str||','||cum_pct);
if eof then do;
call symput('a1',substr(pct_str,2));
call symput('a2',substr(kod_str,2));
call symput('nn',_n_);
end;
run;

DATA SAME_DISTR;
SET SAME_DISTR;
array a1 {&nn} _temporary_ (&a1);
array a2 {&nn} _temporary_ (&a2);
IF TARGET =0 THEN DO;
ttt=ranuni(31311115)*100;
do i=1 to dim(a1);
if i=1 then do;
if ttt<=a1[i] then Loan_Value_Date=a2[i];
end;
else do;
if a1[i-1]<ttt<=a1[i] then Loan_Value_Date=a2[i];
end;
end;
end;

kod=100* year( Loan_Value_Date)+month(Loan_Value_Date);
run;

Related posts

Comments

7/25/2011 11:34:11 PM


It's okay... love looking at your lovely post.
Not much words needed, really.

Pandora Charms

7/25/2011 11:37:36 PM


I am happy to find so many useful information here in the post, thanks for sharing it here. I hope you will adding more.

Pandora Charms

7/25/2011 11:37:52 PM

Lively and interesting picture and article is quite uplifting.I like it very much.

Pandora Beads

7/25/2011 11:38:11 PM

thats really a nice and informative post ,you are doing an excellent job with your site let it keep coming.

Beats Headphones

7/25/2011 11:38:45 PM



It's okay... love looking at your lovely post.
Not much words needed, really.

Christian Louboutin

10/22/2011 2:36:58 AM

Good blog, just looking about some blogs, seems a fairly good platform you are using. I’m presently making use of WordPress for several of my sites but looking to change 1 of them above to a platform comparable to yours as a trial run. Anything in specific you’d recommend about it?

Lennox Solenoid Valve from discountfurnacefilter.com

10/22/2011 2:37:55 AM

Great work dude, u gave nice post to us. Thanks for spending the time to discuss this, I feel strongly about it and love learning more on this topic.

Genuine Lennox Parts at best prices

10/22/2011 2:38:30 AM

I have been meaning to read this and just never obtained a chance. Its an issue that Im really interested in, I just started reading and Im glad I did. Youre a fantastic blogger, one of the best that Ive seen. This weblog undoubtedly has some facts on topic that I just wasnt aware of. Thanks for bringing this stuff to light.

Interior Designers in Miami

10/22/2011 2:39:37 AM

I was very pleased to find this site.I wanted to thank you for this great read!! I definitely enjoying every little bit of it and I have you bookmarked to check out new stuff you post.

Wmhendersoninc Cooling Services PA

10/22/2011 2:39:57 AM

I was very pleased to find this site.I wanted to thank you for this great read!! I definitely enjoying every little bit of it and I have you bookmarked to check out new stuff you post.

Wmhendersoninc Cooling Services PA

10/22/2011 2:58:48 AM

Really i am impressed from this post....the person who create this post it was a great human..thanks for shared this with us.

Discount Flights

10/22/2011 2:59:22 AM

Some interesting and well researched information on photos. I'll put a link to this site on my blog. Thank you!

Garage Door Repairs In Las Vegas

10/22/2011 3:00:03 AM

Thank you for an additional great post. Where else could anyone get that kind of data in these a ideal way of writing? I’ve a presentation subsequent week, and I’m on the look for this kind of information.

Paginas Amarillas

10/22/2011 3:00:35 AM

The author of this blog had released a manifesto regarding of `the attractive marketing ‘.It is said that over 11000 downloads happen each day on this. This has been very useful for many of the business persons around the world. For multitasking persons a video is also provided which shows vital information about attractive marketing. For more information about attractive marketing’s there are audios and newsletters are also available. Here also the social networking web sites like twitter and blogs are used for increasing the number of marketing.

Online Estate Agent

10/22/2011 3:01:08 AM

This is easier and surely gives comfort to internet users. Thanks for sharing. Post like this offers great benefit. Thank you!

Galapagos Trips

10/22/2011 3:01:48 AM

What I wouldn't give to have a debate with you about this. You just say so many things that arrive from nowhere that Im pretty certain Id have a fair shot. Your blog is fantastic visually, I mean people wont be bored. But others who can see past the videos and the layout wont be so impressed with your generic understanding of this subject.

Storm Bathroom Cabinet

10/22/2011 3:02:21 AM

You gave nice ideas here. I done a research on the issue and learn most peoples will agree with your blog. Certainly, these practices are unfair; but they say that most of their rules are only to apply to people who overdraw.

Plasma Cutters

Add comment


(will show your Gravatar icon)  





Live preview

2/5/2012 9:21:06 PM

 

About the author

Irina Spivak Irina Spivak
Team Leader at G-Stat. More...


Send mail Email

Blogroll

    Disclaimer

    The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

    © Copyright 2012

    Sign in

    eXTReMe Tracker