title: Error in sensitivity analysis (medsens): Nonconformable Arrays
body: <p>I am trying to run sensitivity analysis for a mediation test I ran and would appreciate feedback from anyone who might be able to identify the source of the error generated. </p>
  
  <p>Mediation:</p>
  
  <pre><code>model.m1 &lt;- lm(cagr_2006_2008 ~ log_pdens_06 + closeness_06 + rainfall_diff_06 + historical_drought+pct_ag_land + ag_prox + cagr_1990_2000 + historical_drought*ag_prox, data=lnd_data_c1_mediate)
  summary(model.m1)
  model.y1 &lt;- glm(protest_sum_1_logit ~ log_total_pop_10 + cagr_2006_2008 + historical_drought + rainfall_diff_06, family=binomial(link="probit"), data=lnd_data_c1_mediate)
  summary(model.y1)
  out.1_moderate &lt;- mediate(model.m1, model.y1, sims=1000, boot=TRUE, treat="rainfall_diff_06", mediator="cagr_2006_2008", control.value = -57.1, treat.value = 0, dropobs = TRUE)
  </code></pre>
  
  <p>Sensitivity Analysis:</p>
  
  <pre><code>sens.1 &lt;- medsens(out.1_moderate, rho.by=0.05, sims=1000)
  summary(sens.1)
  ##  Error in Mmodel.coef.sim * (rho12.sim/sigma.2.sim) %x% t(rep(1, y.k -  : 
  ##    non-conformable arrays
  </code></pre>
  
  <p>My code base and data sets are available <a href="https://drive.google.com/drive/folders/0B-Dh8O56oYVkSVBzc2NoTDZxNkE?usp=sharing" rel="nofollow noreferrer">here</a>. (If you download Regression and Mediation Analyses.R with lnd_data_c1_mediate.csv and lnd_data.csv, and select the csv file locations when prompted, the code should run smoothly. The sensitivity analyses conducted are all grouped together at the end of the file.) </p>
  
  <p>Thank you very much for any information you can provide!</p>