Skip to Main Content
SAS for R Users
book

SAS for R Users

by Ajay Ohri
September 2019
Beginner to intermediate content levelBeginner to intermediate
208 pages
3h 17m
English
Wiley
Content preview from SAS for R Users

5Numerical Summary and Groupby Analysis

We use numerical summary methods to see measures of central tendency (mean, median(and dispersion (variance, standard deviation) as well as other measures (skewness, kurtosis) and distributions (max,min, interquartile range) to find estimated and expected values for analysis of numerical variables. We use groupby to slice and dice the data for further analysis. In R we have the concept of tidy data:

  1. Each variable forms a column.
  2. Each observation forms a row.
  3. Each type of observational unit forms a table

By default all datasets in SAS are tidy.

Also in R we have the concept of Split‐Apply‐Combine. Split Apply Combine refers to the following

  1. split data into pieces,
  2. apply some function to each piece,
  3. combine the results back together again

5.1 Numerical Summary and Groupby Analysis

Here we use different functions and procedures to do analysis on numerical data.

5.2 Numerical Summary and Groupby Analysis in SAS

In SAS – we use the class statement for grouping and var statement for specifying for a particular value‐

  • proc means,

Proc means is one of the most common procedure used for analyzing the data. It calculates descriptive statistics like Mean, Standard Deviation, Maximum and Minimum along with Number of observations. By default, proc means displays the default Statistics: It can be customized for other descriptive statistics.

Note sashelp library in SAS is like the default datasets library in R, as both give test datasets for ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Statistical Hypothesis Testing with SAS and R

Statistical Hypothesis Testing with SAS and R

Sonja Kuhnt, Dirk Taeger

Publisher Resources

ISBN: 9781119256410Purchase book