Module 17 ยท How do you run CNA?

One function does the heavy lifting

By the end of this module you will be able to
  • Run cna() on a dataset.
  • Set the outcome argument correctly.
  • Explain what 'capital letter means present' is about.

The whole method is wrapped in a single function: cna(). You hand it your data and tell it which column is the outcome. It quietly searches for the minimally sufficient and necessary combinations, then assembles them into solution formulas while you sip your tea.

first_model.R
# ask: which combinations of gaps go together with LowCov = 1 ?
model <- cna(immunization, outcome = "LowCov")
One small but important detail

The outcome argument names a factor value

Writing outcome = "LowCov" tells CNA to model the presence of low coverage, the value 1. In crisp-set data, a capitalised name means "this factor = 1." That convention runs through the whole package: a capital letter means present, and lower-case means absent.

Running this stores the result in model but prints nothing yet, which feels anticlimactic. Don't worry. Viewing it is the very next module.

Reflect

Run the model on your own version of the data.

  • Did you name the outcome exactly as the column is spelled?
  • What is CNA quietly searching for while it runs?