main-content

Linear models courses are often presented as either theoretical or applied. Consequently, students may find themselves either proving theorems or using high-level procedures like PROC GLM to analyze data. There exists a gap between the derivation of formulas and analyses that hide these formulas behind attractive user interfaces. This book bridges that gap, demonstrating theory put into practice.

Concepts presented in a theoretical linear models course are often trivialized in applied linear models courses by the facility of high-level SAS procedures like PROC MIXED and PROC REG that require the user to provide a few options and statements and in return produce vast amounts of output. This book uses PROC IML to show how analytic linear models formulas can be typed directly into PROC IML, as they were presented in the linear models course, and solved using data. This helps students see the link between theory and application. This also assists researchers in developing new methodologies in the area of linear models.

The book contains complete examples of SAS code for many of the computations relevant to a linear models course. However, the SAS code in these examples automates the analytic formulas. The code for high-level procedures like PROC MIXED is also included for side-by-side comparison. The book computes basic descriptive statistics, matrix algebra, matrix decomposition, likelihood maximization, non-linear optimization, etc. in a format conducive to a linear models or a special topics course.

Also included in the book is an example of a basic analysis of a linear mixed model using restricted maximum likelihood estimation (REML). The example demonstrates tests for fixed effects, estimates of linear functions, and contrasts. The example starts by showing the steps for analyzing the data using PROC IML and then provides the analysis using PROC MIXED. This allows students to follow the process that lead to the output.

### Chapter 1. SAS/IML: A Brief Introduction

Abstract
IML stands for Interactive Matrix Language and is a matrix language written as a component of the SAS System. IML allows the user to enter numbers and other characters in matrix form and perform data manipulation, functions and algorithms commonly associated with matrices.
Jamis J. Perrett

### Chapter 2. IML Language Structure

Abstract
READ, UPDATE, RESET, PRINT? Many commands, functions, calls, and operators are pretty easy to figure out without explanation — It might be expected that the READ statement read values into a matrix, the NCOL function identify the number of columns in a given matrix, and the + operator add elements in a matrix. However, some of the commands, functions, calls, and operators used in IML are less obvious. This section will help the reader understand the basic use of commands, functions, calls, and operators with some examples.
Jamis J. Perrett

### Chapter 3. IML Programming Features

Abstract
A SAS/IML module is a subprogram or subroutine. A module is set apart from the rest of the IML code and is not executed until called. Modules can be called various times within a single IML procedure.
Jamis J. Perrett

### Chapter 4. Matrix Manipulations in SAS/IML

Abstract
IML allows different levels of matrix access: element access, row access, column access, submatrix access.
Jamis J. Perrett

### Chapter 5. Mathematical and Statistical Basics

Abstract
There are many statistical equations that require finding the transpose of a matrix, the trace, rank, etc. Some of these operations are basic functions with sensible names that are easily discovered and used in IML. Some operations are less obvious.
Jamis J. Perrett

### Chapter 6. Linear Algebra

Abstract
IML automates intensive matrix algebraic statements. Problems that could take hours to solve on paper can take seconds to solve using IML. Conventional mathematical notation is used as much as possible for simplicity, so the way a problem would be written down on a piece of paper is similar to how it would be written in IML code. The following examples incorporate many of the mathematical operators and functions that IML provides.
Jamis J. Perrett

### Chapter 7. The Multivariate Normal Distribution

Abstract
Matrices simplify computations involving the multivariate normal distribution.
Jamis J. Perrett

### Chapter 8. The General Linear Model

Abstract
The subject of linear models, and all of its intricacies is too vast to be properly dealt with in a book of this nature. Instead, a few examples of general applications of linear models in IML will be demonstrated. These examples can then be modified according to the needs of the researcher.
Jamis J. Perrett

### Chapter 9. Linear Mixed Models

Abstract
In the early 1950s, C.R. Henderson developed mixed model estimation, something he began in the 1940s with his Ph.D. thesis. He wanted to analyze data for a linear model with fixed environmental and random genetic factors in the breeding of swine (Van Vleck, 1998).
Jamis J. Perrett

### Chapter 10. Statistical Computation Methods

Abstract
Within the context of linear models, there are different algorithms that have been developed to make computations more accurate and/or efficient (fewer basic operations). One problem deals with the size of a matrix.
Jamis J. Perrett