| node_polr | R Documentation |
Data from the parents is used to generate the node using by first calculating the linear predictor. An appropriately distributed random error term is then added. The resulting latent variable is categorized at user-specified cutpoints to obtain the resulting ordered factor.
node_polr(data, parents, formula=NULL, betas,
cutpoints, link="logistic", labels=FALSE,
output="factor")
data |
A |
parents |
A character vector specifying the names of the parents that this particular child node has. If non-linear combinations or interaction effects should be included, the user may specify the |
formula |
An optional |
betas |
A numeric vector with length equal to |
cutpoints |
A numeric vector containing the points at which the underlying latent variable is cut to produce the ordered factor. In general, |
link |
The link function describing the distribution of the error term. Allowed values are |
labels |
Labels for the levels of the resulting categories. By default ( |
output |
A single character string specifying the kind of output that should be returned. Defaults to |
This node type currently does not support inclusion of random effects or random slopes in the formula.
Returns a character of factor vector of length nrow(data).
Robin Denz
empty_dag, node, node_td, sim_from_dag, sim_discrete_time
library(simDAG)
set.seed(124554)
dag <- empty_dag() +
node(c("X1", "X2"), type="rnorm", mean=0, sd=1) +
node("Y", type="polr", formula= ~ -2*X1 + 1.5*X2, cutpoints=c(0.7, 1.5, 3.2),
link="logistic")
sim_dat <- sim_from_dag(dag=dag, n_sim=100)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.