[R] dagitty library : NULL response
varin sacha
v@r|n@@ch@ @end|ng |rom y@hoo@|r
Thu Mar 31 11:58:16 CEST 2022
Dear R-experts,
Here below my R code (toy example). No message error but I would like to know why I get NULL as a response and what does it mean ?
Many thanks.
#############################################
library(dagitty)
x1=c(23,54,34,55,61,56,57,65,63,78,34,23,12,54,94)
x2=c(98,76,67,89,34,56,78,99,89,120,98,67,56,54,87)
x3=c(12,13,14,21,11,16,54,23,12,13,22,11,33,23,21)
x4=c(34,35,45,36,65,45,55,53,51,56,57,64,34,35,45)
X=x1+x2+x3
Y=x4
d <- data.frame (x1,x2,x3,x4, X=X, Y=Y)
type = c ( " cont " , " cont " , " cont " , " cont " , " cont " , " cont ")
g1 <- dagitty ( " dag {
x1 -> x2
x1 -> x3
x1 -> x4
x2 -> x3
x2 -> x4
x3 -> x4
X-> Y
x1-> X
x2-> X
x3-> X
x4-> X
x1-> Y
x2-> Y
x3-> Y
x4-> Y
} " )
tryCatch ({
r = localTests ( g1 , d ) ;
p.dagitty.param.correct [ i ] = min ( p.adjust ( r$p.value , method = " holm " ) ) ;
} , error = function( e ) {}) ;
#############################################
More information about the R-help
mailing list