# Longitudinal analysis of peer effect

I am working with hierarchical data (2 repeated observations on children nested within households), obtained from a RCT with 2 treatment groups. The primary goal of my analysis is to see whether the intervention had strengthened the magnitude of effect outcomes of siblings has on the outcome of a child, with a secondary goal of seeing whether the variance in outcomes within household had increased following the intervention.

1)Regarding the first I have devised the following multilevel preliminary model, though I would like to get some opinions on if it is appropriate for my research goal (lower order interactions omitted to conserve space):

$$y_{iht}=\beta_{000}+\beta_{101}*post*treat*\bar{y_{,ht}}+\beta_{010}\bar{X_{,h}}+\beta_{200}(X_{ih}-\bar{X_{,h})}+\beta_{020}Z_{h}+u_{100}+u_{010}+\epsilon_{iht}$$

where $$\bar{y_{,ht}}$$ is the average outcome of child i's siblings (so not including i's own outcome), X are baseline child characteristics centred at the household mean, Z are baseline household characteristics

If I wish to have time-varying covariates at the child level (that is not affected by the treatment), should I add them to the model as: $$\beta(X_{iht}-\bar{X_{ih,}})+\beta(\bar{X_{ih,}}-\bar{X_{,h,}})+\beta\bar{X_{,h,}}$$?

2)In regards to the secondary goal, could I split my datable into treatment and control samples, and fit each on an unconditional means mixed effects model with random intercepts for children and households, and supply the weights argument with varIdent = ~ 1 | household_id?

I apologise for the barrage of questions. Thank you so much in advance.

• What is post? Was treatment assigned at the child or family level? Commented Jun 27 at 21:29
• Dummy for the follow-up wave. Treatment was randomised at the village-level, so all members of one household unit are either in the treatment or control group. There were 45 treatment and 45 control villages, each with about 20 to 25 households that have on average 3 children on whom I have data. Commented Jun 27 at 22:13

Your proposed multilevel model for examining the effect of the intervention on sibling influence on outcomes looks OK to me. We can break down and critically evaluate each part:

Model Specification:

$$$$y_{iht} = \beta_{000} + \beta_{101} \cdot \text{post} \cdot \text{treat} \cdot \bar{y}_{,ht} + \beta_{010} \cdot \bar{X}_{,h} + \beta_{200} \cdot (X_{ih} - \bar{X}_{,h}) + \beta_{020} \cdot Z_{h} + u_{100} + u_{010} + \epsilon_{iht}$$$$

• $$\beta_{101} \cdot \text{post} \cdot \text{treat} \cdot \bar{y}_{,ht}$$: This term captures the interaction between the intervention (post-treatment), treatment group, and the average outcome of the siblings. This aligns well with your primary goal of assessing whether the intervention strengthens the effect of siblings on the child's outcome.
• $$\beta_{010} \cdot \bar{X}_{,h}$$: Including household-level covariates is appropriate for controlling household-level variability.
• $$\beta_{200} \cdot (X_{ih} - \bar{X}_{,h})$$: Child-level covariates centered around the household mean, appropriately accounting for within-household differences.
• $$\beta_{020} \cdot Z_{h}$$: Baseline household characteristics help control the variability at the household level.
• $$u_{100}$$ and $$u_{010}$$: Random intercepts for households and children, respectively, correctly account for the nested data structure.
• $$\epsilon_{iht}$$: Residual error term.

Incorporating Time-Varying Covariates:

If you wish to add time-varying covariates at the child level, your suggestion to include terms as follows is a good approach:

$$$$\beta (X_{iht} - \bar{X}_{ih}) + \beta (\bar{X}_{ih} - \bar{X}_{,h}) + \beta \bar{X}_{,h}$$$$

• $$\beta (X_{iht} - \bar{X}_{ih})$$: Time-varying covariates centered around the child's mean.
• $$\beta (\bar{X}_{ih} - \bar{X}_{,h})$$: Difference between the child's average and the household average, capturing intra-household variation over time.
• $$\beta \bar{X}_{,h}$$: Household average, capturing between-household variations.

This structure will allow you to separate the within-child, within-household, and between-household variances, aligning well with your research goals.

### Question 2: Assessing Variance in Outcomes Within Households Post-Intervention}

To analyse whether the variance in outcomes within households increased following the intervention, your suggested approach can be broken down as follows:

1. Split Data into Treatment and Control Groups:

This step allows for comparison of variances within each group separately.

2. Unconditional Means Mixed Effects Model:

Fit an unconditional means model (random intercepts only) for each group:

$$$$y_{iht} = \gamma_{00} + u_{0h} + u_{0i(h)} + \epsilon_{iht}$$$$

This model captures the variance components attributable to households and individual children.

3. Using varIdent to Model Heterogeneity:

Apply the varIdent = ~ 1 | household_id argument in your mixed-effects model:

weights = varIdent( \sim 1 | \text{household_id}


This specification allows for different variances for different households, which is what you aim to investigate.

4. Comparing Variances:

After fitting the models, compare the estimated variance components (household and residual) between the treatment and control groups. You can use likelihood ratio tests or information criteria (AIC, BIC) to statistically compare these models. Finally, do be aware that there may be other ways to model your data such as a Markov model.

• Thank you so much for your detailed breakdown. If it is ok I would like to additionally inquire about endogeneity, since the same treatment also affects each child's siblings and thus $\bar{Y_{,ht}}$ would be determined simultaneously with $Y_{iht}$. Conversely I have also read that the peer effect term has an avg. marginal effect interpretation, and it seems ok in this context. My understanding of the topic is very rudimentary so I apologise if this is completely irrelevant for my research goal, but if it indeed is of concern I should perhaps look into IV regression? Commented Jun 28 at 15:03
• You are very welcome :) I'm glad that it helped. Endogeneity is indeed a relevant concern for your model due to the simultaneous determination of both $\bar{Y_{,ht}}$ and $Y_{iht}$ . Using instrumental variables regression is a suitable approach to address this issue. By carefully selecting valid instruments, you can mitigate the bias and obtain more reliable estimates of the treatment effects. Feel free to ask another question, about that, and them ping me here and I will take a look :) Commented Jun 28 at 15:38