[R] pdredge error

Art U @rt@tem@u@ @ending from gm@il@com
Mon Sep 17 23:29:59 CEST 2018


Hello,

I'm trying to use parallel computing in MuMIn package. It worked a couple
month ago, but now I'm getting the error. Here is a code:

#Data
x1 = rnorm(1000)
x2 = rnorm(1000)
x3 = rnorm(1000)
z = 1 + 0.5*x1 - x2
pr = 1/(1+exp(-z))
y = rbinom(1000, 1, pr)
dataD = cbind(y=y, x1=x1 ,x2=x2, x3=x3)

#Fixed variable
fix.var = c("x1")

#Model averaging
cl <- makeCluster(detectCores())
clusterExport(cl, c("dataD"), envir=environment())
clusterExport(cl, c("y"), envir=environment())
clusterExport(cl, c("fix.var"), envir=environment())
clusterEvalQ(cl, library(MuMIn))
d = data.frame(dataD)
      options(na.action = "na.fail")
      m.inc = glm(y~., family=binomial, data=d)
      MA.inc = pdredge(global.model = m.inc, rank = "AIC" , fixed =
fix.var, cluster=cl)
      mo.inc = model.avg(MA.inc, rank =  "AIC")
      atr.inc = attr(mo.inc, "modelList")
 stopCluster(cl)

The error says that data frame 'd' is not found and the pdredge result is
empty:

Warning messages:
1: In is.data.frame(data) : object 'd' not found (model 0 skipped)
2: In is.data.frame(data) : object 'd' not found (model 1 skipped)
3: In is.data.frame(data) : object 'd' not found (model 2 skipped)
4: In is.data.frame(data) : object 'd' not found (model 3 skipped)
5: In is.data.frame(data) : object 'd' not found (model 4 skipped)
Error in pdredge(global.model = m.inc, rank = "AIC" , fixed = fix.var,    :
  the result is empty



-- 
*I like to pretend I'm alone*. *Completely alone*. *Maybe post-apocalypse
or plague*... *Whatever*. *No-one left to act normal for. No need to hide
who I really am. It would be... freeing*. *...*

	[[alternative HTML version deleted]]



More information about the R-help mailing list