Transcription of SUGI 26: Model Fitting in PROC GENMOD - SAS
1 Statistics, Data Analysis, and Data Mining Paper 264-26. Model Fitting in PROC GENMOD . Jean G. Orelien, Analytical Sciences, Inc. Abstract: The function f is known as the link distribution. For ANOVA, the link distribution is the There are several procedures in the SAS System identity. Other possible link functions include for statistical modeling. Most statisticians who the logit for logistic regression or log for count use the SAS system are familiar with procedures data. Whereas in general linear models, it is such as PROC REG and PROC GLM for Fitting necessary to assume that the errors are general linear models. However PROC independent, have equal variances and are GENMOD can handle these general linear normally distributed, none of these assumptions models as well as more complex ones such as are necessary in GLMs.
2 Logistic models, loglinear models or models for count data. In addition, the main advantage of In the SAS System, GLMs can be fitted in PROC GENMOD is that it can accommodate PROC GENMOD . But separate procedures the analysis of correlated data. In this paper, we exist for certain sub classes of GLM models will discuss the use of PROC GENMOD to such as logistic regression or general linear analyze simple as well as more complex models. For example, PROC GLM can fit statistical models. When other procedures are general linear models. Although regression available to perform the same analysis, we will analysis can be fitted with PROC GLM, PROC. highlight the options from these procedures that REG is more specific to this type of analysis. may be missing in PROC GENMOD but might Similarly, there exists also a PROC ANOVA.
3 Be of interest to the user. An example is given that is specific as the name indicates to ANOVA. showing how PROC GENMOD is used to models. Another SAS procedure for analyzing a analyze various types of endpoints (continuous subclass of GLM models is PROC LOGISTIC. and count data) from a toxicology experiment. The materials in this paper should be accessible In this paper, we will provide an overview of even to those users with limited data analysis some of the models that can be fitted with skills. PROC GENMOD . When these models can be fitted by other SAS procedures, we will outline 1. Introduction some differences between these procedures and GENMOD that the user needs to be aware of. Generalized linear models (GLMs) include the In section 2, we discuss the Fitting of GLM. most common statistical models used in models in GENMOD and other procedures.
4 The Statistics. This class of models includes general Fitting of logistic models is discussed in section linear models and logistics models. It should be 3. Other types of models such as those noted that general linear models include involving other link distributions besides the ANOVA models as well as regression analysis. logit and the identify as well as models for Complex models such as those arising from correlated data are discussed in section 4. In correlated data (repeated measures, clustered section 5, we provide an example showing how data) can also be fitted with GLMs. The form of we have used PROC GENMOD to analyze a GLM Model is given by: different types of endpoints from the National Toxicology Program (NTP). f(Y)'X % . (1). Statistics, Data Analysis, and Data Mining 2. Fitting of General Linear PROC GENMOD uses maximum likelihood Models in GENMOD and Other methods.
5 For general linear models, the maximum likelihood and the least squares Procedures methods yield the same estimates. There are many procedures besides PROC. There are instances, where the data analyst is GENMOD in the SAS System for the Fitting of familiar with the data and may want to use general linear models. The three most PROC GENMOD to create outputs from the commonly used are PROC ANOVA, PROC. analysis of general linear models that are REG and PROC GLM. PROC GLM is the most uniform with other outputs from more complex comprehensive of the three models. Any models that can only be analyzed in PROC. analysis of general linear models can be GENMOD . An example of that will be given in performed in this procedure. However, the section 5. In general, we suggest that other two procedures are more efficient or offer GENMOD be used for analysis of GLM models more options for certain subclasses of general only in those instances where the analyst wishes linear models.
6 PROC ANOVA handles analysis to obtain coefficient estimates and their of variance models with balanced designs. For variance. In these cases, the analyst should these models, PROC ANOVA is faster than know from prior experience with similar data, PROC GLM. For regression models, PROC. that the data is well behaved and that no REG provides many options that are not found general linear models assumptions are violated. in other procedures. Some of the advantages of PROC REG are that the user can fit several We give below some examples of the use of models with one call of the procedure, there are PROC GENMOD for analysis of general linear also more options for Model selections and models. diagnostic tools to detect multicollinearity. Multicollinearity occurs when the independent Example of a Regression analysis variables in the models are correlated among themselves.
7 This can lead to large variance for Suppose sales for a company in a district can be the estimated coefficients and affect our predicted as a function of the target population interpretation of these coefficients. and the per capita discretionary income. The data comes from Applied Linear Statistical Although, PROC GENMOD can fit any general Models from Neter, Wasserman and Kutner linear Model , there are many useful options that (page 249). Regression coefficients can be it does not provide. For example, in an obtained with either of the following two ANOVA Model with random effects, one may syntaxes: be interested in estimating the variance components. This would not be possible in proc GENMOD data=salesdata;. PROC GENMOD . With ANOVA models, one Model sales=target_population may also want to compare the means of an discretionary_income.
8 Independent variable at several levels. As of version , there is an LSMEANS statement in or PROC GENMOD , but unlike in PROC GLM, only the least squares estimates can be obtained proc reg data=salesdata;. with this statement, no statistical comparisons of Model sales=target_population the means can be made. It should be noted that discretionary_income;. while the other procedures that we have mentioned in this section used least squares Example of an Analysis of Variance methods to estimate the coefficient parameters, Statistics, Data Analysis, and Data Mining Suppose a research laboratory develops a new because of the options it provides for Model compound for the relief of severe hay fever and selections. On the other hand, if one is only wants to compare the effect of the ingredients on interested in finding out whether an independent the outcome.
9 The outcome being measured is variable has a significant effect on the variation number hours of relief. This hypothetical of a proportion then the analyst has the choice of example is also taken from Neter, Kutner and using either PROC LOGISTIC or PROC. Wasserman (page 722). We could perform this GENMOD . In earlier versions of the SAS. analysis in PROC GENMOD with the following System [at least up to version ], there was syntax: no CLASS or CONTRAST statements in PROC. LOGISTIC. Thus, for the analysis of categorical proc GENMOD data=compounds_data; variables one might have preferred PROC. class ingredient1 ingredient2; GENMOD over PROC LOGISTIC in earlier Model hours_of_relief= versions, since these categorical variables would ingredient1 ingredient2; have to be recoded in a data step prior to the call of the LOGISTIC procedure.
10 The same analysis could also be performed in PROC GLM: We give here an example of the use of PROC. GENMOD for the analysis of binary data. proc glm data=compounds_data;. class ingredient1 ingredient2;. Example of a logistic regression analysis with Model hours_of_relief=. ingredient1 ingredient2; binary data 3. Fitting of Logistic Models in PROC Bliss (1935) reports the proportion of beetles GENMOD and PROC LOGISTIC killed after 5 hours of exposure at various concentrations of gaseous carbon disulphide. Logistic models are of the form: To obtain the regression coefficient to Model proportion of beetles killed as a function of p dosage, the following SAS code can be used: log 'X % (2). 1&p These models are appropriate for modeling proc GENMOD data=beetle_data;. Model proportions. Similar to a regular regression, a number_killed/number_of_beetles=.