Hi! I would like to ask a question regarding CDF Tweedie in SAS. I read this link
http://documentation.sas.com/?docsetId=ds2ref&docsetTarget=n0sqs8cpv6ucnkn1upsfmy7tm3yl.htm&docsetVe... , and I found this statement :
y=cdf('TWEEDIE', .8, 5)
But the statement won't work in my SAS University Edition. The result is :
Anyone knows why is it like this? Thanks!
You can run the CDF function in the DATA step. No need to use DS2.
data Tweedie;
do x = 0 to 3 by 0.05;
y=cdf('TWEEDIE', x, 5);
output;
end;
run;
title "CDF of the Tweedie(5) Distribution";
proc sgplot data=Tweedie;
series x=x y=y;
run;
CDF is a function, and is part of the proc ds2 step.
https://blogs.sas.com/content/sgf/2016/02/19/reasons-love-proc-ds2/
You have to write the procedure to generate this, to start with:
proc ds2; ... quit;
Put your statements in where the elipses are.
I wrote it like this :
proc ds2;
y=cdf('TWEEDIE', 0.8, 5);
quit;
but there is no output, and I got this log:
Am afraid I can't, I don't use DS2 procedure. You need to learn how to use it, its syntax and logic. Start with the SAS help and work from there.
@nikolasfilbert: I am not familiar with DS2, but found the following structure in the documentation:
proc ds2; data; declare double y; method run(); y=cdf('TWEEDIE', 0.8, 5); end; enddata; run; quit;
It ran in SAS UE
Art, CEO, AnalystFinder.com
You can run the CDF function in the DATA step. No need to use DS2.
data Tweedie;
do x = 0 to 3 by 0.05;
y=cdf('TWEEDIE', x, 5);
output;
end;
run;
title "CDF of the Tweedie(5) Distribution";
proc sgplot data=Tweedie;
series x=x y=y;
run;
If the SAS data set 'HAVE' contains a variable named 'X' that contains the points at which you want to evaluate the CDF, you can say
data Tweedie;
set HAVE;
y=cdf('Tweedie', X, 5);
run;
Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.
Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.