Why predicted values are fewer that the real?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Why predicted values are fewer that the real?

LkRR
Hi

i am running a glm model family Gamma(link=log) trying to predict a vector of 1554 (real) values

Using predict() i got a vector of 950 predicted values instead of 1554.
The predictions are good though
The model doesnt take account of negative values and NAs which are only 121 values.

Any clue?

Thank
Reply | Threaded
Open this post in threaded view
|

Re: Why predicted values are fewer that the real?

Sarah Goslee
Hi,

On Fri, Mar 2, 2012 at 11:19 AM, labbig <[hidden email]> wrote:

> Hi
>
> i am running a glm model family Gamma(link=log) trying to predict a vector
> of 1554 (real) values
>
> Using predict() i got a vector of 950 predicted values instead of 1554.
> The predictions are good though
> The model doesnt take account of negative values and NAs which are only 121
> values.
>
> Any clue?

To have a clue, we need far more information than you've provided, possibly
even the reproducible example requested in the posting guide.

> Thank
>
> --
> View this message in context: http://r.789695.n4.nabble.com/Why-predicted-values-are-fewer-that-the-real-tp4438912p4438912.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



--
Sarah Goslee
http://www.functionaldiversity.org

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Why predicted values are fewer that the real?

Richard M. Heiberger
In reply to this post by LkRR
try using glm(...,na.action=na.exclude)

See ?na.exclude

for the explanation

On Fri, Mar 2, 2012 at 11:19 AM, labbig <[hidden email]> wrote:

> Hi
>
> i am running a glm model family Gamma(link=log) trying to predict a vector
> of 1554 (real) values
>
> Using predict() i got a vector of 950 predicted values instead of 1554.
> The predictions are good though
> The model doesnt take account of negative values and NAs which are only 121
> values.
>
> Any clue?
>
> Thank
>
> --
> View this message in context:
> http://r.789695.n4.nabble.com/Why-predicted-values-are-fewer-that-the-real-tp4438912p4438912.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html<http://www.r-project.org/posting-guide.html>
> and provide commented, minimal, self-contained, reproducible code.
>

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Why predicted values are fewer that the real?

David Winsemius
In reply to this post by LkRR

On Mar 2, 2012, at 11:19 AM, labbig wrote:

> Hi
>
> i am running a glm model family Gamma(link=log) trying to predict a  
> vector
> of 1554 (real) values
>
> Using predict() i got a vector of 950 predicted values instead of  
> 1554.
> The predictions are good though
> The model doesnt take account of negative values and NAs which are  
> only 121
> values.

Taking the logs of negative numbers?

> Any clue?

I see a couple of possibilities.

> View this message in context: http://r.789695.n4.nabble.com/Why-predicted-values-are-fewer-that-the-real-tp4438912p4438912.html
> Sent from the R help mailing list archive at Nabble.com.

--
David Winsemius, MD
West Hartford, CT

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.