observe_data | R Documentation |
Observe data, given a strategy
observe_data(
complete_data,
observed = NULL,
nodes_to_observe = NULL,
prob = 1,
m = NULL,
subset = TRUE
)
complete_data |
A |
observed |
A |
nodes_to_observe |
A list. Nodes to observe. |
prob |
A scalar. Observation probability. |
m |
A integer. Number of units to observe; if specified, |
subset |
A character. Logical statement that can be applied to rows of complete data. For instance observation for some nodes might depend on observed values of other nodes; or observation may only be sought if data not already observed! |
A data.frame
with logical values indicating which nodes
to observe in each row of 'complete_data'.
model <- make_model("X -> Y")
df <- make_data(model, n = 8)
# Observe X values only
observe_data(complete_data = df, nodes_to_observe = "X")
# Observe half the Y values for cases with observed X = 1
observe_data(complete_data = df,
observed = observe_data(complete_data = df, nodes_to_observe = "X"),
nodes_to_observe = "Y", prob = .5,
subset = "X==1")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.