Push notifications in R!

Despite its great litany of flaws, I love R. I love it super-hard. One of the best things about it is that people are always making weird packages that solve your problems; one of the annoying things is that you tend to find them just after they’d have been really useful, and that maybe they solve only a part of the problem. But it’s the beauty of open-source software: people make solutions to particular problems they have, and then they put in the work to make that available to the rest of us.

Anyway, one of my gripes over the course of my studies has been that you can’t really run anything in the background in R while you continue to work on another section of code: a lot of the statistical models I’ve been running use MCMCglmm, which is an amazing package but can be pretty time-intensive. Furthermore, my computer at work wasn’t really up to much, so quite often I couldn’t even work on any writing while my analysis was running. In all honesty, I should have looked harder at the options for running R in the cloud (e.g. on Amazon or Domino), but what I really wanted was just something that would give me a little notification when the analysis was done: that way, I could go off and work on something else until the results were ready for me to look at. As it was, there was a lot of clicking back and forth between windows and getting massively frustrated (or going away for half an hour, only to come back and find that I’d specified something incorrectly and it had failed within 10 seconds and needed to be restarted!).

Enter Brian Connelly‘s new package, PushoverR!

PushoverR takes advantage of the Pushover API, a service that receives messages from an application and sends them out to specified devices. Connelly has created this package so that Pushover receives a message from R, and communicates this to your iPhone or Android device. It’s really easy to set up, so here’s how to get started:

First, you need to sign up for a Pushover account. Head on over to Pushover, and register your email address. You’ll then get your user key (important information number 1!). After confirmation, you need to register your application – in this case, R! Here’s how I set up mine:

pushover_app

Once this is done, you’ll get an application token (important information number 2!). Now, you need to install ‘Pushover’ on your client device – this costs about £3, and is available from the App Store or Google Play:

photo 2

Now, we’re ready to go! Fire up your favourite R development environment (which should be RStudio, unless you’re a MORON), and get the relevant library installed and called up:

############## Libraries ############
 
install.packages("pushoverr")
library(pushoverr)

Now, it’s a good idea to set up variables to hold your user ID and application token so that you don’t have to keep pasting them for any message you want to send. To protect myself from anyone here sending me messages to my phone, I’ve replaced the actual tokens with some nonsense:

############## My settings ###########
 
userID <- "u5schwarzenegger"
appToken <- "a1dontdisturbmyfriendhesdeadtired"

Anyway, we’re now ready to run some analysis – given that my time-consuming code tends to run via MCMCglmm, I’m just going to copy one of the examples given in Jarrod Hadfield’s excellent documentation. Then I’m going to send a simple message to myself that tells me when the analysis is complete; you could, of course, send some of the results in the message, but for now let’s stick to a very basic notification:

############ Run something ##########
 
library(MCMCglmm)
 
data(BTdata)
 
prior.m3a.4 = list(R = list(V = diag(1), nu = 0.002), 
                   G = list(G1 = list(V = diag(3) * 0.02, 
                                      nu = 4), 
                            G2 = list(V = 1, nu = 0.002)))
 
m3a.4 <- MCMCglmm(tarsus ~ sex, 
                  random = ~us(sex):dam + 
                    fosternest, 
                  data = BTdata, 
                  verbose = FALSE, 
                  prior = prior.m3a.4)
summary(m3a.4)
 
msg <- "Analysis complete"
 
## Send message
pushover(message = msg, 
         user = userID, 
         token = appToken)

We can set this to execute, and – while it runs – go and do something better, like watch youtube vidoes of Arnie violencing up some guys and then zinging their corpses. BLAM

Anyway. What do you know – my phone popped up with a little message!

photo 1

SWEET.

This is the very basic functionality of PushoverR – check out Brian’s ‘Readme‘ file for some more details of little extra bits. All of the info here was basically taken from that document, but I’ve added some pictures to make it more fun.

Let’s have another Arnie video as well.

Advertisement

Understanding 3-way interactions between continuous variables

