
Thank you both for the extensive amount of help!  I am sorry it has taken me a bit to respond, but i've been trying to plug away at this.  I still have a few questions, if you don't mind giving me some pointers: 

Here is the fake data again: 


treatment 
	
feeding 
	
avoid 
	
noavoid (all visits which didn’t result in avoidance) 


Control 
	
nofeeding 
	
1 
	
357 


Control 
	
chum 
	
2 
	
292 


Control 
	
Satiation 
	
4 
	
186 


Proc. Control 
	
nofeeding 
	
15 
	
291 


Proc. Control 
	
chum 
	
25 
	
288 


Proc. Control 
	
Satiation 
	
17 
	
140 


Magnet 
	
nofeeding 
	
87 
	
224 


Magnet 
	
Chum 
	
34 
	
229 


Magnet 
	
Satiation 
	
46 
	
151 


Here is the coding: 

model1 <- glm(cbind(avoid, noavoid) ~ treatment, family=binomial,  data=avoid) 
summary(model1) 

glm(formula = cbind(avoid, noavoid )~treatment , family = binomial, 
data = avoid) 


 #Predicting avoid, no avoid from just treatment 


model2 <- glm(cbind(avoid, noavoid) ~ feeding, family=binomial, data=avoid) 
summary(model2) 




  glm(formula = cbind(avoid, noavoid )~feeding , family = binomial, 
data = avoid) 

#Predicting avoid, no avoid from just feeding 




model3<-glm(cbind(avoid,noavoid)~treatment*feeding,family=binomial,data=avoid) 

summary(model3) 

glm(formula = cbind(avoid, noavoid )~treatment*feeding , family = binomial, 
data = avoid) 
#Predicting avoid,noavoid from the interaction between treatment and feeding 

However, when I run all the models, I notice that my "control" data is not incorporated in the output.  I just receive my procedural control and magnet data.  I cannot figure what is causing this. 

Secondly, when I run model 3 I am not receiving what I anticipated.  I thought I would get the following output data: 

treatmentmag                  
treatmentproc                 
feedingnofeed                    
feedingsat                        
treatmentmag:feedingnofeed        
treatmentproc:feedingnofeed       
treatmentmag:feedingsat          
treatmentproc:feedingsat 

What happened to the following:  treatmentcon, feedingchum, treatmentcon:feedingnofeed, treatmentcon:feedingsat, treatmentmag:feedingchum, treatmentproc:feedingchum, treatmentcon:feedingchum ?   I have a strange feeling that the issue is arising from my "family=binomial" term.  Any feedback would be greatly appreciated. 

Kind Regards, 

Craig 


----- Original Message -----

From: "Steve Lianoglou" <mailinglist.honeypot@gmail.com> 
To: "David Winsemius" <dwinsemius@comcast.net> 
Cc: "Craig P O'Connell" <coconnell2@umassd.edu>, r-help@r-project.org 
Sent: Tuesday, November 27, 2012 11:54:48 PM 
Subject: Re: [R] GLM Coding Issue 

Hi, 

On Tuesday, November 27, 2012, David Winsemius wrote: 
[snip] 



<blockquote>
`cbind`-ing doesn't make much sense here. What is your target (y) 
variable here? are you trying to predict `avoid` or `noavoid` status? 



Sorry, Steve. It does make sense. See : 

?glm  # First paragraph of Details. 
</blockquote>



Indeed ... I've tried to,send a follow up email salvaging my bad call with some hopefully useful tidbits, but it "matched some headers" and is stuck in the mailman queue. It might come through eventually. 


Don't be sorry, though ... I learned something new :-) 


Still, I do apologize for the flawed advice re: the cbind-ing thing 


-Steve 



-- 
Steve Lianoglou 
Graduate Student: Computational Systems Biology 
 | Memorial Sloan-Kettering Cancer Center 
 | Weill Medical College of Cornell University 
Contact Info: http://cbio.mskcc.org/~lianos/contact 


	[[alternative HTML version deleted]]


