Dispersal is a key ecological process that is strongly influenced by both phenotype and environment. Here, we show that juvenile environment influences dispersal not only by shaping individual phenotypes, but also by changing the phenotypes of neighbouring conspecifics, which influence how individuals disperse. We used a model system (Tribolium castaneum, red flour beetles) to test how the past environment of dispersing individuals and their neighbours influences how they disperse in their current environment. We found that individuals dispersed especially far when exposed to a poor environment as adults if their phenotype, or even one‐third of their neighbours’ phenotypes, were shaped by a poor environment as juveniles. Juvenile environment therefore shapes dispersal both directly, by influencing phenotype, as well as indirectly, by influencing the external social environment. Thus, the juvenile environment of even a minority of individuals in a group can influence the dispersal of the entire group.

#### Raw Data from Experiment

Data of dispersal of individual red flour beetles within experimental arrays. As described in the manuscript: "We allowed populations of Tribolium castaneum to disperse across replicate linear arrays, manipulating current density (low = 18 adults, high = 90 adults), current habitat quality (low = 99.5% corn flour, 0.475% wheat flour, 0.025% brewer’s yeast; high = 98.2% corn flour, 1.71% wheat flour, 0.09% brewer’s yeast), and juvenile density (low and high) in a fully-factorial design (2 current densities x 2 current habitat qualities x 2 juvenile densities x 15–20 replicate dispersal arrays = 143 arrays). One-third of beetles within each array were experimental beetles that experienced either a low or a high juvenile density (n=18 or 90), while the remaining two-thirds of beetles were standardized beetles that experienced an intermediate juvenile density (n=40)."

Endriss&Vahsen_Dispersal_EcologyLetters_Data.csv

#### Stewart et al 2017 supporting data

This data highlights that the experimental treatments used in this experiment were biologically meaningful in terms of carrying capacity. More details can be found in the README file.

Stewart_etal_2017_All_Data_EcoEvo_Final_Data.csv

#### Ordinal Regression

Fits ordinal regression to dispersal distances for experimental and background beetles. Extracts predicted mean decumulative probabilities for some treatment combinations.

Endriss&Vahsen_OrdinalRegression.R

#### Dispersal kernel parameters model

Calculates mean, standard deviation, skew, kurtosis, and maximum for random samples of 6 individuals for each status in each array. Fits linear mixed models to these data and extracts test-statistics and p-values for models.

Endriss&Vahsen_DispersalKernelParams.R

#### Dispersal kernel parameters predicted means (mean)

Calculates mean for random samples of 6 individuals per status in each array. Fits linear mixed model to these data and extracts predicted means for some treatment combinations.

Endriss&Vahsen_DispersalKernelMeans_Mean.R

#### Dispersal kernel parameters predicted means (standard deviation and maximum)

Calculates standard deviation and maximum for random samples of 6 individuals per status in each array. Fits linear mixed model to these data and extracts predicted means for some treatment combinations.

Endriss&Vahsen_DispersalKernelMeans_SD&Max.R

#### Figure 3

Code to produce figure 3.

Endriss&Vahsen_Fig3.R

#### Predicted means from ordinal regression (DM)

Predicted means from ordinal regression model for current density by juvenile density treatment combinations.

OrdinalRegression_DM_Means.csv

#### Predicted means from ordinal regression (DH)

Predicted means from ordinal regression for current density by habitat quality treatment combinations.

OrdinalRegression_DH_Means.csv

#### Figure 4

Code to produce figure 4.

Endriss&Vahsen_Fig4.R

#### Predicted means from LMM mean dispersal

Predicted means for mean dispersal distance for current density by habitat quality and current density by juvenile density treatment combinations for experimental and background beetles.

LMM_DH_DM_Means.csv

#### Figure 5

Code to produce figure 5.

Endriss&Vahsen_Fig5.R

#### Figure S1

Code to calculate estimated carrying capacities using data from Stewart et al. 2017.

Endriss&Vahsen_FigS1.R

#### Figure S2

Plots correlation between mean distance dispersed of experimental and standardized beetles within an array for each treatment combination (Fig S2).

Endriss&Vahsen_CorrelationTest_FigS2.R

#### Predicted means from LMM (standard deviation)

Predicted means and CIs for linear mixed model of standard deviation of dispersal kernels of experimental and standardized beetles.

LMM_DM_SD.csv

#### Predicted means from LMM (maximum)

Predicted means of maximum distance linear mixed model dispersed for current density by juvenile density treatment combinations.

LMM_DM_Max.csv

#### Figure S3

Code for producing figure S3.

Endriss&Vahsen_FigS3.R

#### Predicted means from ordinal regression (JH)

Predicted means from ordinal regression for juvenile density by habitat quality treatment combinations.

OrdinalRegression_JH_Means.csv

#### Figure S4

Code to produce figure S4.

Endriss&Vahsen_FigS4.R

#### Growth Rate

Calculates average growth rate for different juvenile density treatments.

GrowthRate.R