Re: [R] Predicted values from glm() when linear predictor is NA.

2022-07-28 Thread John Fox
Dear Jeff, On 2022-07-28 11:12 a.m., Jeff Newmiller wrote: No, in this case I think I needed the "obvious" breakdown. Still digesting, though... I would prefer that if an arbitrary selection had been made that it be explicit .. the NA should be replaced with zero if the singular.ok argument is

Re: [R] Predicted values from glm() when linear predictor is NA.

2022-07-28 Thread Jeff Newmiller
No, in this case I think I needed the "obvious" breakdown. Still digesting, though... I would prefer that if an arbitrary selection had been made that it be explicit .. the NA should be replaced with zero if the singular.ok argument is TRUE, rather than making that interpretation in predict.glm.

Re: [R] Predicted values from glm() when linear predictor is NA.

2022-07-28 Thread John Fox
Dear Jeff, On 2022-07-28 1:31 a.m., Jeff Newmiller wrote: But "disappearing" is not what NA is supposed to do normally. Why is it being treated that way here? NA has a different meaning here than in data. By default, in glm() the argument singular.ok is TRUE, and so estimates are provided e

Re: [R] Predicted values from glm() when linear predictor is NA.

2022-07-27 Thread Jeff Newmiller
But "disappearing" is not what NA is supposed to do normally. Why is it being treated that way here? On July 27, 2022 7:04:20 PM PDT, John Fox wrote: >Dear Rolf, > >The coefficient of TrtTime:LifestageL1 isn't estimable (as you explain) and by >setting it to NA, glm() effectively removes it fro

Re: [R] Predicted values from glm() when linear predictor is NA.

2022-07-27 Thread Rolf Turner
On Thu, 28 Jul 2022 00:42:51 + "Ebert,Timothy Aaron" wrote: > Time is often used in this sort of problem, but really time is not > relevant. A better choice is accumulated thermal units. The insect > will molt when X thermal units have been accumulated. This is often > expressed as degree d

Re: [R] Predicted values from glm() when linear predictor is NA.

2022-07-27 Thread John Fox
Dear Rolf, The coefficient of TrtTime:LifestageL1 isn't estimable (as you explain) and by setting it to NA, glm() effectively removes it from the model. An equivalent model is therefore > fit2 <- glm(cbind(Dead,Alive) ~ TrtTime + Lifestage + + I((Lifestage == "Egg + L1")*TrtTime

Re: [R] Predicted values from glm() when linear predictor is NA.

2022-07-27 Thread David Winsemius
On 7/27/22 17:26, Rolf Turner wrote: I have a data frame with a numeric ("TrtTime") and a categorical ("Lifestage") predictor. Level "L1" of Lifestage occurs only with a single value of TrtTime, explicitly 12, whence it is not possible to estimate a TrtTime "slope" when Lifestage is "L1". Ind

[R] Predicted values VS residuals

2016-08-03 Thread greg holly
Dear all; I am sorry for my earlier post without subject. My question in earlier mail was: I am going to run models for variable selection using elastic-net. Because I have about 1500 descriptive (independent) variables which they are highly correlated. Before running elastic-net and even single

Re: [R] predicted values

2014-02-03 Thread Bert Gunter
... but do note that doing what you describe (using predicted values for missings) can mess up inference: it obviously results in underestimating error variability. If you're not doing inference, then probably no harm, no foul. If you are, then here's to irreproducibility! If you want to handle mis

Re: [R] predicted values

2014-02-03 Thread Felipe Carrillo
Hi Joshua, Thanks for the suggestion, I will check into log link. I just basically want to fill in missing values for days where data is not available. Negative values definetely won't work for the kind of data that I am collecting.   On Saturday, February 1, 2014 7:51 PM, Joshua Wiley wro

Re: [R] predicted values

2014-02-01 Thread Joshua Wiley
Dear Felipe, That is a normal behavior --- The prediction for that simple model decreases over time, and ends up negative. If the outcome cannot take on negative values, treating it as a continuous gaussian may not be optimal --- perhaps some transformation, like using a log link so that the expo

[R] predicted values

2014-02-01 Thread Felipe Carrillo
Consider this dummy dataset. My real dataset with over 1000 records has scatter large and small values. I want to predict for values with NA but I get negative predictions. Is this a normal behaviour or I am missing a gam argument to force the model to predict positive values. library(mgcv) test <-

Re: [R] Predicted values when using offset in ZIP GLM

2012-07-12 Thread Achim Zeileis
On Thu, 12 Jul 2012, Lee, Laura wrote: Hi all! I have built a model to predict interactions with turtles and the model includes an offset for effort: ZIP<-zeroinfl(Sturgeon~fMesh+fSeason+offset(LogEffort),dist="poisson",link="logit",data=data) Note that this includes the offset both in the

[R] Predicted values when using offset in ZIP GLM

