I export plots as metadata file then open and work it into Canvas, a good software that works with vectorial images so you can change letter size, colours, almost everything but you have to decompose the image first into its components (lines, arrows, etc). I am very happy with this procedure. 
 
Dragos
 
 
 
Dragos Zaharescu
Animal Anatomy Laboratory
Faculty of Biological Sciences
Vigo University, apd. 137
36310, Vigo (Pontevedra), SPAIN
zaha_dragos@yahoo.com
zdragos@uvigo.es
 



----- Original Message ----
From: "r-sig-ecology-request@r-project.org" <r-sig-ecology-request@r-project.org>
To: r-sig-ecology@r-project.org
Sent: Saturday, May 31, 2008 12:00:01 PM
Subject: R-sig-ecology Digest, Vol 2, Issue 29

Send R-sig-ecology mailing list submissions to
    r-sig-ecology@r-project.org

To subscribe or unsubscribe via the World Wide Web, visit
    https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
or, via email, send a message with subject or body 'help' to
    r-sig-ecology-request@r-project.org

You can reach the person managing the list at
    r-sig-ecology-owner@r-project.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of R-sig-ecology digest..."


Today's Topics:

  1. Re: glm-model evaluation (Glover, Tim)
  2. On model selection and model evaluation (Manuel Sp?nola)
  3. What is RMark? (Jeff Laake)
  4. Publication quality graphics in R (Mark A. Albins)
  5. Re: Publication quality graphics in R (David Hewitt)
  6. Re: On model selection and model evaluation (David Hewitt)
  7. Re: Publication quality graphics in R (Glen A Sargeant)
  8. Re: glm-model evaluation (Kingsford Jones)
  9. Re: glm-model evaluation (Kingsford Jones)
  10. Re: Publication quality graphics in R (Krzysztof Sakrejda-Leavitt)
  11. Re: Publication quality graphics in R (Brian Knaus)
  12. Re: Publication quality graphics in R (tyler)
  13. Re: glm-model evaluation (David Hewitt)


----------------------------------------------------------------------

Message: 1
Date: Fri, 30 May 2008 08:58:36 -0400
From: "Glover, Tim" <NTGLOVER@mactec.com>
Subject: Re: [R-sig-eco] glm-model evaluation
To: <r-sig-ecology@r-project.org>
Message-ID: <99204592228B314BB5F1CCFD449B75530382E6B5@LS-E.mactec.com>
Content-Type: text/plain;    charset="US-ASCII"

Ben Bolker [bolker@ufl.edu] said:

"The reason that I (and B&A) react so strongly to the use of the word
"significance" in this context is that it's nearly impossible to prevent
people from misinterpreting it in terms of classical p-values."



This is exactly why I seldom use "significant" except in this very
precise use.  Some options I've used instead:

Notable
Noticeable
Obvious
Visible
Meaningful
Substantial
Noteworthy
Considerable
Suggestive

Hope this helps!


Tim Glover
Senior Environmental Scientist - Geochemistry 
Geoscience Department Atlanta Area 
MACTEC Engineering and Consulting, Inc.
Kennesaw, Georgia, USA
Office 770-421-3310
Fax 770-421-3486
Email ntglover@mactec.com
Web www.mactec.com



------------------------------

Message: 2
Date: Fri, 30 May 2008 09:06:17 -0600
From: Manuel Sp?nola <mspinola10@gmail.com>
Subject: [R-sig-eco] On model selection and model evaluation
To: r-sig-ecology@r-project.org
Message-ID: <484017E9.1020006@gmail.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

Dear List,

Thank you very much for your responses.
After looking at the responses I have some comments/questions.
It is my understanding that model selection is one step in data modeling 
and model evaluation need to follow after model selection.  After a 
model has been selected is necessary to evaluate the model and look at 
the parameter estimates, is that correct?  I see that many people think
that the AIC value and model averaging is the last step in data modeling 
but I am not sure if that is appropriate.  It is also my understanding 
that using IT methods you can select the best worst model of a set of 
bad models, so model evaluation is needed for your selected model.
I wrote "it is my understanding" because I am far for being an expert on 
this.
Any comments on that?
Best,

Manuel

-- 
Manuel Sp?nola, Ph.D.
Instituto Internacional en Conservaci?n y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspinola@una.ac.cr
mspinola10@gmail.com
Tel?fono: 277-3598
Fax: 237-7036



