[R] pcnetmeta help: initial values

Karla Galaviz galavizk at gmail.com
Wed Sep 2 17:27:18 CEST 2015


Good morning,

 

I hope this message finds you well.

I am writing because I have been trying to run a Bayesian network
meta-analysis for 2 weeks now using the pcnetmeta package and have not been
able to do it. I have looked for help online and could not find what my
problem is.

 

My code is: 

#### Bayesian Network Meta-analysis with follow up times

LR <- read.csv("C:/Users/Galanova/Box Sync/IHME/EF meta/R
analysis/diabetes.csv", row.names=NULL, quote="")

View(LR)

nma.ab.followup(s.id = s.id, t.id = t.id, event.n = event.n, total.n =
total.n, followup = follow.up, 

        data=LR, param = c("lograte", "rank.prob"),

        model = "het_eqcor", prior.type="invgamma", a = 0.001, b = 0.001,

        c = 10, higher.better = FALSE, digits = 4, n.adapt = 5000,

        n.iter = 100000, n.burnin = floor(n.iter/2), n.chains = 3,

        n.thin = max(1, floor((n.iter - n.burnin)/100000)),

        conv.diag = FALSE, trace = "lograte", dic = FALSE,

        postdens = FALSE, mcmc.samples = FALSE)

 

My data is:

'data.frame':  128 obs. of  11 variables:
 $ Author   : Factor w/ 124 levels "Ali (2011)-1000 mg",..: 70 69 39 38 102
101 104 103 106 105 ...
 $ s.id     : int  1 1 2 2 3 3 4 4 5 5 ...
 $ t.id     : int  1 0 1 0 1 0 1 0 1 0 ...
 $ trtname  : Factor w/ 5 levels "ALT","Control",..: 3 2 3 2 3 2 3 2 3 2 ...
 $ event.n  : num  NA NA 34 55 8 18 35 55 15 36 ...
 $ total.n  : int  108 80 143 142 52 54 300 321 103 110 ...
 $ follow.up: num  1 1 3.1 3.1 3 3 3 3 3 3 ...
 $ X1000.py : num  NA NA 80 132 60 127 42 58 27 51 ...
 $ percent  : num  NA NA 24 39 18 38 12 17 15 8 ...
 $ rr       : num  NA NA 0.58 NA 0.42 NA 0.56 NA 0.53 NA ...
 $ rr.se    : num  NA NA 0.55 NA -0.06 NA 0.14 NA -0.0325 NA ...

 

When I run it, I get this message:

 Error in jags.model(file = textConnection(modelstring), data = data.jags,
: 

  Error in node y[17]

Observed node inconsistent with unobserved parents at initialization.

Try setting appropriate initial values.

 

I have tried using different initial values and that does not work either. I
am a beginner in R and would really appreciate some help on this.

Thank you for taking the time to read this message.

 

Karla

 


	[[alternative HTML version deleted]]



More information about the R-help mailing list