BookmarkSubscribeRSS Feed
mughaloimran
Calcite | Level 5
For this problem,
Run PROC UNIVARIATE on the variables RBC and WBC from the Blood data set.
1.1 Display the names of the output objects created by this procedure. Attach a screenshot that shows the names.
Show the code and output of names of the output objects. Any unnecessary outputs will cause a penalty of losing points.
1.2 Run PROC UNIVARIATE again, selecting only the output object that shows extreme observations
.And send this output to a temporary SAS data set extrm_obs
. Set the title as “Extreme Observations of RBC and WBC”. Show the code
, data set of extrm_obs and interpretation of the data set. Any
unnecessary outputs will cause a penalty of losing
points.
1.3 Issue two ODS statements: one to select the Basic Statistical Measures output object and the other to send this output to a permanent SAS data set : RBC_WBC_Measures. Set the title as "Basic Statistical Measures for RBC and WBC". Show the code ,data set and interpretation of the dataset

 

Is this code correct?

 

data Blood;
set blood;
run;

ods trace on;
proc univariate data=blood;
var RBC WBC;
run;
ods trace off;
ods select quantiles;
proc univariate data=blood;
var RBC WBC;
run;

ods select extrm_obs;
title "Extreme Observations of RBC and WBC";
proc Univariate data=Blood;
id Subject;
var RBC WBC;
run;
ods select extremeobs;
title "Extreme Observations of RBC and WBC";
proc Univariate data=Blood;
id Subject;
var RBC WBC;
run;

4 REPLIES 4
mkeintz
PROC Star

@mughaloimran wrote:
For this problem,
Run PROC UNIVARIATE on the variables RBC and WBC from the Blood data set.
1.1 Display the names of the output objects created by this procedure. Attach a screenshot that shows the names.
Show the code and output of names of the output objects. Any unnecessary outputs will cause a penalty of losing points.
1.2 Run PROC UNIVARIATE again, selecting only the output object that shows extreme observations
.And send this output to a temporary SAS data set extrm_obs
. Set the title as “Extreme Observations of RBC and WBC”. Show the code
, data set of extrm_obs and interpretation of the data set. Any
unnecessary outputs will cause a penalty of losing
points.
1.3 Issue two ODS statements: one to select the Basic Statistical Measures output object and the other to send this output to a permanent SAS data set : RBC_WBC_Measures. Set the title as "Basic Statistical Measures for RBC and WBC". Show the code ,data set and interpretation of the dataset

 

Is this code correct?

 

data Blood;
set blood;
run;

ods trace on;
proc univariate data=blood;
var RBC WBC;
run;
ods trace off;
ods select quantiles;
proc univariate data=blood;
var RBC WBC;
run;

ods select extrm_obs;
title "Extreme Observations of RBC and WBC";
proc Univariate data=Blood;
id Subject;
var RBC WBC;
run;
ods select extremeobs;
title "Extreme Observations of RBC and WBC";
proc Univariate data=Blood;
id Subject;
var RBC WBC;
run;


Have you tried to run it?  What does the sas log report?

--------------------------
The hash OUTPUT method will overwrite a SAS data set, but not append. That can be costly. Consider voting for Add a HASH object method which would append a hash object to an existing SAS data set

Would enabling PROC SORT to simultaneously output multiple datasets be useful? Then vote for
Allow PROC SORT to output multiple datasets

--------------------------
mughaloimran
Calcite | Level 5

Screenshot (233).png

 

 

Rick_SAS
SAS Super FREQ

Clearly, the code you submitted to SAS is different from the code you posted to the community. That's why you should always paste the SAS log that shows the error and the SAS code prior to the error. 

 

Your screenshot shows that the code you are submitting has a BY statement such as 

BY Gender;

When you use a BY statement, the data must be sorted by the variables(s) on the BY statement.

So to fix the error, either delete the BY statement or run PROC SORT:

 

proc sort data=Blood;
by Gender;
run;

 

Sajid01
Meteorite | Level 14

hello @mughaloimran 
Can you provide sample data from the dataset you have used?

sas-innovate-2024.png

 

Time is running out to save with the early bird rate. Register by Friday, March 1 for just $695 - $100 off the standard rate.

 

Check out the agenda and get ready for a jam-packed event featuring workshops, super demos, breakout sessions, roundtables, inspiring keynotes and incredible networking events. 

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 4 replies
  • 391 views
  • 0 likes
  • 4 in conversation