To find the number of seed packets Carmen needs to have a total of 18 plants in her backyard, we can use the equation provided:
\[ p = s + 2 \]
We know that \(p\) (the total number of plants) is 18. We can substitute this value into the equation:
\[ 18 = s + 2 \]
Next, we solve for \(s\):
- Subtract 2 from both sides of the equation:
\[ 18 - 2 = s \] \[ 16 = s \]
Thus, the number of seed packets Carmen needs to purchase is:
\[ \boxed{16} \]