Related to question here.
I've been trying to teach myself about Network Analysis, and developing DAG charts in R. Let's say that I have the following data.
dat=data.frame(sold=c(0,0,0,1,0,1), won=c(1,0,0,1,0,1), bid=c(5,3,2,5,3,4))
dat
Given what I'm trying to analyze, I know that the DAG plot should be as follows:
bid => won => sold
However, when I utilize the bnlearn package to generate the plot, it comes out as follows. It just can't be correct, and should be in the opposite direction.
library("bnlearn")
library("Rgraphviz")
bn.hc <- hc(dat, score = "bic")
graphviz.plot(bn.hc)
Now, I know that's just the data that I provided it to learn on, but I've messed around with the variable values, and it never turns our the way it should. Basically, a bid should determine whether you win, and whether you win should determine whether you can sell it. Just doesn't make sense.
Isn't there some way to specify what variable is the response variable? In my case, the response variable should be sold, and there should be no arcs from sold to another node.
Can anyone help with diagnosing the problem in R? Is there something I'm missing in the code? or of my understanding of BN's? is this an issue w/ what I pass as the algorithm to use in 'score'?