BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
SerdarFin
Calcite | Level 5

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;

1 ACCEPTED SOLUTION

Accepted Solutions
Ksharp
Super User

Now, I know what kind of model you want to build. You are trying build cumulative Logistic Regression, 
But ZERO here means nothing for Logistic Model. Maybe you should start to consider other Model Like Zero-Inflated Poission Model.

View solution in original post

4 REPLIES 4
Ksharp
Super User

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;


SerdarFin
Calcite | Level 5
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;
Ksharp
Super User

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 .

Ksharp
Super User

Now, I know what kind of model you want to build. You are trying build cumulative Logistic Regression, 
But ZERO here means nothing for Logistic Model. Maybe you should start to consider other Model Like Zero-Inflated Poission Model.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 1100 views
  • 0 likes
  • 2 in conversation