0

Hi this is my first time doing a mediation analysis. I've looked at the documentation and some examples, but I seem to be having a problem with my model. The code I'm using for this is with the mediation package and is as follow:

med.fit<-polr(nightmares_12$nightmares ~ polygenic_score$risk_score + nightmares_12$gender, Hess=T)
out.fit<-polr(PE$pliks_3C ~ nightmares_12$nightmares + polygenic_scores$risk_score + PE$gender, Hess=T)
med.out<-mediate(med.fit, out.fit, treat="polygenic_scores$risk_score", mediator="nightmares_12$nightmares", sims=1000, boot=T)

So just a few points to make about the data. First I have my data in 3 datasets but they are matched (nightmares_12, polygenic_score and PE). The variables nightmares (the mediator) and pliks_3C (the outcome) are both ordinal data (each with 3 levels), hence why I have used polr function for the model. The variable risk_score is continuous. I must admit despite having read the documentation I was not entirely sure what to include in the mediate function, so this is possibly where I am going wrong.

The model runs fine but the problem I have is with the output in summary(med.out). The output looks like this:

Causal Mediation Analysis 

Nonparametric Bootstrap Confidence Intervals with the Percentile Method

                Pr(Y=0) Pr(Y=1) Pr(Y=2)
ACME (control)        0       0       0
2.5%                  0       0       0
97.5%                 0       0       0
p-value               1       1       1

                Pr(Y=0) Pr(Y=1) Pr(Y=2)
ACME (treated)        0       0       0
2.5%                  0       0       0
97.5%                 0       0       0
p-value               1       1       1

                Pr(Y=0) Pr(Y=1) Pr(Y=2)
ADE (control)         0       0       0
2.5%                  0       0       0
97.5%                 0       0       0
p-value               1       1       1

                Pr(Y=0) Pr(Y=1) Pr(Y=2)
ADE (treated)         0       0       0
2.5%                  0       0       0
97.5%                 0       0       0
p-value               1       1       1

               Pr(Y=0) Pr(Y=1) Pr(Y=2)
Total Effect         0       0       0
2.5%                 0       0       0
97.5%                0       0       0
p-value              1       1       1

Sample Size Used: 3155 

Simulations: 1000 

Does anyone know why the output looks like this and what I need to change in my model to correct this problem?

Thanks!

user5481267
  • 117
  • 1
  • 15
  • What exactly is the problem with the output? Describe what you expected to see. You should provide a minimal [reproducible example](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) so we can run the models as well. – MrFlick Mar 03 '16 at 14:39
  • Hi so I think I should get something like this: Nonparametric Bootstrap Confidence Intervals with the Percentile Method Estimate 95% CI Lower 95% CI Upper p-value ACME (control) 0.0832 0.0426 0.1332 0.00 ACME (treated) 0.0844 0.0425 0.1333 0.00 That's just an example from the documentation. Sorry I'm quite new to R as well so I'm not really sure how I would provide a reproducible example. I suspect the problem could be the fact that the mediator and outcome are ordinal, but I'm not sure. – user5481267 Mar 03 '16 at 14:47

0 Answers0