I am having trouble with a homework exercise regarding geometric distribution.The exercise states: Use a DATA STEP to generate a random sample of 1,000 observations from the geometric distribution for each of p=.2,.4,.6. Use a PROC SQL step to create a data set geomnum that contains the number of occurrences for each combination of p and x (the random geometric). Use PROC SGPLOT to graph the distribution of the number of trials needed for each probability. All of the plots should appear on the same graph. Use a series plot and include markers on the plot. My understanding is that I am counting the number of times a certain x exists for each p value but I don't believe my code is doing this. Any tips is greatly appreciated. I have attached my code: %let seed=54321;
%let numobs=1000;
data geometrics;
call streaminit(&seed);
do i=1 to &numobs;
x1=rand("geometric",0.2);
output;
end;
do i=1 to &numobs;
x2=rand("geometric",0.4);
output;
end;
do i=1 to &numobs;
x3=rand("geometric",0.6);
output;
end;
run;
proc sql;
create table geomnum as
select x1, count(x1) as freq1, x2, count(x2) as freq2, x3, count(x3) as freq3
from geometrics
group by x1,x2,x3
;
run;
... View more