# How to compute the regression of individual fitness on individual phenotype

Consider a population structured in groups of two individuals. Individuals' interactions follow an additive prisoner's dilemma:

\begin{array}{c |c |c|} & C & D \\ \hline \text{Cooperate (} C \text{)} & b -c & -c \\ \hline \text{Defect (} D\text{)} & b & 0 \\ \hline \end{array} where $b$ is the benefit and $c$ is the cost. The payoffs are to the player on the left. I need to calculate the regression of individual fitness on individual phenotype, $\beta (w_i, p_i)$, where $p_i = 0$ if $i$ defects and $p_i = 1$ if $i$ cooperates. Note that I need to calculate the regression within groups rather than between groups.

I thought that the right way of calculating $\beta(w_i,p_i)$ would be to vary the strategy of the focal individual while keeping the strategy of the other individual constant (my thought was that the other individual becomes the environment for the focal individual). Because switching to cooperation causes an individual to lose $-c$ in fitness (if we keep the strategy of the other individual constant), I thought that $\beta(w_i,p_i) = -c$. But, to my surprise, $\beta(w_i,p_i) = -b -c$. To show why, McElreath & Boyd ("Mathematical Models of Social Evolution", p. 242) draw the following graph:

Let $V(X|Y)$ be the payoff of individual $X$ when it interacts with $Y$ (in other words, $X$ is the focal individual; $Y$ is the other individual). I understand that McElreath and Boyd calculated the regression coefficient by computing $V(C|D) - V(D|C)$ --- as opposed to $V(C|C) - V(D|C)$, where you keep the strategy of the other individual constant. My question is why this is the right way of calculating $\beta(w_i,p_i)$.

• I totally forgot to say what $V$ was. I fixed this now. Thanks for pointing it out. May 8, 2015 at 14:27
• If I understood your second question correctly, I want to calculate the regression of fitness on phenotype. The example only deals with two phenotypes, cooperate and defect; and the population only contain two individuals. May 8, 2015 at 14:43
• @Remi.b : I rewrote the question and added a graph explaining the example. Hope it's clearer now. May 8, 2015 at 15:24

I am not sure I understood the question. Let me know if this helps.

Case: N=2, freq=0.5

Let's assume that the frequency of those who cooperate is 0.5. The slope of the regression line (which R.squared is equal to 1 as we have as many data point than degrees of freedom) is by definition $\frac{\Delta w}{\Delta p}$. You defined $\Delta p = 1$. What is $\Delta w$ then?

Well, given that one cooperate and the other defect (as indicated in the fact that the frequency of cooperators is 0.5), then one will have the payoff of a cooperator that is facing a defector and the other one will have the payoff of a defector facing a cooperator. The cooperator has a fitness of $w_0 + b$ and the defector has a fitness of $w_0 - c$. I think you may misread the payoff matrix. To know the fitness of someone with strategy $i$ when facing someone with strategy $j$, you look that payoff at row $i$ and column $j$.

Therefore, $\Delta w = (w_0 - c) - (w_0 + b) = - (b+c) = -b - c$, and so the slope is $\frac{\Delta w}{\Delta p}=\frac{-b-c}{1} = - b -c$

Case: N>2, freq=0.5

In such case the slope of the regression will necessarily be lower than $-b-c$ because some cooperators will meet other cooperators, increasing their fitness (=highering the points on the right hand side of your graph) and some defectors will meet other defectors, decreasing their fitness (=lowering the points on the left hand side of your graph)

At equilibrium

The only stable equilibrium is when the frequency of cooperators is 0. In such case, there is no variance and we cannot even talk about regression.

Conclusion

The slope is not necessarily $-b-c$. It is $-b-c$ for the very special case where we have two individuals, one cooperate, the other one defects. In any other scenario the slope $s$ of the regression is lower. More specifically, the slope $s$ of the regression for any $N$ and for any $freq$ is $0 =< s < -( b+c)$

• In a case in which the frequency of cooperators should be 0.5, I can see why the regression coefficient has to be $-b -c$. My question arose because McElreath and Boyd derive the regression coefficient without making any assumptions of the frequency of cooperators in a group. If we assume that we can have any frequency of cooperators in a group (0, 0.5, and 1), it seems that the regression coefficient can have value $-c$. May 8, 2015 at 15:54
• I agree with you that $-b-c$ is not the slope of the regression in any case. Yes, in some cases the slope of the regression can be -c. I did not calculate the slope of the regression for any $N$ and frequency but it probably is not very hard I guess. See edit. May 8, 2015 at 17:05

Here is my mistake, I think. $w_i$ can be written in terms of $p_i$ in the following way (note that $p_i$ can only assume two values, 0 and 1):

$w_i (0) = w_0 + kb$

$w_i (1) = w_0 -c + (k-1)b$

where $w_0$ is the baseline fitness and $k$ is the number of altruists in the group (so, $k$ can be 0, 1, or 2). When we are calculating $\beta (w_i, p_i)$ the question we are trying to answer is "for a given group in the population, what is the regression coefficient $\beta (w_i, p_i)$?". This implies that $k$ must be constant because, otherwise, we would be considering individuals from different groups. Accordingly,

$\beta(w_i, p_i) = w_i(1) - w_i(0)$

$\beta (w_i, p_i) = -b -c$

For $\beta(w_i, p_i)$ to be equal to $-c$ we would need to consider the payoff of cooperators from different groups.

Following up on the equation Remi.b suggested in a comment below, we can write the regression coefficient to a population structured in groups of $n$ individuals. More specifically,

$w_i(0) = w_0 + [k/(n-1)] b$

$w_i (1) = w_0 -c + [(k-1)/(n-1)] b$

With this definitions, we get

$\beta (w_i, p_i) = w_i(1) - w_1 (0)$

$\beta (w_i, p_i) = -c - b/(n-1)$

• $b$ and $c$ doesn't have the standard definition as given by Hamilton. The fitness of an individual who cooperates is usually computed as $w_c = w_0 + x PO_{cc} + (1-x)PO_{cd}$, where $PO_{cd}$ is the payoff of an individual who cooperates when meeting an individual who defects and $x$ is the frequency of cooperators in the population. May 8, 2015 at 18:41
• My impression is that, in the example above, your equation yields $w_c = w_0 + x (b-c) + (1-x)(-c) = w_0 + xb - c$. The chance of a cooperator meeting another cooperator will be $(k-1)/(2-1)=(k-1)$, which gives the equation I wrote. Am I missing something? May 8, 2015 at 18:59