A recurrent problem I’ve found when analysing my data is that of trying to interpret 3-way interactions in multiple regression models. As always, the mantra of PLOT YOUR DATA* holds true: ggplot2 is particularly helpful for this type of visualisation, especially using facets (I will cover this in a later post). Easier said than done, though, when all three predictor variables are continuous. How do interactions between continuous variables work, and how can we plot them?

First, let’s think of a simple example: consider a response such as the time a person takes to run 100m. We might expect that height would have a significant effect, with taller people covering the ground more quickly. A continuous by continuous interaction (two-way) would mean that the effect of height on 100m time depends on another continuous variable – for example, weight. A significant height x weight interaction would mean that the slope of height on 100m time changes as weight changes: the effect of height might be mitigated at heavier weights. Already, this is getting a little tricky to visualise in your head, so what about when we add in another predictor (e.g. age, resting heart rate, volume of beer** consumed the night before, that kind of thing)?

var_runners

Some quick googling brings up a nice resource from the Institute for Digital Research and Education at UCLA, showing how to visualise three-way interactions between continuous variables using the statistical software Stata. However, I don’t want to use Stata. I want to use R. Just like you probably do. And if you don’t probably do, you should definitely do, and if you don’t now definitely do, you should probably leave. I think. Anyway, I decided that I would take their example and convert it to R so that we can follow along. Hooray for me!

I said, HOORAY FOR ME.

Ok, so we’re going to use a simple approach to explain a three-way interaction: computing the slopes of the dependent variable (e.g. 100m time) on the independent variable (e.g. height) when moderator variables (e.g. weight and last night’s beer volume) are held constant at different combinations of high and low values. Basically, this would show the effect of height on 100m time at these combinations:

  • Heavy weight, much beer
  • Heavy weight, little beer
  • Light weight, much beer
  • Light weight, little beer

Simple, huh? Let’s take a look at the model formula, where Y is the response variable (100m time), X the predictor (height), and Z and W being the moderators (weight, last night’s beer volume):

Y = b0 + b1X + b2Z + b3W + b4XZ + b5XW + b6ZW + b7XZW

This can be reordered into two groups: the first defines the intercept (terms that do not contain X), and the second defines the simple slope (terms that do contain X):

Y = (b0 + b2Z + b3W + b6ZW) + (b1 + b4Z + b5W + b7ZW)X

We can define high values of Z and W as being one standard deviation above their respective means and will denote them as zH and wH; the low values are one standard deviation below their means (zL and wL). As in the example I gave above, this gives 4 possible combinations: zHwH, zHwL, zLwH, zLwL. As an example, here is the formula when both Z and W are at high values:

simple slope 1 = b1 + b4zH + b5wH + b7zHwH

intercept 1 = b0 + b2zH + b3wH + b6zHwH

I’m going to use the same data set given in the example that I’m converting, and you can find the Stata file here. Don’t worry, we can convert this to R data format easily enough with the R package ‘foreign’:

library(foreign)
hsb2 <- read.dta("hsb2.dta")

As we’re not really concerned with the innards of this data set (yes, I’m afraid it’s not really the effect on running time of height, weight and beer consumption), let’s rename the variables that we’ll be using to Y, X, Z and W:

colnames(hsb2)[c(8,7,9,10)] <- c("y","x","z","w")

IT’S TIME TO REGRESS!

lm.hsb2 <- lm(y ~ x*z*w, data = hsb2)
summary(lm.hsb2)

…giving the following output:

Residuals:
     Min       1Q   Median       3Q      Max 
-20.0432  -4.8576   0.6129   4.0728  17.6322 
 
Coefficients:
              Estimate Std. Error t value Pr(>|t|)  
(Intercept)  1.665e+02  9.313e+01   1.788   0.0753 .
x           -3.014e+00  1.803e+00  -1.672   0.0962 .
z           -3.228e+00  1.926e+00  -1.676   0.0954 .
w           -2.435e+00  1.757e+00  -1.386   0.1674  
x:z          7.375e-02  3.590e-02   2.054   0.0413 *
x:w          5.531e-02  3.252e-02   1.701   0.0906 .
z:w          6.111e-02  3.503e-02   1.745   0.0827 .
x:z:w       -1.256e-03  6.277e-04  -2.001   0.0468 *
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
 
