A little announcement. A lot to explore.

Happy learning!

Explore lessons, including SAS & R programs and practice data.

Search lessons

Type at least 3 characters to see matching lessons.

Open SAS ↗Open R ↗
← SASnRFetching Frequencies

Introduction

  • A frequency count is usually the first summary we run on a new dataset — how many rows per category, and how are the values distributed?
  • Typical asks: count subjects per treatment, count adverse events per body system, cross-tabulate Sex by Age.
  • SAS uses proc freq with a tables statement, optionally writing the table out with out=.
  • Tidyverse uses count() from dplyr; base R uses table() wrapped in as.data.frame().
  • This lesson builds a one-way count of Sex on CLASS, then a Sex-by-Age cross tabulation on a slightly larger CLASS1 dataset.
  • After running, the counts should total back to the original row count so we know nothing was dropped.

Fetching Frequencies