DATA Step, Macro, Functions and more

Fİltering a specific value from the output

Reply
New Contributor
Posts: 3

Fİltering a specific value from the output

Dear friends, I am a beginner user at SAS.  I am comparing 3 groups scores with using npar1way MEDIAN procedure on simulation data.  I want to compute a type I error rate on this data set according to MEDIAN test and just want to see this knowledge on the screen without a MEDIAN test output.  From my simulation study lets say my code is like below..this a simple code and returns me an output of MEDIAN procedure 50 times(repetition number... just arbitrarily) . I just want to filter p-values obtained form each comparison (totaly 50 p-values) and to compute a type I error rate base on these p-values when comparing to alpha=0.05.

 

thanks for your valuable time

Alp

proc npar1way MEDIAN data=Simulation;
by SampleID;      
class group; 
      ods output MEDIAN=OutMEDIAN;
run;
Super User
Super User
Posts: 9,227

Re: Fİltering a specific value from the output

Posted in reply to alpdadalman

You can use ods output to select parts of the outputs created:

ods trace on;
proc
npar1way MEDIAN data=Simulation; by SampleID; class group; ods output MEDIAN=OutMEDIAN; run;
ods trace off;

If you run that with the trace on, in the output window you will see a block for each component created by the procedure, there tends to be a fair few, which you can select with some options in the procedure.  If you only want to see parts of the output, you can simply specify this with (and depends what the part is called):

ods output <modelpart> = <stored dataset>;
proc
npar1way MEDIAN data=Simulation; ...

The <modelpart> you get from the output window output and is determined by what you want to see, the <stored dataset> is where you want to store the output.  You can then proc print the stored dataset to see it in the output window.

Here is the SAS help on this topic:

http://documentation.sas.com/?docsetId=odsug&docsetTarget=p1fpt3uuow90o3n155hs7bp1mo7f.htm&docsetVer...

New Contributor
Posts: 3

Re: Fİltering a specific value from the output

Thanks for your response..hope to overcome this problem

best regards
New User
Posts: 1

Re: Fİltering a specific value from the output

Hi, 

I have the same mistake. I want to make a table that gives computed type I error rate from the comparison repeat  at 50 times. From the Van der Waerden test p values should be drawn and the type 1 error calculated.How can I get output as a single table.

 

 

%mend;

%macro simu (r=, n1=, n2=, n3=, mu1=, mu2=, mu3=, sigma1=, sigma2=, sigma3=,
times=);
data Simulation(drop=i);
do SampleID = 1 to &Times;
do i = 1 to &n1;
group=1; y=rand("normal",&mu1,&sigma1);/* Group 1: x ~ N(mu1,sigma1^)
*/
output;
end;
do i = 1 to &n2;
group=2; y=rand("normal",&mu2,&sigma2); /* Group 2: x ~
N(mu2,sigma2^) */
output;
end;
do i = 1 to &n3;
group=3; y=rand("normal",&mu3,&sigma3); /* Group 3: x ~
N(mu3,sigma2^) */
output;
end;
end;
run;

proc npar1way VW data=Simulation;
by SampleID;
class group;
ods graphics off;

run;

 
%mend;

%simu (n1=5, n2=5, n3=5, mu1=10, mu2=10, mu3=10, sigma1=1, sigma2=1, sigma3=1,
times=50);


run;

 

Super User
Super User
Posts: 9,227

Re: Fİltering a specific value from the output

Read my post, select the component output parts you want, then merge or set them together to form a final dataset.  

New Contributor
Posts: 3

Re: Fİltering a specific value from the output

unfortunately can't find a soluation to this problem... thanks again to give your valuable time again

 

best regards

Ask a Question
Discussion stats
  • 5 replies
  • 168 views
  • 0 likes
  • 3 in conversation