Residual standard error: 6.896 on 192 degrees of freedom
Multiple R-squared:  0.4893,	Adjusted R-squared:  0.4707 
F-statistic: 26.28 on 7 and 192 DF,  p-value: < 2.2e-16

You can see that the three-way interaction between the continuous variables (i.e., X:Z:W) is ‘significant’, just about. Let’s save any grousing about p-values for another day, shall we? Also, I would normally centre and standardise these types of continuous predictor variables before regression (see Gelman 2007, Gelman & Hill 2007, or Schielzeth 2010 for more details on why), but in this case I’m just converting code from a given example so we’ll take things at face value…

The next thing I want to do is to create the slope and intercept values for our 4 combinations of values (high Z + high W, high Z + low W, etc). I use the original data to create high and low values for Z and W (mean plus/minus one standard deviation), then use coefficients from the linear regression to compute the intercepts and slopes:

## High / low for w and z
zH <- mean(hsb2$z) + sd(hsb2$z)
zL <- mean(hsb2$z) - sd(hsb2$z)
wH <- mean(hsb2$w) + sd(hsb2$w)
wL <- mean(hsb2$w) - sd(hsb2$w)
 
## Get coefficients from regression
coefs.hsb2 <- coef(lm.hsb2)
coef.int <- coefs.hsb2["(Intercept)"]
coef.x <- coefs.hsb2["x"]
coef.z <- coefs.hsb2["z"]
coef.w <- coefs.hsb2["w"]
coef.xz <- coefs.hsb2["x:z"]
coef.xw <- coefs.hsb2["x:w"]
coef.zw <- coefs.hsb2["z:w"]
coef.xzw <- coefs.hsb2["x:z:w"]
 
## Create slopes
zHwH <- coef.x + zH*coef.xz + wH*coef.xw + zH*wH*coef.xzw
zHwL <- coef.x + zH*coef.xz + wL*coef.xw + zH*wL*coef.xzw
zLwH <- coef.x + zL*coef.xz + wH*coef.xw + zL*wH*coef.xzw
zLwL <- coef.x + zL*coef.xz + wL*coef.xw + zL*wL*coef.xzw
 
## Create intercepts
i.zHwH <- coef.int + zH*coef.z + wH*coef.w + zH*wH*coef.zw
i.zHwL <- coef.int + zH*coef.z + wL*coef.w + zH*wL*coef.zw
i.zLwH <- coef.int + zL*coef.z + wH*coef.w + zL*wH*coef.zw
i.zLwL <- coef.int + zL*coef.z + wL*coef.w + zL*wL*coef.zw

Now, I want to create a data frame that uses these intercepts and slopes to ‘predict’ lines: because I know that the lines are going to be straight, I simply compute the value of Y for the minimum and maximum values of X for each Z:W combination. I’m pretty sure it can be done with far less code than I’ve used here, but there you go:

## a set of values of x
x0 <- seq(min(hsb2$x), max(hsb2$x), length.out = 2)
 
df.HH <- data.frame(x0 = x0)
df.HH$y0 <- i.zHwH + df.HH$x0*zHwH
df.HH$type <- rep("zHwH", nrow(df.HH))
 
df.HL <- data.frame(x0 = x0)
df.HL$y0 <- i.zHwL + df.HL$x0*zHwL
df.HL$type <- rep("zHwL", nrow(df.HL))
 
df.LH <- data.frame(x0 = x0)
df.LH$y0 <- i.zLwH + df.LH$x0*zLwH
df.LH$type <- rep("zLwH", nrow(df.LH))
 
df.LL <- data.frame(x0 = x0)
df.LL$y0 <- i.zLwL + df.LL$x0*zLwL
df.LL$type <- rep("zLwL", nrow(df.LL))
 
## Create final data frame
df.pred <- rbind(df.HH, df.HL, df.LH, df.LL)
 
