The script begins by creating a dataset named 'Gossypol' via a DATA STEP, using data embedded directly in the script ('datalines'). This dataset contains the variables 'Dose' and 'Gain'. Subsequently, the PROC NPAR1WAY procedure is called three times for different analyses: 1. The first execution performs a general non-parametric analysis to compare 'Gain' based on 'Dose'. 2. The second execution, framed by 'ods graphics on' and 'ods graphics off', generates a box plot of Wilcoxon scores to visualize distributions. 3. The third execution of PROC NPAR1WAY performs a two-sample analysis, applying a 'where Dose <= .04' clause to filter the data and focus on a specific subset. The entire script is designed to demonstrate various applications of PROC NPAR1WAY in experimental data analysis.
Data Analysis
Type : CREATION_INTERNE
The data is created directly within the SAS script via a DATA STEP using the 'datalines' feature to define observations for the 'Dose' and 'Gain' variables.
1 Code Block
DATA STEP Data
Explanation : This DATA STEP block creates the 'Gossypol' dataset. It first reads a 'Dose' and a number 'n' of observations. Then, a loop reads 'n' 'Gain' values for each 'Dose', assigns them, and writes them to the dataset. The data is provided directly in the script via the 'datalines' section.
Explanation : This PROC NPAR1WAY performs a one-way non-parametric analysis. It compares the distribution of the 'Gain' variable among the different groups defined by the 'Dose' variable in the 'Gossypol' dataset.
Copied!
proc npar1way data=Gossypol;
class Dose;
var Gain;
run;
1
PROC NPAR1WAYDATA=Gossypol;
2
class Dose;
3
var Gain;
4
RUN;
3 Code Block
PROC NPAR1WAY
Explanation : This block uses PROC NPAR1WAY to generate a box plot specific to Wilcoxon scores. The 'ods graphics on' and 'ods graphics off' statements enable and disable the graphical output of the Output Delivery System (ODS).
Copied!
ods graphics on;
proc npar1way data=Gossypol plots(only)=wilcoxonboxplot;
class Dose;
var Gain;
run;
ods graphics off;
Explanation : This PROC NPAR1WAY performs a non-parametric analysis on a subset of the 'Gossypol' data. The 'where Dose <= .04' clause filters observations, including only those where the 'Dose' value is less than or equal to 0.04, allowing a targeted analysis on these groups.
Copied!
proc npar1way data=Gossypol;
where Dose <= .04;
class Dose;
var Gain;
run;
1
PROC NPAR1WAYDATA=Gossypol;
2
where Dose <= .04;
3
class Dose;
4
var Gain;
5
RUN;
This material is provided "as is" by We Are Cas. There are no warranties, expressed or implied, as to merchantability or fitness for a particular purpose regarding the materials or code contained herein. We Are Cas is not responsible for errors in this material as it now exists or will exist, nor does We Are Cas provide technical support for it.
SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in the USA and other countries. ® indicates USA registration. WeAreCAS is an independent community site and is not affiliated with SAS Institute Inc.
This site uses technical and analytical cookies to improve your experience.
Read more.