Skip to content

prediction intervals (alpha and beta) for model average estimates from binomial glm and model.avg (library=dRedging)

2 messages · Michelle Ensbey, David Winsemius

#
Thanks for your swift reply

I'm sorry to say that I tried that, and it doesn't appear to work for predicting from the "model.avg" object (ouput). Model.avg is a model averaging function in dRedging. I am NOT trying to predict from the coefficients estimated directly from the glm.

For :
##and the model averaging
##Then when trying to predict you get the error below I understand it is because it is not a glm (or other compatable object) but I thought maybe someone had come across and solved this problem already so I thought I'd check:
OR
Error in UseMethod("predict") : no applicable method for "predict"
##Comes up.
Does anyone have a function or code or has done this (for coefficients obtained from the model.avg function) in the past and can give advice.

Thanks again for your help, let me know if I've just missed something.
Cheers
M


-----Original Message-----
From: David Winsemius [mailto:dwinsemius at comcast.net] 
Sent: Friday, 24 April 2009 10:24 PM
To: Michelle Ensbey
Cc: r-help at r-project.org
Subject: Re: [R] prediction intervals (alpha and beta) for model average estimates from binomial glm and model.avg (library=dRedging)

In R, the predict family of functions provides that facility. If you  
want the code it will be in the particular function associated with  
the model type.

?predict
?predict.glm
# the example illustrates creation of prediction curves on the  
response scale for  a specific range of data.
# create the desired CI's by appropriate use of the se.fit value  
returned from the predict call.
# This is the code inside predict.glm that does the work when se.fit  
is set as TRUE in the predict call:

se.fit <- pred$se.fit
switch(type, response = {
             se.fit <- se.fit * abs(family(object)$mu.eta(fit))
             fit <- family(object)$linkinv(fit)
         }, link = , terms = )
#
On Apr 27, 2009, at 3:19 AM, Michelle Ensbey wrote:

            
It will need to be someone other than me. I thought to look at an  
object created by that function to see if there were a path to  
success, but there is no dRedging package in either the CMU CRAN  
mirror or the BioC repository.

It makes me wonder whether the authors of that package may have  
decided for valid reasons not to provide such a facility. The question  
of how to concoct standard errors for the lme4 package comes up here  
on a regular basis and the answer is that the process is not at all  
straightforward.

Best of luck;
David
David Winsemius, MD
Heritage Laboratories
West Hartford, CT