## Remove unnecessary data frames
rm(df.HH, df.HL, df.LH, df.LL)

Now, it’s time to plot the data! I’ve used ggplot2, and specified different colours and line types for each of our 4 combinations: red denotes high Z-value, and solid line denotes high W-value. I’ve also plotted the original data over the top:

## Call library
library(ggplot2)
 
## Convert 'type' to factor
df.pred$type <- factor(df.pred$type)
 
## Draw plot
ggplot(df.pred, aes(x = x0,
                    y = y0)) +
  geom_line(aes(colour = type,
                linetype = type)) +
  geom_jitter(data = hsb2, 
            aes(x = x,
                y = y),
             size = 3,
             alpha = 0.7) + 
  theme_bw() +
  theme(panel.background = element_rect(fill="ivory")) +
  theme(legend.key = element_blank()) +
  theme(text = element_text(size = 15)) +
  scale_colour_manual(name = "Partial effect",
                      labels = c("High z High w", 
                                 "High z Low w", 
                                 "Low z High w", 
                                 "Low z Low w"),
                      values = c("#E41A1C", 
                                 "#E41A1C", 
                                 "#377EB8", 
                                 "#377EB8")) +   
  scale_linetype_manual(name = "Partial effect",
                     labels = c("High z High w", 
                                "High z Low w", 
                                "Low z High w", 
                                "Low z Low w"),
                     values = c("solid", 
                                "longdash", 
                                "solid", 
                                "longdash"))

The finished article:

gg_ints

Clearly, three of the slopes are very similar (differing mostly in terms of intercept), while one is very different to the rest. The relationship between Y and X is changed dramatically when there are high values of Z in combination with low values of W. It can still be hard to grasp these in abstract terms, so let’s refer back to my initial example (just for ‘fun’): this would mean that when weight is high [Z] and beer consumption is low [W], there is a steep relationship between height [X] and running time [Y]: short, heavy teetotallers are slow, but tall, heavy teetotallers are really fast.

Remember, these lines are theoretical, and drawn from the regression coefficients rather than the data itself; it’s up to you to make sure that short, heavy teetotallers are represented within your data set. I, for one, drink quite a lot of beer.

—-

Want to know more about understanding and visualising interactions in multiple linear regression? Check out my follow-up posts:

Using ‘small multiples’ to visualise 3-way interactions between 1 continuous and 2 categorical variables

Three-way interactions between 2 continuous and 1 categorical variable

—-

* My supervisor calls this the ‘ADF method’, as in ‘ANY DAMN FOOL (can see what’s happening if you just actually plot your data)’

** I originally had beer count, but my esteemed colleague Lilly Herridge (who knows what she is talking about much more than I do) pointed out that counts are discrete, not continuous, hence the change to volume. SMARTS.

Code in this post was adapted from the UCLA Statistical Consulting Group’s page on three-way continuous interactions, and highlighted using inside-R’s ‘Pretty-R‘ tool.

Marlene Zuk and her famously shy crickets

We managed to pull off a bit of a coup at Breaking Bio (again!), having snagged Professor Marlene Zuk to chat with us about her popular science writing, research on rapid evolution, and – of course – crickets! Thanks to Bug Girl’s slot over at Wired Blogs, you can also read more there, or simply watch the podcast below. Remember, if you don’t want to see our faces, subscribe to the podcast via iTunes!

And, if you want to see the kind of selection pressures that are causing the spread of the silent-wing mutation in these crickets, check out the video below (courtesy of Nathan Bailey):

Best pics of 2013

I should really write a little note for each of these, but I have a thesis to write… so, maybe I’ll come back to this post in March? Anyway, here are my best / favourite (not necessarily the same thing) photos that I have taken this year. It’s a bit overloaded, but I suppose that comes with a year of going to Borneo and buying a load of new camera equipment… you can see more fruits of my camera-based labour over on my flickr page as well. Click on the images below to enlarge!

Light reading: Reports of the selfish gene’s death have been greatly exaggerated…

