BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
kamal1
Fluorite | Level 6

Hello All,

I am trying to run a simulation for the normality test. I have the following program which is running well. But I have a problem with output. It is always printing output tables of "proc univariate." When I use "NOPRINT" I received the same answer and warning "

verify that the appropriate procedure options are used to produce the requested output object. For example, verify
that the NOPRINT option is not used." Without NOPRINT, It prints the proc univariate output so program stuck in the middle of the simulation. "I greatly appreciate any suggestions. 
 
%let N=10;
%let outlierPct=5;
%let NumSamples = 100;

data simulation(keep=sim y); 
do sim=1 to &NumSamples; /* 1. create many samples */

call streaminit(12345);
outlierNb = round(&N.*&outlierPct./100);
do i = 1 to outlierNb; 
y = rand("Normal",0,4);
output;
end;
do i = outlierNb+1 to &N.; 
y = rand("Normal",0,1);
output;
end;
end;
run;

*ods listing close;
*ods select html close;
ods select TestsforNormality;
proc univariate data=simulation normaltest noprint ;
by sim;
var y;
ods output TestsforNormality=normaltest;
run;
*ods listing;
*ods html;


*create 0/1 variable for rejection of hyphotesis;
data normaltest;

set normaltest;

reject=(pValue<0.1);

run;

*calculate the chance of rejection;

proc means data=normaltest mean;

var reject;

class Test;

run;
1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

Change to this:

 

ods select None;
proc univariate data=simulation normaltest;
by sim;
var y;
ods output TestsforNormality=normaltest;
run;
ods select all;

1. Remove noprint

2. add ODS SELECT NONE/ALL

 

You can do the same thing to PROC MEANS if necessary.

 


@kamal1 wrote:

Hello All,

I am trying to run a simulation for the normality test. I have the following program which is running well. But I have a problem with output. It is always printing output tables of "proc univariate." When I use "NOPRINT" I received the same answer and warning "

verify that the appropriate procedure options are used to produce the requested output object. For example, verify
that the NOPRINT option is not used." Without NOPRINT, It prints the proc univariate output so program stuck in the middle of the simulation. "I greatly appreciate any suggestions. 
 
%let N=10;
%let outlierPct=5;
%let NumSamples = 100;

data simulation(keep=sim y); 
do sim=1 to &NumSamples; /* 1. create many samples */

call streaminit(12345);
outlierNb = round(&N.*&outlierPct./100);
do i = 1 to outlierNb; 
y = rand("Normal",0,4);
output;
end;
do i = outlierNb+1 to &N.; 
y = rand("Normal",0,1);
output;
end;
end;
run;

*ods listing close;
*ods select html close;
ods select TestsforNormality;
proc univariate data=simulation normaltest noprint ;
by sim;
var y;
ods output TestsforNormality=normaltest;
run;
*ods listing;
*ods html;


*create 0/1 variable for rejection of hyphotesis;
data normaltest;

set normaltest;

reject=(pValue<0.1);

run;

*calculate the chance of rejection;

proc means data=normaltest mean;

var reject;

class Test;

run;

 

View solution in original post

2 REPLIES 2
Reeza
Super User

Change to this:

 

ods select None;
proc univariate data=simulation normaltest;
by sim;
var y;
ods output TestsforNormality=normaltest;
run;
ods select all;

1. Remove noprint

2. add ODS SELECT NONE/ALL

 

You can do the same thing to PROC MEANS if necessary.

 


@kamal1 wrote:

Hello All,

I am trying to run a simulation for the normality test. I have the following program which is running well. But I have a problem with output. It is always printing output tables of "proc univariate." When I use "NOPRINT" I received the same answer and warning "

verify that the appropriate procedure options are used to produce the requested output object. For example, verify
that the NOPRINT option is not used." Without NOPRINT, It prints the proc univariate output so program stuck in the middle of the simulation. "I greatly appreciate any suggestions. 
 
%let N=10;
%let outlierPct=5;
%let NumSamples = 100;

data simulation(keep=sim y); 
do sim=1 to &NumSamples; /* 1. create many samples */

call streaminit(12345);
outlierNb = round(&N.*&outlierPct./100);
do i = 1 to outlierNb; 
y = rand("Normal",0,4);
output;
end;
do i = outlierNb+1 to &N.; 
y = rand("Normal",0,1);
output;
end;
end;
run;

*ods listing close;
*ods select html close;
ods select TestsforNormality;
proc univariate data=simulation normaltest noprint ;
by sim;
var y;
ods output TestsforNormality=normaltest;
run;
*ods listing;
*ods html;


*create 0/1 variable for rejection of hyphotesis;
data normaltest;

set normaltest;

reject=(pValue<0.1);

run;

*calculate the chance of rejection;

proc means data=normaltest mean;

var reject;

class Test;

run;

 

kamal1
Fluorite | Level 6

Hi Reeza,

You are AWESOME!! Thank you so much replying my post in less than 3 min. It is perfect. You saved my time. If you know any article where I should look at for proc mean procedure, please let me know.

Thank you very much again.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 4362 views
  • 0 likes
  • 2 in conversation