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 to code this. > > > --- > Just use the function zeroinfl from the pscl package...fit your > model...extract the estimated parameters, specify a data frame with > variables for which you want to make predictions (including values for > your offset), use model.matrix to convert it into the correct format and > calculate your fitted values. > > You can also use the function predict. > > You can either predict the binary (pi) and count parts (mu), or the > predicted values for the ZIP ((1-pi)*mu)..or better...both. > > > For detailed examples and code see: > > Zero Inflated Models and Generalized Linear Mixed Models with R. (2012) > Zuur, Saveliev, Ieno. > > http://www.highstat.com/book4.htm > > > Alain > > -- > > Dr. Alain F. Zuur > First author of: > > 1. Analysing Ecological Data (2007). > Zuur, AF, Ieno, EN and Smith, GM. Springer. 680 p. > URL: www.springer.com/0-387-45967-7 > > > 2. Mixed effects models and extensions in ecology with R. (2009). > Zuur, AF, Ieno, EN, Walker, N, Saveliev, AA, and Smith, GM. Springer. > http://www.springer.com/life+sci/ecology/book/978-0-387-87457-9 > > > 3. A Beginner's Guide to R (2009). > Zuur, AF, Ieno, EN, Meesters, EHWG. Springer > http://www.springer.com/statistics/computational/book/978-0-387-93836-3 > > > 4. Zero Inflated Models and Generalized Linear Mixed Models with R. (2012) > Zuur, Saveliev, Ieno. > http://www.highstat.com/book4.htm > > Other books: http://www.highstat.com/books.htm > > > Statistical consultancy, courses, data analysis and software > Highland Statistics Ltd. > 6 Laverock road > UK - AB41 6FN Newburgh > Tel: 0044 1358 788177 > Email: highs...@highstat.com > URL: www.highstat.com > URL: www.brodgar.com > > > > > Thanks in advance! > > Laura > > > > > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help@ 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. >
----- Dr. Alain F. Zuur First author of: 1. Analysing Ecological Data (2007). Zuur, AF, Ieno, EN and Smith, GM. Springer. 680 p. URL: www.springer.com/0-387-45967-7 2. Mixed effects models and extensions in ecology with R. (2009). Zuur, AF, Ieno, EN, Walker, N, Saveliev, AA, and Smith, GM. Springer. http://www.springer.com/life+sci/ecology/book/978-0-387-87457-9 3. A Beginner's Guide to R (2009). Zuur, AF, Ieno, EN, Meesters, EHWG. Springer http://www.springer.com/statistics/computational/book/978-0-387-93836-3 Other books: http://www.highstat.com/books.htm Statistical consultancy, courses, data analysis and software Highland Statistics Ltd. 6 Laverock road UK - AB41 6FN Newburgh Tel: 0044 1358 788177 Email: highs...@highstat.com URL: www.highstat.com URL: www.brodgar.com -- View this message in context: http://r.789695.n4.nabble.com/Predicted-values-for-zero-inflated-Poisson-tp4635861p4635898.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help@r-project.org 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.