Date: Fri, 16 Jun 2000 11:14:05 -0700
Reply-To: barrere bendia <bendiabarre@ALTAVISTA.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: barrere bendia <bendiabarre@ALTAVISTA.COM>
Subject: Re: random number?Thank you all
Content-Type: text/plain
Thank you all.
The SAS-List are good friends.
I coldn't resist to ask Bill Knowlton, where can I find this usuful information about RANGAM function.
And I would ask about PROC BOX PLOT: I wante plot juste one BOXPLOT for a variable, but more BOXPLOT.
Excactly
I have data set like this:
data Relief1;
input Level Code Acupun Relief @@;
datalines;
1 1 1 0.0 1 2 1 0.5 1 1 2 0.6 1 2 2 1.2
2 1 1 0.3 2 2 1 0.6 2 1 2 0.7 2 2 2 1.3
3 1 1 0.4 3 2 1 0.8 3 1 2 0.8 3 2 2 1.6
4 1 1 0.4 4 2 1 0.7 4 1 2 0.9 4 2 2 1.5
5 1 1 0.6 5 2 1 1.0 5 1 2 1.5 5 2 2 1.9
6 1 1 0.9 6 2 1 1.4 6 1 2 1.6 6 2 2 2.3
7 1 1 1.0 7 2 1 1.8 7 1 2 1.7 7 2 2 2.1
8 1 1 1.2 8 2 1 1.7 8 1 2 1.6 8 2 2 2.4
;
I wante get juste one BOXPLOT for the variable Relief .
I tried some combinaison with PROC BOXPLOT, but not succes.
Here some thing that tried to program:
proc sort data=Relief1 out=Relief2;
by level Acupun ;
run;
symbol color = salmon h = .8;
goptions ftext=swiss;
axis1 minor=none color=black label=(angle=90 rotate=0);
title 'Here I have 8 Box Plot. How to I have juste one Box Plot for Relief or
other? ';
proc boxplot data=Relief2;
plot Relief*level/ cframe = vligb
cboxes = dagr
cboxfill = ywh
vaxis = axis1;
run;
The result is 8 Box Plot,. And 16 8 Box Plot.
I mean Relief by level and by Acupun .
Thanks a other time.
>
>
> Here's some info from the SAS v8 CD Manual on the
>
> 1. RANGAM function
>
> and
>
> 2. RANGAM call routine.
>
> 'Hope this helps.
>
> -Bill
>
>
> 1. RANGAM
>
> Syntax
>
>
>
>
> RANGAM(seed,a)
>
>
>
>
>
>
> Arguments
>
>
> seed
> is an integer. For more information on seeds, see Seed Values.
>
> Range: seed < 2(superscript: 31)-1
>
> Note: If seed = 0, the time of day is used to
> initialize the seed stream.
>
>
>
>
>
> a
> is a numeric shape parameter.
>
> Range: a >
> 0.
>
>
>
>
>
>
> Details
>
>
>
>
>
>
> The RANGAM function returns a variate that is generated from a gamma
> distribution with parameter a. For a > 1, an acceptance-rejection method
> due to Cheng (1977) (See References) is used. For a = 1, an
> acceptance-rejection method due to Fishman is used (1978, Algorithm G2)
> (See References).
>
>
> A gamma variate X with shape parameter ALPHA and scale BETA can be
> generated:
> x=beta*rangam(seed,alpha);
>
>
> If 2*ALPHA is an integer, a chi-square variate X with 2*ALPHA degrees of
> freedom can be generated:
> x=2*rangam(seed,alpha);
>
>
> If N is a positive integer, an Erlang variate X can be generated:
> x=beta*rangam(seed,N);
>
>
> It has the distribution of the sum of N independent exponential variates
> whose means are BETA.
>
>
> And finally, a beta variate X with parameters ALPHA and BETA can be
> generated:
> y1=rangam(seed,alpha);
> y2=rangam(seed,beta);
> x=y1/(y1+y2);
>
>
>
>
>
>
>
>
>
>
> The CALL RANGAM routine, an alternative to the RANGAM function, gives
> greater control of the seed and random number streams.
>
>
> 2. CALL RANGAM
>
>
>
> Returns a random variate from a gamma distribution
>
> Category: Random
> Number
>
>
>
>
>
>
>
> Syntax
>
>
>
>
> CALL RANGAM(seed,a,x
> );
>
>
>
>
>
> Arguments
>
>
> seed
> is the seed value. For more information about seeds, see Seed Values. A new
> value for seed is returned each time CALL RANGAM is executed.
>
> Range: seed < 2(superscript: 31) - 1
>
> Note: If seed =0, the time of day is used to
> initialize the seed stream.
>
>
>
>
>
> a
> is a numeric shape parameter.
>
> Range: a >
> 0
>
>
>
>
>
> x
> is a numeric variable. A new value for the random variate x is
> returned each time CALL RANGAM is executed.
>
>
>
> Details
>
>
>
>
>
>
> The CALL RANGAM routine updates seed and returns a variate x that is
> generated from a gamma distribution with parameter a.
>
>
> By adjusting the seeds, you can force streams of variates to agree or
> disagree for some or all of the observations in the same, or in subsequent,
> DATA steps.
>
>
> For a>1, an acceptance-rejection method (Cheng 1977) (See References) is
> used. For a =1, an acceptance-rejection method due to (Fishman 1978) (See
> References) is used.
>
>
>
> Comparisons
>
>
>
>
>
>
> The CALL RANGAM routine gives greater control of the seed and random number
> streams than does the RANGAM function.
>
>
>
> Examples
>
>
>
>
>
>
> This example uses the CALL RANGAM routine:
> options nodate pageno=1 linesize=80 pagesize=60;
>
> data case;
> retain Seed_1 Seed_2 Seed_3 45;
> a=2;
> do i=1 to 10;
> call rangam(Seed_1,a,X1);
> call rangam(Seed_2,a,X2);
> X3=rangam(Seed_3,a);
> if i=5 then
> do;
> Seed_2=18;
> Seed_3=18;
> end;
> output;
> end;
> run;
>
> proc print;
> id i;
> var Seed_1-Seed_3 X1-X3;
> run;
>
>
>
>
>
>
>
>
>
> barrere bendia
> <bendiabarre@ALTA To: SAS-L@LISTSERV.UGA.EDU
> VISTA.COM> cc:
> Sent by: "SAS(r) Subject: random number?
> Discussion"
> <SAS-L@LISTSERV.U
> GA.EDU>
>
>
> 06/15/00 01:40 PM
> Please respond to
> barrere bendia
>
>
>
>
>
> Hi
> I wante to generate number according gamma distribution with mean=mu and
> variance= var.
>
> I tried the functin: RANGAM(seed,a) but what mens the parameter a. The
> GAMMA distribution has two parameters.
>
> Can I do like this:
> do i=1 to 100;
> gama= mu + sqrt(var)*RANGA(seed,mu);
> output;
> end;
> drop i;
> ?
> Thank you all.
>
>
> _______________________________________________________________________
>
> Why pay when you don't have to? Get AltaVista Free Internet Access now!
> http://jump.altavista.com/freeaccess4.go
>
> _______________________________________________________________________
_______________________________________________________________________
Why pay when you don't have to? Get AltaVista Free Internet Access now!
http://jump.altavista.com/freeaccess4.go
_______________________________________________________________________
|