turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- SAS Programming
- /
- SAS Procedures
- /
- Including zero-count cells to the GENMOD (multinom...

Topic Options

- RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

07-08-2016 08:50 AM

**I have a data as below syntax, when I run this analysis the program does not include zero-count cells, so the contrasts among the "site"s (site is one of the input in my data as you may see below) are not realistic. Is there anyway to include zero-counts to the analysis? If it is possible I prefer to add some additional syntax to the below?**

**data** plant;

input site $ leaf $ count;

datalines;

Fa nh 21

Fa sh 0

Fa h 5

Green nh 0

Green sh 0

Green h 16

Ice nh 4

Ice sh 0

Ice h 4

NFM nh 6

NFM sh 13

NFM h 47

NFRB nh 7

NFRB sh 0

NFRB h 15

SF nh 11

SF sh 13

SF h 19

SpM nh 15

SpM sh 2

SpM h 2

SpX nh 8

SpX sh 1

SpX h 0

SW nh 19

SW sh 0

SW h 1

;

**proc** **genmod** data=plant rorder=data;

freq count;

class site;

model leaf=site / dist=multinomial link=cumlogit aggregate=site type3;

estimate 'LogORFaGreen' site **1** -**1** **0** **0** **0** **0** **0** **0** **0** / exp;

estimate 'LogORFaIce' site **1** **0** -**1** **0** **0** **0** **0** **0** **0** / exp;

estimate 'LogORFaNFM' site **1** **0** **0** -**1** **0** **0** **0** **0** **0** / exp;

estimate 'LogORFaNFRB' site **1** **0** **0** **0** -**1** **0** **0** **0** **0** / exp;

estimate 'LogORFaSF' site **1** **0** **0** **0** **0** -**1** **0** **0** **0** / exp;

estimate 'LogORFaSW' site **1** **0** **0** **0** **0** **0** -**1** **0** **0** / exp;

estimate 'LogORFaSpM' site **1** **0** **0** **0** **0** **0** **0** -**1** **0** / exp;

estimate 'LogORFaSpX' site **1** **0** **0** **0** **0** **0** **0** **0** -**1** / exp;

estimate 'LogORGreenIce' site **0** **1** -**1** **0** **0** **0** **0** **0** **0** / exp;

estimate 'LogORGreenNFM' site **0** **1** **0** -**1** **0** **0** **0** **0** **0** / exp;

estimate 'LogORGreenNFRB' site **0** **1** **0** **0** -**1** **0** **0** **0** **0** / exp;

estimate 'LogORGreenSF' site **0** **1** **0** **0** **0** -**1** **0** **0** **0** / exp;

estimate 'LogORGreenSW' site **0** **1** **0** **0** **0** **0** -**1** **0** **0** / exp;

estimate 'LogORGreenSpM' site **0** **1** **0** **0** **0** **0** **0** -**1** **0** / exp;

estimate 'LogORGreenSpX' site **0** **1** **0** **0** **0** **0** **0** **0** -**1** / exp;

estimate 'LogORIceNFM' site **0** **0** **1** -**1** **0** **0** **0** **0** **0** / exp;

estimate 'LogORIceNFRB' site **0** **0** **1** **0** -**1** **0** **0** **0** **0** / exp;

estimate 'LogORIceSF' site **0** **0** **1** **0** **0** -**1** **0** **0** **0** / exp;

estimate 'LogORIceSW' site **0** **0** **1** **0** **0** **0** -**1** **0** **0** / exp;

estimate 'LogORIceSpM' site **0** **0** **1** **0** **0** **0** **0** -**1** **0** / exp;

estimate 'LogORIceSpX' site **0** **0** **1** **0** **0** **0** **0** **0** -**1** / exp;

estimate 'LogORNFMNFRB' site **0** **0** **0** **1** -**1** **0** **0** **0** **0** / exp;

estimate 'LogORNFMSF' site **0** **0** **0** **1** **0** -**1** **0** **0** **0** / exp;

estimate 'LogORNFMSW' site **0** **0** **0** **1** **0** **0** -**1** **0** **0** / exp;

estimate 'LogORNFMSpM' site **0** **0** **0** **1** **0** **0** **0** -**1** **0** / exp;

estimate 'LogORNFMSpX' site **0** **0** **0** **1** **0** **0** **0** **0** -**1** / exp;

estimate 'LogORNFRBSF' site **0** **0** **0** **0** **1** -**1** **0** **0** **0** / exp;

estimate 'LogORNFRBSW' site **0** **0** **0** **0** **1** **0** -**1** **0** **0** / exp;

estimate 'LogORNFRBSpM' site **0** **0** **0** **0** **1** **0** **0** -**1** **0** / exp;

estimate 'LogORNFRBSpX' site **0** **0** **0** **0** **1** **0** **0** **0** -**1** / exp;

estimate 'LogORSFSW' site **0** **0** **0** **0** **0** **1** -**1** **0** **0** / exp;

estimate 'LogORSFSpM' site **0** **0** **0** **0** **0** **1** **0** -**1** **0** / exp;

estimate 'LogORSFSpX' site **0** **0** **0** **0** **0** **1** **0** **0** -**1** / exp;

estimate 'LogORSWSpM' site **0** **0** **0** **0** **0** **0** **1** -**1** **0** / exp;

estimate 'LogORSWSpX' site **0** **0** **0** **0** **0** **0** **1** **0** -**1** / exp;

estimate 'LogORSpMSpX' site **0** **0** **0** **0** **0** **0** **0** **1** -**1** / exp;

**run**;

Accepted Solutions

Solution

07-13-2016
12:50 PM

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to SerdarFin

07-10-2016 06:09 AM

All Replies

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to SerdarFin

07-09-2016 02:07 AM

What kind of model are you trying to build ? LOGISTIC or Zero Inflated Possion Regression ? I can't believe why documentation didn't include an example for ZIP . Zero Inflated Possion : data plant; input site $ leaf $ count; datalines; Fa nh 21 Fa sh 0 Fa h 5 Green nh 0 Green sh 0 Green h 16 Ice nh 4 Ice sh 0 Ice h 4 NFM nh 6 NFM sh 13 NFM h 47 NFRB nh 7 NFRB sh 0 NFRB h 15 SF nh 11 SF sh 13 SF h 19 SpM nh 15 SpM sh 2 SpM h 2 SpX nh 8 SpX sh 1 SpX h 0 SW nh 19 SW sh 0 SW h 1 ; proc genmod data=plant ; class leaf site; model count=leaf site / dist=zip type3; zeromodel site/link=logit; estimate 'LogORFaGreen' site 1 -1 0 0 0 0 0 0 0 / exp; run;

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Ksharp

07-09-2016 02:44 AM

no attachments. -##

Hi,

Thanks for the reply.

But "count" should be Frequency Weight Variable of "leaf", sp "leaf" should be response, model leaf=site. I try it but this doesnt work. Which I tried as below considering your solution, may I ask to check and if possible adjust the model statement below: Iadded "freq count" to the syntax but it didnt work?

data plant;

input site $ leaf $ count;

datalines;

Fa nh 21

Fa sh 0

Fa h 5

Green nh 0

Green sh 0

Green h 16

Ice nh 4

Ice sh 0

Ice h 4

NFM nh 6

NFM sh 13

NFM h 47

NFRB nh 7

NFRB sh 0

NFRB h 15

SF nh 11

SF sh 13

SF h 19

SpM nh 15

SpM sh 2

SpM h 2

SpX nh 8

SpX sh 1

SpX h 0

SW nh 19

SW sh 0

SW h 1

;

proc genmod data=plant ;

freq count;

class site;

model leaf=site / dist=zip type3;

zeromodel site/link=logit;

estimate 'LogORFaGreen' site 1 -1 0 0 0 0 0 0 0 / exp;

run;

Hi,

Thanks for the reply.

But "count" should be Frequency Weight Variable of "leaf", sp "leaf" should be response, model leaf=site. I try it but this doesnt work. Which I tried as below considering your solution, may I ask to check and if possible adjust the model statement below: Iadded "freq count" to the syntax but it didnt work?

data plant;

input site $ leaf $ count;

datalines;

Fa nh 21

Fa sh 0

Fa h 5

Green nh 0

Green sh 0

Green h 16

Ice nh 4

Ice sh 0

Ice h 4

NFM nh 6

NFM sh 13

NFM h 47

NFRB nh 7

NFRB sh 0

NFRB h 15

SF nh 11

SF sh 13

SF h 19

SpM nh 15

SpM sh 2

SpM h 2

SpX nh 8

SpX sh 1

SpX h 0

SW nh 19

SW sh 0

SW h 1

;

proc genmod data=plant ;

freq count;

class site;

model leaf=site / dist=zip type3;

zeromodel site/link=logit;

estimate 'LogORFaGreen' site 1 -1 0 0 0 0 0 0 0 / exp;

run;

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to SerdarFin

07-09-2016 09:57 PM

I am not expert about statistical, Maybe someone could give you some good advice. First of all , you need to know what kind of model you want to build . if you want take LEAF as dependent variable which have three levels , the model you gave us didn't mean anything for your data . It is more like you want build ANOVA or Covariate Analysis ? Check PROC GLM .

Solution

07-13-2016
12:50 PM

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to SerdarFin

07-10-2016 06:09 AM