A popular science article getting a lot of attention right now is journalist David Dobbs’ latest offering, ‘Die, Selfish Gene, Die‘. There are a few things that don’t sit quite right with me, but I don’t feel qualified enough (or with the requisite time to read up enough on it) to comment in detail (although comments from people I know and whose opinion I respect include ‘wrong’ and ‘thoroughly terrible‘). One general problem with this type of article is that there have to be some ‘controversial’ statements to pique the reader’s interest; here, even the sub-heading claims that the content will overturn the central idea of Richard Dawkins’ famous book:

The selfish gene is one of the most successful science metaphors ever invented. Unfortunately, it’s wrong.

Dawkins has responded to this ‘adversarial journalism’ on his own blog; meanwhile, Jerry Coyne at ‘Why Evolution is True’ has written two lengthy pieces which go into rather more detail on the science:

Part 1

Part 2

Dobbs himself has written another two posts on the subject on his own blog, the first being a ‘clarification’ of his original piece. The second is a more direct response to Coyne’s writing. PZ Myers has also weighed in on Dobbs’ side, expanding on the science while claiming that pushback is from ‘people who don’t quite get the concept‘.

It’s worth reading all these to get a feel for the different ideas flying around, although reading ‘The Selfish Gene’ itself (or Dawkins’ later book, ‘The Extended Phenotype’) should be on your xmas list if you don’t own them already.

I also tried to follow a twitter conversation between the likes of Richard Lenski, Razib Khan, Josh Witten, Karen James, Emily Willingham, Joel McGlothlin, Aylwyn Scally… among others… but it all got a bit too intense for me! Hopefully someone will gather those tweets together under one internet roof, but that someone certainly isn’t going to be me.

I’m pretty sure we haven’t heard the last of this, so I’ll try to keep adding links as I find them…

ps yes, ‘light reading’ is supposed to be sarcastic.

Update: 15/12/13

It wouldn’t be a scientific debate on Twitter without a blaze of capslock hulkspeak. SMASH LINK TO READ

‘Die, Selfish Gene, Die’ has evolved: David Dobbs has, rather wonderfully, published a revised version of his article. While I’m sure many will still take issue with the ideas contained within it, it’s fantastic that he has taken all of the criticism and comments onboard and updated his article. The original version still exists online, and I’ve changed the link at the top of this post so that it is linked there. There is also another (!) version of the revised article with links inserted by Dobbs to show his sources.

Finally (for today, at least), I just saw a great post by Sergio Graziosi on the whole affair, discussing both the public understanding of evolution and the technical points of Dobbs’ article. It’s well worth a read.

Web miscellany, 01/12/13

Lab website

LFB

After much prompting and haranguing from yours truly, my supervisor has finally given in and set up a website. This means that the lab now has some online presence that isn’t just me going on about insect humping. The site is in its infancy just now, but head on over to lucbussiere.com to read about our research and various activities (most of which seem to involve going to the pub, but maybe this is a good way to attract future lab members?!). One of our latest ventures is to cover relevant classic papers in lab meetings (which are held in the pub, because SCOTLAND), then write up summaries for the website – if you’re interested in sexual selection and life history evolution, it might well be worth keeping an eye on that…

Breaking Bio

bb

Breaking Bio, the podcast that I co-host with a bunch of other similarly misguided fools, now has a Facebook page! You can ‘like’ us on there to keep up to date with new episodes and other fun stuff, or you can just follow us on Twitter if ‘liking’ implies a preference that you may not have. I’m trying to get stuck into the signalling reliability literature, so don’t make this harder for me.

Speaking of the podcast, we recently achieved the milestone of our 50th episode, and managed to attract a pretty incredible guest to come and speak to us: award-winning author and science journalist, David Quammen! We recorded a special double-length episode, which I’ll pretend was what we meant to do and not just that we forgot to check the time because David is super-interesting and incredibly nice. He is a delight. You can get the podcast on iTunes, or watch these episodes embedded below:

What the fox says

Since hearing the awesome ‘What Does the Fox Say?’ track by Ylvis, I have been planning to make time to investigate the literature and write a post on communication in Vulpes vulpes. Of course, having a thesis to write has got in the way a little, so I was relieved to find that the folks over at Popular Science are on it.

