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;
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Get started using SAS Studio to write, run and debug your SAS programs.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.