```Date: Wed, 15 Feb 2006 13:20:44 -0500 Reply-To: Chang Chung Sender: "SAS(r) Discussion" From: Chang Chung Subject: Re: homework problem. generate t distribution and double exponential random numbers Comments: To: JP Zhu On Wed, 15 Feb 2006 12:11:54 -0500, JP wrote: >I asked, the teacher does not know. >I know there lots of people here are much smarter than my teacher in terms >of sas. > >On 2/15/06, Chang Chung wrote: >> >> On Wed, 15 Feb 2006 11:31:37 -0500, JP wrote: >> >> >The teacher gave R code to do generate t distribution and double >> exponential >> >distribution radom variable. How can I use sas to fulfill the same task? >> >> Hi, >> IMHO, you should ask this question to your teacher. :-) >> Cheers, >> Chang >> Hi, OK... I am not familiar with the double exponential pdf. Here are some sas 9 code, which generate a 100-observation dataset with two variables, x1 and x2. HTH. Cheers, Chang %let seed = 1234567; %let N = 100; data one; call streaminit(&seed.); drop i; do i = 1 to &N.; x1 = rand('T', 5); /* T dist with df=5 */ x2 = rand('EXPONENTIAL'); /* pdf: f(x) = exp(-x) */ output; end; run; proc univariate data=one; var x1 x2; run; ```

Back to: Top of message | Previous page | Main SAS-L page