If you don’t know what I’m talking about, you should probably watch this:

Bizarre social media list

For some reason, my Google+ page has been featured on the ‘99 Google+ pages every PhD candidate should follow‘ list, compiled by OnlinePhDProgram.org. I very rarely post anything there, mainly due to the fact that it was another thing to take care of and resulted in pretty much no links to my blog ever. Now I feel like I should post stuff to it. I don’t know. It’s weird.

I will celebrate with the very topical ‘Plus Ones’ by Okkervil River:

I have new pets

First up is our new Extatosoma tiaratum stick insect, named Lieutenant Commander CHOMP!

chomp

I also just came into possession of four Creobroter gemmatus mantis nymphs, which are making short work of my Drosophila supplies…

mantiseat

In other animal-photo news, I think I’ve pretty much completed my Borneo collection! Have a look at them here, and feel free to ID anything (especially insects / spiders) in the comments…

I have had a moustache

moustachesandcats

I should probably mention that this wasn’t just for making Freddie Mercury lookalike photos, but for Movember (raising money for research into and awareness of men’s health problems, including prostate and testicular cancer). Our moustachioed team at Stirling Uni raised over £400 through sponsorship and manly things like bake sales.

Fungal excitement

I am continuing to make extremely slow progress in sorting through the thousands of photos that I took in Borneo over the summer, but thought I would highlight something I found on a walk in Danum Valley that made me extremely excited… In fact, I’d go as far as to say that I’ve never emitted a squeal of delight upon seeing a fungus before.

cordyceps

This wasp has been killed by a species of Cordyceps, a genus comprising several hundred species of fungi that are pathogens of arthropods and, indeed, other fungi (see Tommy Leung’s Daily Parasite post on the rather meta Cordyceps that infects / hijacks other Cordyceps). The stalks that you can see in the picture belong to the fungus – they have sprouted out of this unfortunate insect’s body, killing it and then raining down spores of doom to infect future hosts. Which is AWESOME.

According to the cordyceps.us website, active research is underway to find Cordyceps candidates for biological control of pest insects, which is very cool; however, the majority of us will most likely know of these guys from their featuring appearance in David Attenborough’s BBC series ‘Planet Earth’, or perhaps from their role as the harbinger of zombie apocalypse in the recent video game ‘The Last of Us’.

If you are interested in the latter, good news! We had official zombie ant expert David Hughes on our podcast recently, discussing his research and also his role as media zombie advisor-in-chief, having worked not only with the creators of ‘The Last of Us’, but also with the makers of the recent film ‘World War Z’. While I couldn’t make that episode, David was kind enough to identify the species above from my photograph as Ophiocordyceps humberti.

Alternatively, you can treat yourselves to the short clip from ‘Planet Earth’, proving once again that if there’s a weird nature story out there, there’s probably an Att for that.

I SMELL A MEME COMING ON

AFT_cordyceps_fin

UPDATE

Obviously, that meme didn’t catch on, but I was invited to add my photo to a flickr group dedicated to collecting photos of fungi that kill insects and spiders, using them as a substrate… so check out a load of such images at ‘Entomopathogenic fungi‘.

Photography, and new pets

As my thesis is making me indescribably miserable, here’s a brief interlude for something more fun: my new pets! I have some delightful new creatures in my home, which are helping to stop me from slowly trying to paper-cut my wrists open with Gelman & Hill (2006).

The addition of these new pets are also borne of my burgeoning interest in invertebrate macro photography, a terribly clichéd manoeuvre that seems to affect nearly everybody who works with very small animals. I have been a little obsessed with the work of photographers such as Alex Wild and Piotr Naskrecki for some time, but it was really during the planning of my recent trip to Borneo that I decided to do some more investigation as to how it all worked.

