Published on :
Général CREATION_INTERNE

Sans titre

This code is also available in: Deutsch Español Français
Awaiting validation
Data Analysis

Type : CREATION_INTERNE


Data is dynamically created within the script using the DATALINES statement and iterative loops.

1 Code Block
DATA STEP Data
Explanation :
Creation of the 'Cheese' dataset containing taste rating frequencies for each additive. Use of ' @@' syntax to read multiple observations per data line.
Copied!
1title 'Example 3: Ordinal Logistic Regression';
2 
3DATA Cheese;
4 DO Additive = 1 to 4;
5 DO y = 1 to 9;
6 INPUT freq @code_sas_json/8_SAS_Intro_ReadFile_MultiCol_@@.json;
7 OUTPUT;
8 END;
9 END;
10 label y='Taste Rating';
11 DATALINES;
120 0 1 7 8 8 19 8 1
136 9 12 11 7 6 1 0 0
141 1 6 8 23 7 5 1 0
150 0 0 1 3 7 14 16 11
16;
2 Code Block
PROC HPLOGISTIC
Explanation :
Execution of the high-performance logistic regression procedure. The model uses 'freq' as the weighting variable and 'Additive' as the categorical explanatory variable (reference='4').
Copied!
1PROC HPLOGISTIC DATA=Cheese;
2 freq freq;
3 class Additive(ref='4') / param=ref ;
4 model y=Additive;
5 title 'Multiple Response Cheese Tasting Experiment';
6RUN;
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.
Copyright Info : SAS SAMPLE LIBRARY