Cross-sectional Data Models Task: Zero-inflated Poisson Model
- Example: Zero-inflated Poisson Model
- Zero-inflated Poisson Model: Assigning Data to Roles
- Zero-inflated Poisson Model: Setting the Model Options
- Setting the Options
- Zero-inflated Poisson Model: Creating Output Data
Example: Zero-inflated Poisson Model
To create this example:
- Create the Work.Long97Data data set. For more information, see Long97Data Data Set.
- On a Program tab,
run this code to create a connection to Cloud Analytic Services (CAS)
and to start a CAS session:
options cashost="<cas-server-name>" casport=<port-number>; cas;Note: You can also use the Connect to CAS task or the Create CAS Connection snippet in SAS Studio. - Run this code to load
the data into a CAS table:
libname mycas cas; proc casutil; load data=work.long97data casout="long97data"; run; - In the Tasks section, expand
the Viya Foundation
Econometrics folder, and then double-click Cross-sectional Data
Models. The user interface for the Cross-sectional Data Models
task opens. - On the Data tab,
select MYCAS.LONG97DATA.
TipIf the data source is not available from the drop-down list, click
. In the Choose a Table window, expand the library that contains the data source that you want to use. Select the data source for the example and click OK. The selected data source now appears in the drop-down list.
- Assign columns to these
roles:
Role Assignments for Zero-Inflated Poisson Role
Column Name
Dependent variable
art
Continuous variables
ment
phd
Categorical variable
kid5
- On the Model tab, select Zero-inflated Poisson as the model type.
- To run the task, click
Run .
Here are the results:

Zero-inflated Poisson Model: Assigning Data to Roles
To perform a zero-inflated Poisson model analysis, you must select an input data source. You also must assign a variable to the Dependent variable role.
To filter the input
data source, click .
|
Role |
Description |
|---|---|
|
Roles | |
|
Dependent variable |
specifies the numeric column that contains the count values. In the input data source, this variable must contain only nonnegative integer values. |
|
Continuous variables |
Specifies the independent covariates (regressors) for the regression model. If you do not specify a continuous variable, the task fits a model that contains only an intercept. |
|
Categorical variables |
Specifies the classification variables. The task generates dummy variables for each level of the categorical variable. |
|
Additional Roles | |
|
Group analysis by |
Enables you to obtain separate analyses of observations for each unique group. |
Zero-inflated Poisson Model: Setting the Model Options
To create a zero-inflated Poisson model:
- From the Model type drop-down list, select Zero-inflated Poisson.
- Specify the effects
for the model.
You can display the main effects model or create a custom model. To create a custom model, select the Custom Model option, and then click Edit. The Model Effects Builder opens. All continuous variables and categorical variables are listed in the left pane.
When you finish, click OK. The effects that you specified now appear on the Model tab.
- Specify the link function to use to compute the probability of zeros. You can choose from the logistic function (default) or the normal function.
Setting the Options
|
Option Name |
Description |
|---|---|
|
Methods | |
|
Covariance matrix estimator |
Specifies the method to calculate the covariance matrix of parameter estimates. You can use the default value, or you can choose from these covariance types:
|
|
Optimization | |
|
Method |
Specifies the optimization method to use. |
|
Maximum number of iterations |
Specifies the maximum number of iterations in the optimization process. You can use the default value, or you can specify a custom value. |
|
Statistics | |
|
Select the statistics to display in the results. Here are the additional statistics that you can include in the results:
| |
Zero-inflated Poisson Model: Creating Output Data
You can create the following output:
- a table that contains the default statistics from the analysis and any selected statistics, such as the probability of the dependent variable taking the current value and the linear predictor. When naming this table, you must specify a CAS engine libref.
- a data set of parameter estimates. When naming this data set, you must specify a SAS libref.