The script begins by creating a dataset named 'ingots' which contains the number of defective ingots ('Notready') for different combinations of heating time ('Heat') and soaking time ('Soak'), as well as the total tested ('Total'). It then calculates the logarithm of the total ('lnTotal') to use as an offset variable in the model. The PROC GENMOD procedure is then called to fit a Poisson regression model, where 'Notready' is the dependent variable. An exact conditional analysis is requested for the 'Heat' and 'Soak' parameters to obtain more precise estimates and tests, which is particularly useful with small samples.
Data Analysis
Type : CREATION_INTERNE
Data is created directly in the script using a DATA step and the 'datalines' statement.
1 Code Block
DATA STEP Data
Explanation : This data block creates the 'ingots' table. It reads the 'Heat', 'Soak', 'Notready', and 'Total' variables from the in-line data (datalines), then calculates a new 'lnTotal' variable which is the logarithm of 'Total'. This table is the source for statistical analysis.
INPUT Heat Soak Notready Total @code_sas_json/8_SAS_Intro_ReadFile_MultiCol_@@.json;
3
lnTotal= log(Total);
4
DATALINES;
5
71.0 0 10141.0 0 31271.0156511.0313
6
71.7 0 17141.7 0 43271.7444511.7 0 1
7
72.2 0 7142.2233272.2 0 21512.2 0 1
8
72.8 0 12142.8 0 31272.8122514.0 0 1
9
74.0 0 9144.0 0 19274.0116
10
;
11
2 Code Block
PROC GENMOD
Explanation : This block uses PROC GENMOD to perform Poisson regression. 'Heat' and 'Soak' are defined as class variables. The model predicts 'Notready' based on 'Heat' and 'Soak', with 'lnTotal' as an offset variable to normalize exposure. The 'exact' statement requests an exact conditional analysis for the 'Heat' and 'Soak' variables, and 'exactoptions' sets a time limit for the status of this analysis.
model Notready=Heat Soak / offset=lnTotal dist=Poisson link=log;
4
exact Heat Soak / joint estimate;
5
exactoptions statustime=10;
6
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.
Copyright Info : SAS SAMPLE LIBRARY, NAME: GENMEX11, TITLE: Example 11 for PROC GENMOD, PRODUCT: STAT
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.