Last chance! 50% off unlimited learning
Sale ends in
truthTable()
finds the observed combinations among all possible ones, prints the frequency
of each observed combination and establishes the value for the outcome in this way:
- if all observed combinations agree on having the same outcome value (either 0 or 1), then the
value for the outcome will be set to that value
- for any given combination, if the outcome present values of both 0 and 1 then the value for the
outcome will be set to a contradiction ("C")
- for all other possible combinations, the outcome is missing and will be coded with "?"
is.tt()
checkes if an object has the class tt (if it is a truth table); such an
object is created by truthTable()
print.tt()
has an S3 method for printing objects of class 'tt'truthTable(mydata, outcome = "", conditions = c(""), complete = FALSE,
show.cases = FALSE, quiet = FALSE)is.tt(x)
## S3 method for class 'tt':
print(x, funqmcc=FALSE, ...)
qmcc
, eqmcc
data(Osa)
# print the truth table
truthTable(Osa, outcome="OUT", show.cases=TRUE)
# print the complete truth table
truthTable(Osa, outcome="OUT", complete=TRUE, show.cases=TRUE)
# save the result into an R object:
mytable <- truthTable(Osa, outcome="OUT", complete=TRUE, show.cases=TRUE, quiet=TRUE)
mytable # or print.tt(mytable)
# check the components
mytable$tt # the truth table itself
mytable$indexes # base 10 representation of input combinations
mytable$noflevels # number of levels from each causal condition
Run the code above in your browser using DataLab