Description Usage Arguments Value Author(s) References See Also Examples
Construct beautiful tree diagrams
1 2 3 4 |
main |
Character vector with two variable names, descriptions, or questions |
p1 |
Vector of probabilities for the primary branches |
p2 |
List for the secondary branches, where each list item should be a numerical vector of probabilities corresponding to the primary branches of |
out1 |
Character vector of the outcomes corresponding to the primary branches |
out2 |
Character vector of the outcomes corresponding to the secondary branches |
textwd |
The width provided for text with a default of |
solwd |
The with provided for the solution with a default of |
SBS |
A boolean vector indicating whether to place text and probability side-by-side for the primary and secondary branches |
showSol |
Boolean indicating whether to show the solution in the tree diagram |
solSub |
An optional list of vectors corresponding to |
digits |
The number of digits to show in the solution |
textadj |
Vertical adjustment of text |
cex.main |
Size of |
col.main |
Color of |
showWork |
Whether work should be shown for the solutions |
No value is given.
David M Diez, Christopher D Barr
OpenIntro Statistics, Chapter 2.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | # Examples
# generic with random probabilities
treeDiag(c('Flight on time?','Luggage on time?'),
c(.8,.2), list(c(.97,.03), c(.15,.85)))
treeDiag(c('Breakfast?','Go to class'), c(.4,.6),
list(c(.4,.36,.34),c(.6,.3,.1)), c('Yes','No'),
c('Statistics','English','Sociology'), showWork=TRUE)
treeDiag(c('Breakfast?','Go to class'), c(.4,.11,.49),
list(c(.4,.36,.24),c(.6,.3,.1),c(.1,.4,.5)),
c('one','two','three'), c('Statistics','English','Sociology'))
treeDiag(c('Dow Jones rise?', 'NASDAQ rise?'),
c(0.53, 0.47), list(c(0.75, 0.25), c(0.72, 0.28)),
solSub=list(c("(a)", "(b)"), c("(c)", "(d)")), solwd=0.08)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.