0
$\begingroup$

I am using the R mediate package to look at mechanisms of change in a cluster randomized controlled trial. My code looks somewhat like this:

model.m <- lm(efficacy_C3 ~ TrialArm +  Age_CT1a + female +rural  + married  +Work1_CT1a + GrantIncomeCap + highschool + asset_pca_CT1, data=STS_Data)
 model.y <- lm(econbeh_C3~ TrialArm + efficacy_C3+ econbeh_C1 + Age_CT1a + female +rural + married  +Work1_CT1a + GrantIncomeCap + highschool + asset_pca_CT1, data=STS_Data)

 ### Non parametric
 out.1 <- mediate(model.m, model.y, sims = 1000,
                  boot = TRUE, treat = "TrialArm", mediator = "efficacy_C3", cluster = "ClusterID_AT1a")

In out.1 I try to cluster my standard errors to account for the fact that villages rather than individuals were randomized. But R gives me the following error message: "'cluster' is ignored for nonparametric bootstrap " Any idea how I can address this? Thank you!

$\endgroup$
1
  • $\begingroup$ The nonparametric bootstrap refers to when boot = TRUE. Maybe set it to FALSE and see if that helps? $\endgroup$
    – Noah
    May 25 '18 at 20:41
0
$\begingroup$

Its because you have fitted a linear model ignoring the cluster in your model.m and model.Y.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.