Thus began my descent into a strange world where people speak in reverent yet frantic tones about depth of field, where light diffusion is discussed ad nauseum, where lenses are put on backwards or moved away from the camera body with tubes and bellows, where expensive electronics are combined with milk cartons, with sellotape, with pringles cans… but I digress. My new houseguests are fantastically exciting and charismatic, but they are also tiny, which makes them ideally suited to my attempts to continue with this hobby as the clammy grip of the Scottish climate begins to tighten. Inspired by the incredible photos of Thomas Shahan, I recently purchased a little duo of jumping spiders, of the species Phidippus regius. Given such a species title, they require suitably regal names, so please meet Boadicea and Prasutagus:

Boadicea

Prasutagus

By a stroke of good fortunate, I also received some Plexippus petersi babies from the very awesome Emily Burdfield-Steel; they are some tinily photogenic little scamps themselves:

It is early days yet, but I hope to amass some nice shots of all of these, and – with luck, patience, trepidation, and possibly a paintbrush to help prise them apart if things get ugly – to breed P. regius as well. You know what that means: spider porn.

I can’t wait.

Oh, and don’t worry: original small pet Professor Furious is still alive and well, and is making himself available for photoshoots. I also just found out that we are rescuing some unwanted stick insects in the near future, so I shall soon be blessed with an embarrassment of tiny riches!

But, for now, I must return to my books. These wrists won’t slowly gouge themselves.

#ESEB2013: my poster (with all-new title and abstract…!)

I’ve just uploaded my poster to the ESEB website, so I thought I’d share it on here as well. In what I hope isn’t a flaw confined solely to myself, the title and abstract are now a little different from what I submitted way back when at the registration stage…! In fact, I ended up chucking out a lot of what I originally had on the poster, so it’s even more different now. I’ll try to put the bonus figures on here later if I get a chance. For now, I’ve put the abstract underneath the image of my poster below, in case anyone’s interested.

Click on the poster to have a look at the PDF, or alternatively just accost me in Lisbon – I’m particularly keen to talk to anyone who might be able to help me work out how to apply van de Pol and Verhulst’s work on age-dependent traits to my data, or who wants to discuss problems of age-dependent behavioural traits (and preferences?!), and also anyone who thinks they might want to employ me once I finish my PhD (well, it’s worth a shot, right?).

I’ll be hanging around my poster in the ‘Phenotypic plasticity’ symposium on Tuesday’s poster session, and otherwise will be around, being excited about all the awesome science, and more than happy to chat to anyone about insect sex, going to Borneo, or even…

esebposter

You can leave your ‘too much text!’ comments at home, though. I already know.

Does phenotypic plasticity undermine the reliability of sexual advertisement or help sustain adaptive mate choice?

Exaggerated sexual traits can provide information to females about male performance, even if the precise alleles that confer high performance change along with environmental conditions. This plasticity in signalling may help to preserve genetic variation that would otherwise be eroded by strong mate choice, but it can also compromise signal reliability if environmental conditions change during development. We manipulated resource acquisition by altering the diet quality of inbred lines of decorated crickets (Gryllodes sigillatus) at both juvenile and adult stages. This allowed us to study both the effect of diet quality and a change in environment during development on trait expression. We measured a number of sexually and naturally selected traits in both sexes, revealing striking differences across diets in the expression of morphological and behavioural traits. We then assessed the reliability with which various traits signalled resource acquisition by assessing their genetic variance, as well as the covariance between traits and across environments. Our results show that traits such as body weight and calling effort, the male sexual advertisement trait, are more sensitive to environmental effects than morphological traits that are fixed at eclosion. We also show that there are high genetic correlations between the expression of lifetime calling effort in different environments. Females assess males based on current advertisement levels, rather than on a lifetime total; as an individual’s condition will mediate investment in current and future advertisement, age-dependent changes in condition can further obscure the relationship between genotype and phenotype. Genetic correlations between single measures of calling effort across environments for different age groups, and across age groups within environments, were low and even changed sign between timepoints. Variation in calling effort caused by age and environmental heterogeneity should help maintain genetic variation in sexually-selected signals, but plasticity in such complex, behavioural trait presents problems for their origin and persistence under models of good-genes mate choice.