2012-07-12 Thread Lee, Laura
Hi all! I have built a model to predict interactions with turtles and the model includes an offset for effort: ZIP<-zeroinfl(Sturgeon~fMesh+fSeason+offset(LogEffort),dist="poisson",link="logit",data=data) I wasn't clear about one aspect of the response to a similar question I recently posted..

Re: [R] Predicted values for zero-inflated Poisson

2012-07-10 Thread Laura Lee
Alain- Thanks again for your reply. Yes, the offset for effort is only in the count part of the model. Sorry I wasn't clear about why I was using 'sum'...my effort data set contains records of trips with the effort given for each trip. I thought using sum would get me the total number of turtle

Re: [R] Predicted values for zero-inflated Poisson

2012-07-10 Thread Highland Statistics Ltd
*Laura Lee* laura.lee at ncdenr.gov /Tue Jul 10 18:27:16 CEST 2012/ ---

Re: [R] Predicted values for zero-inflated Poisson

2012-07-10 Thread Laura Lee
I want to predict the number of turtles for different levels of effort and combinations of covariates. So, for my dataset from which I built the model, would I compare sum(predict(ZIP,type="response")) to the observed bycatch to compare numbers? In order to predict for the new data (called effort),

Re: [R] Predicted values for zero-inflated Poisson

2012-07-10 Thread Achim Zeileis
22:51:40 CEST 2012 Previous message: [R] Predicted values for zero-inflated Poisson Next message: [R] Lavaan Package - How to Extract Residuals in Data Values Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Thanks for your reply. I do have a copy of "Zero Inflated Mode

Re: [R] Predicted values for zero-inflated Poisson

2012-07-10 Thread Laura Lee
012 5:20 PM To: Lee, Laura Subject: Re: Predicted values for zero-inflated Poisson Laura Lee laura.lee at ncdenr.gov Mon Jul 9 22:51:40 CEST 2012 Previous message: [R] Predicted values for zero-inflated Poisson Next message: [R] Lavaan Package - How to Extract Residuals in Data V

Re: [R] Predicted values for zero-inflated Poisson

2012-07-09 Thread Highland Statistics Ltd
Laura Lee laura.lee at ncdenr.gov Mon Jul 9 22:51:40 CEST 2012 Previous message: [R] Predicted values for zero-inflated Poisson Next message: [R] Lavaan Package - How to Extract Residuals in Data Values Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Thanks for your

Re: [R] Predicted values for zero-inflated Poisson

2012-07-09 Thread Laura Lee
Thanks for your reply. I do have a copy of "Zero Inflated Models and Generalized Linear Mixed Models with R" and have been using that as a guide. I applied the predict function (type="count") to the dataset for which I built the model to compare the predicted bycatch numbers to the observed to ensu

Re: [R] Predicted values for zero-inflated Poisson

2012-07-09 Thread Alain Zuur
Lee, Laura wrote > > Hi all- > > I fit a zero-inflated Poisson model to model bycatch rates using an offset > term for effort. I need to apply the fitted model to a datasets of varying > levels of effort to predict the associated levels of bycatch. I am seeking > assistance as to the correct way

[R] Predicted values for zero-inflated Poisson

2012-07-09 Thread Lee, Laura
Hi all- I fit a zero-inflated Poisson model to model bycatch rates using an offset term for effort. I need to apply the fitted model to a datasets of varying levels of effort to predict the associated levels of bycatch. I am seeking assistance as to the correct way to code this. Thanks in adva

[R] predicted values of coxme model

2012-05-07 Thread allan debelle
Hello I need to use a coxme model with my data (survival analysis with right-censoring and hierarchical nesting), but I cant find a way to get predicted values from a new data table (or even from the original one). Has anyone had this problem before? I cant find anything about that anywhere. Tha

[R] Predicted values based on fixed effects do not correspond with actual data in cross-classified generalized linear mixed model (lmer)

2011-06-04 Thread Gert
Dear R-Users, I have fitted a cross-classified generalized linear mixed model using the lmer package with the following code. Mod<-lmer(y~x+(1|a)+(1|b)+ (1|c), family=binomial) In this case, only including a covariate (x) as a fixed effect. The fitted values, using fitted(mod), correspond to t

Re: [R] predicted values after fitting gamma2 function

2009-06-26 Thread David Winsemius
On Jun 25, 2009, at 11:30 PM, Steven Matthew Anderson wrote: Question: after fitting a gamma function to some data, how do I get predicted values? I'm a SAS programmer, I new R, and am having problems getting my brain to function with the concept of "object as class ...". The following i

[R] predicted values after fitting gamma2 function

2009-06-25 Thread Steven Matthew Anderson
Question: after fitting a gamma function to some data, how do I get predicted values? I'm a SAS programmer, I new R, and am having problems getting my brain to function with the concept of "object as class ...". The following is specifics of what I am doing: I'm trying to determine the pd