------------------------------

Message: 3
Date: Fri, 30 May 2008 09:14:35 -0700
From: Jeff Laake <Jeff.Laake@noaa.gov>
Subject: [R-sig-eco] What is RMark?
To: r-sig-ecology@r-project.org
Message-ID: <484027EB.3080002@noaa.gov>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

For those of you that may not have heard about RMark and are interested 
in mark-recapture problems, it is an R interface to the software MARK. 
It enables models to be built with formula like you do with glm rather 
than creating the design matrix by hand with the MARK interface. All of 
the model fitting is done in MARK (with mark.exe) and cannot be used 
separately from it.  That is why I have not put it on CRAN and instead 
have chosen to make it available from Evan Cooch's MARK website 
(http://www.phidot.org/software/mark/rmark/).  You can find 115 pages of
documentation in an Appendix of the Cooch and White electronic book 
available from the same website.  Also, as with most R packages RMark 
contains documentation for each function.  RMark supports most but not 
all models in MARK.  If you find that a model you want is not supported
contact me and I'll add it in.  I plan to include all of the models at 
some stage If you want help with anything in RMark, you can post here or 
to the MARK listserver also available from Evan's MARK website.

With regard to nest survival, I agree with Jessi's comment that you 
should use what works for you.  I believe Jay Rotella has a paper out 
that shows alternate ways of fitting nest survival data.  Jessi, if you
or anyone else wants to set up one of the examples (mallard or killdeer) 
that accompany RMark for nest survival with the logistic-exposure link 
function I'll include it with the package.  It would provide a nice 
tutorial for folks doing that type of work.  I work with marine mammals
so obviously  I don't do much in the way of nest survival analysis.

regards --jeff



------------------------------

Message: 4
Date: Fri, 30 May 2008 13:53:27 -0700
From: "Mark A. Albins" <albinsm@science.oregonstate.edu>
Subject: [R-sig-eco] Publication quality graphics in R
To: r-sig-ecology@r-project.org
Message-ID: <20080530135327.vu3ss8epa80w48kw@webmail.oregonstate.edu>
Content-Type: text/plain;    charset=ISO-8859-1;    DelSp="Yes";
    format="flowed"

R-sig-eco list,

This is a bit of a tangent from the current conversation, but can  
someone elaborate on
this quote from the following message,

"Plots in R come out so nicely, publication quality if you specify  
them correctly."

In particular, I'd like to hear from the list, how folks specify and  
export presentation
quality and publication quality graphics with R.  I've had problems  
when exporting
graphics using the copy-to-clipboard option (both bitmap and metafile) 
and also when
saving them as jpgs.  They almost always seem to look a little funny 
(e.g. pixelation,
symbols coming out distorted etc.).  The only option that I've had  
much success with is
saving them as pdf's, but that format is less than ideal when trying  
to incorporate a
graphic into another document (e.g. Word or Powerpoint), and is often  
not the format
requested by journals.

Any advice would be appreciated.

Thanks,

Mark

__________________________________________________

Message: 1
Date: Thu, 29 May 2008 20:21:54 -0400
From: Jessi Brown <jlbrown@unr.edu>
Subject: [R-sig-eco] AIC, R-Mark, and nest survival
To: r-sig-ecology@r-project.org
Message-ID: <483F48A2.9040906@unr.edu>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

Hi, Dave. Thanks for pointing out the merits of R-Mark as far as
generating AIC tables reflecting the results of nest survival and other
data model types.

I do indeed use R-Mark for CJS and multistate population modeling, but I
prefer the logistic exposure/"Shaffer" nest modeling paradigm for a
number of reasons. When you have something of a background in linear
models, the GLM approach is perhaps a little more intuitive than Program
MARK (but R-Mark circumvents some of that), and data preparation and
covariate handling seems to go more quickly and easily. Plots in R come
out so nicely, publication quality if you specify them correctly. Also,
there's capacity for extending the logistic-exposure models to mixed
models (which might not be a wise decision, based on violation of the
assumption that the mean of the error distribution is equal to zero, but
I digress).

I've done nest survival with both Program MARK (not R-Mark) and GLMs in
R, and it seems to me (not a biostatistician, but an ecologist who
dabbles with statistical tools), that it's ok to just go with whatever
suits your particular style. In my case, since I tend to start with (and
retain) fairly focused, restricted model suites, it doesn't bother me
much to hand construct AIC tables with the "n-effective" calculated AIC
values after having run the GLMs.

BTW, if anyone needs a script of how to set up the logistic-exposure
link function, it's among the examples in help(family).

cheers, Jessi Brown

-- 
Jessi L. Brown
Ph.D. Student, Program in Ecology, Evolution, and Conservation Biology
University of Nevada, Reno

1000 Valley Rd.
Reno, NV 89512
jlbrown@unr.edu



------------------------------

**************************************************
Mark A. Albins
Department of Zoology
Oregon State University
Corvallis, OR 97331-2914
phone:  (541) 740-7747
fax:    (541) 737-0501



------------------------------

Message: 5
Date: Fri, 30 May 2008 14:06:31 -0700 (PDT)
From: David Hewitt <dhewitt37@gmail.com>
Subject: Re: [R-sig-eco] Publication quality graphics in R
To: r-sig-ecology@r-project.org
Message-ID: <17567948.post@talk.nabble.com>
Content-Type: text/plain; charset=us-ascii




> I'd like to hear from the list, how folks specify and export presentation
> quality and publication quality graphics with R.  I've had problems 
> when exporting graphics using the copy-to-clipboard option (both bitmap
> and metafile)  
> and also when saving them as jpgs.  They almost always seem to look a
> little funny  
> (e.g. pixelation, symbols coming out distorted etc.).  The only option
> that I've had  
> much success with is saving them as pdf's, but that format is less than
> ideal when trying  
> to incorporate a graphic into another document (e.g. Word or Powerpoint),
> and is often  
> not the format requested by journals.
> 

I'd strongly recommend making the figures by writing them to files rather
than copying and pasting from the graphics device window. So, for example,
when you want a figure as a pdf you'd use "pdf(filename, options)" to open
the device with the output settings you desire, then do all your plotting
commands, then close the device with dev.off().

type ?pdf at the prompt; other devices are described in ?png

You can run the plots in the device window and then save as..., but you'll
get subtle (and sometimes not-so-subtle) differences between the window
display and the output through a device command. Once you get what you like,
then fine-tune the device options to produce the final file to be imported
to your text.

The format you use will vary depending on what you're putting it into. I've
had the most luck with PDF images rolled into LaTeX PDFs (via LyX --
www.lyx.org), although I've heard that EPS is even better for some things.
JPGs never worked well for me in anything. I gave up on M$ Office a few
years ago. Not much looks good in there.


-----
David Hewitt
Research Fishery Biologist
USGS Klamath Falls Field Station (USA)
-- 
View this message in context: http://www.nabble.com/Publication-quality-graphics-in-R-tp17567736p17567948.html
Sent from the r-sig-ecology mailing list archive at Nabble.com.



------------------------------

Message: 6
Date: Fri, 30 May 2008 14:18:25 -0700 (PDT)
From: David Hewitt <dhewitt37@gmail.com>
Subject: Re: [R-sig-eco] On model selection and model evaluation
To: r-sig-ecology@r-project.org
Message-ID: <17568122.post@talk.nabble.com>
Content-Type: text/plain; charset=us-ascii




> It is my understanding that model selection is one step in data modeling
> and model evaluation need to follow after model selection.  After a 
> model has been selected is necessary to evaluate the model and look at 
> the parameter estimates, is that correct?
> 

Of course. You model stuff because you want parameter estimates (effect
sizes). The model selection table goes hand-in-hand with the parameter
estimates and SEs in the final "analysis".

Ben et al.'s recent thread about assessing model fit covers the other part
of your question: evaluating the model.

http://www.nabble.com/glm-model-evaluation-to17525503.html



> I see that many people think 
> that the AIC value and model averaging is the last step in data modeling
> but I am not sure if that is appropriate.
> 

Model averaging is used to get model-averaged parameter estimates, so folks
are interested in the estimates if they're doing model-averaging.



> It is also my understanding that using IT methods you can select the best
> worst model of a set of 
> bad models, so model evaluation is needed for your selected model.
> 

Ditto on this. David Anderson's recent book (2007) covers all of this in
simpler terms than B&A (2002), so is a good introduction.

-----
David Hewitt
Research Fishery Biologist
USGS Klamath Falls Field Station (USA)
-- 
View this message in context: http://www.nabble.com/On-model-selection-and-model-evaluation-tp17561541p17568122.html
Sent from the r-sig-ecology mailing list archive at Nabble.com.



------------------------------

Message: 7
Date: Fri, 30 May 2008 16:55:04 -0500
From: Glen A Sargeant <gsargeant@usgs.gov>
Subject: Re: [R-sig-eco] Publication quality graphics in R
To: David Hewitt <dhewitt37@gmail.com>
Cc: r-sig-ecology-bounces@r-project.org, r-sig-ecology@r-project.org
Message-ID:
    <OF5A615797.B66DBDA7-ON86257459.00782276-86257459.00786079@usgs.gov>
Content-Type: text/plain; charset="US-ASCII"

You can exert quite a lot of control over the appearance of JPG output. 
Try inserting "lowres.jpg" and "hires.jpg" (generated by the code below) 
into a Word document and comparing the results.

foo <- function(){
plot.new()
plot.window(c(0,1),c(0,1))
plot(sin(seq(0,2*pi,0.01)),type="l",col="blue",lwd=2)
title("Example")}

jpeg("lowres.jpg",width=480,height=480)
foo()
dev.off()

jpeg("hires.jpg",width=4*480,height=4*480,pointsize=48)
foo()
dev.off()

*************************************************
Glen A. Sargeant, Ph.D.
Research Wildlife Biologist/Statistician
Northern Prairie Wildlife Research Center
8711 37th Street SE
Jamestown, ND  58401

Phone: (701) 253-5528
E-mail:  glen_sargeant@usgs.gov
FAX:    (701) 253-5553
*************************************************



David Hewitt <dhewitt37@gmail.com> 
Sent by: r-sig-ecology-bounces@r-project.org
05/30/2008 04:06 PM

To
r-sig-ecology@r-project.org
cc

Subject
Re: [R-sig-eco] Publication quality graphics in R









> I'd like to hear from the list, how folks specify and export 
presentation
> quality and publication quality graphics with R.  I've had problems 
> when exporting graphics using the copy-to-clipboard option (both bitmap
> and metafile) 
> and also when saving them as jpgs.  They almost always seem to look a
> little funny 
> (e.g. pixelation, symbols coming out distorted etc.).  The only option
> that I've had 
> much success with is saving them as pdf's, but that format is less than
> ideal when trying 
> to incorporate a graphic into another document (e.g. Word or 
Powerpoint),
> and is often 
> not the format requested by journals.
> 

I'd strongly recommend making the figures by writing them to files rather
than copying and pasting from the graphics device window. So, for example,
when you want a figure as a pdf you'd use "pdf(filename, options)" to open
the device with the output settings you desire, then do all your plotting
commands, then close the device with dev.off().

type ?pdf at the prompt; other devices are described in ?png

You can run the plots in the device window and then save as..., but you'll
get subtle (and sometimes not-so-subtle) differences between the window
display and the output through a device command. Once you get what you 
like,
then fine-tune the device options to produce the final file to be imported
to your text.

The format you use will vary depending on what you're putting it into. 
I've
had the most luck with PDF images rolled into LaTeX PDFs (via LyX --
www.lyx.org), although I've heard that EPS is even better for some things.
JPGs never worked well for me in anything. I gave up on M$ Office a few
years ago. Not much looks good in there.


-----
David Hewitt
Research Fishery Biologist
USGS Klamath Falls Field Station (USA)
-- 
View this message in context: 
http://www.nabble.com/Publication-quality-graphics-in-R-tp17567736p17567948.html

Sent from the r-sig-ecology mailing list archive at Nabble.com.

_______________________________________________
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology



------------------------------

Message: 8
Date: Fri, 30 May 2008 15:25:21 -0700
From: "Kingsford Jones" <kingsfordjones@gmail.com>
Subject: Re: [R-sig-eco] glm-model evaluation
To: r-sig-ecology@r-project.org
Message-ID:
    <2ad0cc110805301525ude74299odfbab3ded70d0059@mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1

On Thu, May 29, 2008 at 4:51 PM, David Hewitt <dhewitt37@gmail.com> wrote:
>
>> I'd add that showing predictive ability is very important if the goal of
>> the modeling process is to make predictions (and even if it's not, showing
>> predictive ability provides support for the model).  Frank Harrell has
>> tools in the Design library for efficient internal validation and
>> calibration via the bootstrap (see the 'validate' and 'calibrate'
>> functions) but these will not work on a model produced by glm.nb.  However
>> it's easy to code a cross-validation in R and I believe MASS shows a
>> 10-fold cross-validation for the CPUs example.
>>
>
> IIRC, there's a section in B&A (2002) that points out and demonstrates that
> AIC model selection has the property of being equivalent to "leave one out"
> cross-validation. It draws from an original work by Stone (197x ??). They
> also discuss more involved simulation-based (bootstrap) methods for complex
> models.
>

I think that's a different (though not unrelated) issue -- namely,
model selection.  Asymptotically, AIC is equivalent to leave-one-out
cross validation, Mallow's Cp, and some other methods for model
selection.  However I don't see using a model selection method as
equivalent to validating the predictive ability of a model.

As far as how to show predictive ability - I think that's context
dependent. Along with various quantitative measures, I've found
plotting to be useful.  For example, for each fold of a k-fold cross
validation plotting the observed vs predicted in a scatter plot, using
color to identify an important categorical variable (e.g. sex,
species, region etc.) and pch to identify another.  Or, if it's
spatial data actually mapping the RMSEs of the cross validations to
get an idea of where the model is performing  well/poorly.
Conditional plots and parallel coordinate plots can be good tools for
these types of 'validation' as well. One thing to remember -- if these
methods are used as part of the model selection process there should
be a final hold-out dataset that was never used in any way in making
modeling decisions.  This is a luxury, but if there's enough data it
can provide strong evidence for the models' predictive traits.

Kingsford


> -----
> David Hewitt
> Research Fishery Biologist
> USGS Klamath Falls Field Station (USA)
> --
> View this message in context: http://www.nabble.com/glm-model-evaluation-tp17525503p17548602.html
> Sent from the r-sig-ecology mailing list archive at Nabble.com.
>
> _______________________________________________
> R-sig-ecology mailing list
> R-sig-ecology@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
>



------------------------------

Message: 9
Date: Fri, 30 May 2008 15:32:14 -0700
From: "Kingsford Jones" <kingsfordjones@gmail.com>
Subject: Re: [R-sig-eco] glm-model evaluation
To: r-sig-ecology@r-project.org
Message-ID:
    <2ad0cc110805301532y7915715ey1f8ec6805575cce4@mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1

On Fri, May 30, 2008 at 3:25 PM, Kingsford Jones
<kingsfordjones@gmail.com> wrote:

>  Asymptotically, AIC is equivalent to leave-one-out
> cross validation, Mallow's Cp, and some other methods for model
> selection.

I forgot to qualify this -- I believe it's true for standard linear
models -- not for the negative binomial glms discussed in this threat.



Kingsford



------------------------------

Message: 10
Date: Fri, 30 May 2008 17:58:46 -0400
From: Krzysztof Sakrejda-Leavitt <krzysztof.sakrejda@gmail.com>
Subject: Re: [R-sig-eco] Publication quality graphics in R
To: r-sig-ecology@r-project.org
Message-ID: <48407896.8010702@gmail.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

Hi Mark,

I second writing to files as David says, but I have a few things to add:

- jpg is meant to encode photos, and because of the compression it uses 
it will butcher complicated text, especially if you have to re-save 
multiple times, resize the images, etc...  PNG avoids this problem but 
still compresses photo-like images nicely (say colored 3-D plots).  MS 
Office will definitely accept PNG.

- postscript is probably best for simpler figures (I think MS Office 
accepts it happily) and journals should be happy to take it (?)

- when you open the PNG/pdf/postscript device for writing an image, it 
helps to already know what size/resolution the image needs to be because 
resizing will almost certainly alter the look of text. I tend to save 
data frames for making particular figures instead of saving images for 
this reason.

- I haven't had trouble with this, but the ?postscript help page 
mentions that if you use complex symbols, you need to make sure you have 
good fonts/encodings set for them--see the encodings section on 
?postscript...

- The R wiki has some good information on preparing images.

Hope that helps,

Krzysztof



Mark A. Albins wrote:
> R-sig-eco list,
>
> This is a bit of a tangent from the current conversation, but can 
> someone elaborate on
> this quote from the following message,
>
> "Plots in R come out so nicely, publication quality if you specify 
> them correctly."
>
> In particular, I'd like to hear from the list, how folks specify and 
> export presentation
> quality and publication quality graphics with R.  I've had problems 
> when exporting
> graphics using the copy-to-clipboard option (both bitmap and metafile) 
> and also when
> saving them as jpgs.  They almost always seem to look a little funny 
> (e.g. pixelation,
> symbols coming out distorted etc.).  The only option that I've had 
> much success with is
> saving them as pdf's, but that format is less than ideal when trying 
> to incorporate a
> graphic into another document (e.g. Word or Powerpoint), and is often 
> not the format
> requested by journals.
>
> Any advice would be appreciated.
>
> Thanks,
>
> Mark
>
> __________________________________________________
>
> Message: 1
> Date: Thu, 29 May 2008 20:21:54 -0400
> From: Jessi Brown <jlbrown@unr.edu>
> Subject: [R-sig-eco] AIC, R-Mark, and nest survival
> To: r-sig-ecology@r-project.org
> Message-ID: <483F48A2.9040906@unr.edu>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> Hi, Dave. Thanks for pointing out the merits of R-Mark as far as
> generating AIC tables reflecting the results of nest survival and other
> data model types.
>
> I do indeed use R-Mark for CJS and multistate population modeling, but I
> prefer the logistic exposure/"Shaffer" nest modeling paradigm for a
> number of reasons. When you have something of a background in linear
> models, the GLM approach is perhaps a little more intuitive than Program
> MARK (but R-Mark circumvents some of that), and data preparation and
> covariate handling seems to go more quickly and easily. Plots in R come
> out so nicely, publication quality if you specify them correctly. Also,
> there's capacity for extending the logistic-exposure models to mixed
> models (which might not be a wise decision, based on violation of the
> assumption that the mean of the error distribution is equal to zero, but
> I digress).
>
> I've done nest survival with both Program MARK (not R-Mark) and GLMs in
> R, and it seems to me (not a biostatistician, but an ecologist who
> dabbles with statistical tools), that it's ok to just go with whatever
> suits your particular style. In my case, since I tend to start with (and
> retain) fairly focused, restricted model suites, it doesn't bother me
> much to hand construct AIC tables with the "n-effective" calculated AIC
> values after having run the GLMs.
>
> BTW, if anyone needs a script of how to set up the logistic-exposure
> link function, it's among the examples in help(family).
>
> cheers, Jessi Brown
>



------------------------------

Message: 11
Date: Fri, 30 May 2008 16:04:43 -0700
From: Brian Knaus <knausb@science.oregonstate.edu>
Subject: Re: [R-sig-eco] Publication quality graphics in R
To: r-sig-ecology@r-project.org
Message-ID: <20080530160443.7qquow8gcosscss4@webmail.oregonstate.edu>
Content-Type: text/plain;    charset=ISO-8859-1;    DelSp="Yes";
    format="flowed"

Hi Mark,

as previous people have stated ps and png are good options.  Another 
option is the tiff format.  In the past you had to install the Cairo 
package and use function Cairo().  As of R 2.7.0 there is now the  
function tiff() to create tiffs, it looks like the Cairo functions  
have become part of R.  Either way you need to install Cairo  
separately outside of R.  Also expect to get some interesting  
formatting issues when you create high res (300 dpi) graphics (e.g.,  
you need to scale text including axes appropriately, see: ?par).  A  
nice feature is that you can specify the graphic size in inches so use 
~7 in wide for full page or ~3.5 in wide for single column (check your 
journal's style guide).  Note that there will be some interesting  
artifacts due to your screen probably being 72 dpi, print out a copy  
before you submit it to make sure the print version looks like what  
you want (a 300 dpi image looks huge on my monitor).

I've been putting R graphics on my website to keep my committee  
informed.  If you'd like to see some examples see (everything except 
the map on the webpage is R output):

http://oregonstate.edu/~knausb/pubs/asle_aflp/asle_aflp.html

The downside of tiff is that they're big, the good side is that you  
can edit the tiff in your favorite graphics package (e.g., the GIMP).

Enjoy!

-- 
Brian J. Knaus
Ph.D. Candidate
Department of Botany and Plant Pathology
Oregon State University
2082 Cordley Hall
Corvallis, OR 97331-2902
http://oregonstate.edu/~knausb


Quoting Krzysztof Sakrejda-Leavitt <krzysztof.sakrejda@gmail.com>:

> Hi Mark,
>
> I second writing to files as David says, but I have a few things to add:
>
> - jpg is meant to encode photos, and because of the compression it uses
> it will butcher complicated text, especially if you have to re-save
> multiple times, resize the images, etc...  PNG avoids this problem but
> still compresses photo-like images nicely (say colored 3-D plots).  MS
> Office will definitely accept PNG.
>
> - postscript is probably best for simpler figures (I think MS Office
> accepts it happily) and journals should be happy to take it (?)
>
> - when you open the PNG/pdf/postscript device for writing an image, it
> helps to already know what size/resolution the image needs to be
> because resizing will almost certainly alter the look of text. I tend
> to save data frames for making particular figures instead of saving
> images for this reason.
>
> - I haven't had trouble with this, but the ?postscript help page
> mentions that if you use complex symbols, you need to make sure you
> have good fonts/encodings set for them--see the encodings section on
> ?postscript...
>
> - The R wiki has some good information on preparing images.
>
> Hope that helps,
>
> Krzysztof
>
>
>
> Mark A. Albins wrote:
>> R-sig-eco list,
>>
>> This is a bit of a tangent from the current conversation, but can  
>> someone elaborate on
>> this quote from the following message,
>>
>> "Plots in R come out so nicely, publication quality if you specify  
>> them correctly."
>>
>> In particular, I'd like to hear from the list, how folks specify  
>> and export presentation
>> quality and publication quality graphics with R.  I've had problems 
>>  when exporting
>> graphics using the copy-to-clipboard option (both bitmap and  
>> metafile) and also when
>> saving them as jpgs.  They almost always seem to look a little  
>> funny (e.g. pixelation,
>> symbols coming out distorted etc.).  The only option that I've had 
>> much success with is
>> saving them as pdf's, but that format is less than ideal when  
>> trying to incorporate a
>> graphic into another document (e.g. Word or Powerpoint), and is  
>> often not the format
>> requested by journals.
>>
>> Any advice would be appreciated.
>>
>> Thanks,
>>
>> Mark
>>
>> __________________________________________________
>>
>> Message: 1
>> Date: Thu, 29 May 2008 20:21:54 -0400
>> From: Jessi Brown <jlbrown@unr.edu>
>> Subject: [R-sig-eco] AIC, R-Mark, and nest survival
>> To: r-sig-ecology@r-project.org
>> Message-ID: <483F48A2.9040906@unr.edu>
>> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>>
>> Hi, Dave. Thanks for pointing out the merits of R-Mark as far as
>> generating AIC tables reflecting the results of nest survival and other
>> data model types.
>>
>> I do indeed use R-Mark for CJS and multistate population modeling, but I
>> prefer the logistic exposure/"Shaffer" nest modeling paradigm for a
>> number of reasons. When you have something of a background in linear
>> models, the GLM approach is perhaps a little more intuitive than Program
>> MARK (but R-Mark circumvents some of that), and data preparation and
>> covariate handling seems to go more quickly and easily. Plots in R come
>> out so nicely, publication quality if you specify them correctly. Also,
>> there's capacity for extending the logistic-exposure models to mixed
>> models (which might not be a wise decision, based on violation of the
>> assumption that the mean of the error distribution is equal to zero, but
>> I digress).
>>
>> I've done nest survival with both Program MARK (not R-Mark) and GLMs in
>> R, and it seems to me (not a biostatistician, but an ecologist who
>> dabbles with statistical tools), that it's ok to just go with whatever
>> suits your particular style. In my case, since I tend to start with (and
>> retain) fairly focused, restricted model suites, it doesn't bother me
>> much to hand construct AIC tables with the "n-effective" calculated AIC
>> values after having run the GLMs.
>>
>> BTW, if anyone needs a script of how to set up the logistic-exposure
>> link function, it's among the examples in help(family).
>>
>> cheers, Jessi Brown
>>
>
> _______________________________________________
> R-sig-ecology mailing list
> R-sig-ecology@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology



------------------------------

Message: 12
Date: Fri, 30 May 2008 22:15:49 -0300
From: tyler <tyler.smith@mail.mcgill.ca>
Subject: Re: [R-sig-eco] Publication quality graphics in R
To: r-sig-ecology@r-project.org
Message-ID: <873anzz322.fsf@blackbart.sedgenet>
Content-Type: text/plain; charset=us-ascii

"Mark A. Albins"
<albinsm@science.oregonstate.edu> writes:

>
> "Plots in R come out so nicely, publication quality if you specify  them correctly."
>
> In particular, I'd like to hear from the list, how folks specify and  export presentation
> quality and publication quality graphics with R.  

A simple way to get consistent results is to open the graphics window
with explicit dimensions, create your figure, and then copy the window
to eps:

X11(width = 2, height = 3) ## final print size will be 2" by 3"
plot(Y ~ X)
points ...

dev.copy2eps(file="...")

This way you see everything you've done, and you save copy to file in a
format that preserves all the detail. Never resize the figure by
dragging the corners at any point in processing, or you'll distort all
the proportions. This is really important if you're working with
ordinations of any kind, where the distances between points is key.

It's important to understand the differences between the different
formats. eps, ps, pdf, and wmf are all vector formats. That means they
can be reproduced with arbitrarily high or low resolution, so long as
the printer can read them properly, while remaining relatively small
files. jpg, png, tiff, bmp are all raster formats. That means they are
limited to the resolution they are created at, and if they were created
at high resolution they will be very large files.

If the printer can't deal with your eps, which is a problem I ran into,
you can convert it into a suitably high-res tiff with image editing
software like the GIMP. If you have a low-res jpg (which will look
pixelated), you can't fix it, you have to re-make it at higher res, or
in another format. Of course, you can generate high-res tiff or jpg
files to begin with, but they can be cumbersomely large to email around.

my 2 cents!

Tyler

-- 
Tired of spyware? Try Firefox:

www.firefox.com



------------------------------

Message: 13
Date: Fri, 30 May 2008 21:15:50 -0700 (PDT)
From: David Hewitt <dhewitt37@gmail.com>
Subject: Re: [R-sig-eco] glm-model evaluation
To: r-sig-ecology@r-project.org
Message-ID: <17571777.post@talk.nabble.com>
Content-Type: text/plain; charset=us-ascii


We've mostly gotten out of the area where I know enough statistically to
speak with confidence, but I'll risk some lumps anyway...

I always thought that the idea of retaining a portion of the data for
validation was a good idea. I asked David Anderson about this personally and
he said he couldn't see any reason to do that. Using likelihood, he thought
the best approach was to use all the data to determine the best model.

I'm pretty muddy on the difference between selecting a good model with AIC
(which is sometimes referred to as being predictive in nature) and what is
meant by post-hoc validation of predictive ability (aside from testing on
another data set). I've often seen the "leave-one-out" approach used to
"validate" a model. If anyone has a good reference that differentiates the
two with an example, I'd really appreciate it.



> I think that's a different (though not unrelated) issue -- namely,
> model selection.  Asymptotically, AIC is equivalent to leave-one-out
> cross validation, Mallow's Cp, and some other methods for model
> selection.  However I don't see using a model selection method as
> equivalent to validating the predictive ability of a model.
> 
> As far as how to show predictive ability - I think that's context
> dependent. Along with various quantitative measures, I've found
> plotting to be useful.  For example, for each fold of a k-fold cross
> validation plotting the observed vs predicted in a scatter plot, using
> color to identify an important categorical variable (e.g. sex,
> species, region etc.) and pch to identify another.  Or, if it's
> spatial data actually mapping the RMSEs of the cross validations to
> get an idea of where the model is performing  well/poorly.
> Conditional plots and parallel coordinate plots can be good tools for
> these types of 'validation' as well. One thing to remember -- if these
> methods are used as part of the model selection process there should
> be a final hold-out dataset that was never used in any way in making
> modeling decisions.  This is a luxury, but if there's enough data it
> can provide strong evidence for the models' predictive traits.
> 


-----
David Hewitt
Research Fishery Biologist
USGS Klamath Falls Field Station (USA)
-- 
View this message in context: http://www.nabble.com/glm-model-evaluation-tp17525503p17571777.html
Sent from the r-sig-ecology mailing list archive at Nabble.com.



------------------------------

_______________________________________________
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


End of R-sig-ecology Digest, Vol 2, Issue 29
********************************************



      
	[[alternative HTML version deleted]]

