The RX computer program examines a time-oriented clinical database and attempts to derive a set of (possibly) causal relationships. First, a Discovery Module uses lagged, nonparametric correlations to generate an ordered list of tentative relationships. Second, a Study Module uses a small knowledge base (KB) of medicine and statistics to create a study design to control for known confounders. The study design is then executed by an on-line statistical package, and the results are automatically incorporated into the KB as a machine-readable record. In determining the confounders of a new hypothesis the Study Module uses previously "learned" causal relationships.