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;
@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. Anyunnecessary outputs will cause a penalty of losingpoints.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?
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;
hello @mughaloimran
Can you provide sample data from the dataset you have used?
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!
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.