Learn R Programming

sasLM (version 0.10.8)

'SAS' Linear Model

Description

This is a core implementation of 'SAS' procedures for linear models - GLM, REG, ANOVA, TTEST, FREQ, and UNIVARIATE. Some R packages provide type II and type III SS. However, the results of nested and complex designs are often different from those of 'SAS.' Different results does not necessarily mean incorrectness. However, many wants the same results to SAS. This package aims to achieve that. Reference: Littell RC, Stroup WW, Freund RJ (2002, ISBN:0-471-22174-0).

Copy Link

Version

Install

install.packages('sasLM')

Monthly Downloads

1,244

Version

0.10.8

License

GPL-3

Maintainer

Kyun-Seop Bae

Last Published

March 8th, 2026

Functions in sasLM (0.10.8)

GLM

General Linear Model similar to SAS PROC GLM
DoEdata

Example Datasets
Kurtosis

Kurtosis
G2SWEEP

Generalized inverse matrix of type 2 for linear regression
LCL

Lower Confidence Limit
ESTM

Estimate Linear Function
KurtosisSE

Standard Error of Kurtosis
Drift

Drift defined by Lan and DeMets for Group Sequential Design
ExitP

Exit Probability with cumulative Z-test in Group Sequential Design
N

Number of observations
OR

Odds Ratio of two groups
EMS

Expected Mean Square Formula
Min

Min without NA
Mean

Mean without NA
Median

Median without NA
OBFBound

O'Brien-Flemming bounds for cumulative Z-test in Group Sequential Design
ModelMatrix

Model Matrix
ORcmh

Odds Ratio of two groups with strata by CMH method
Max

Max without NA
LSM

Least Square Means
ORmn1

Odds Ratio and Score CI of two groups without strata by the MN method
PDIFF

Pairwise Difference
RDinv

Risk Difference between two groups with strata by inverse variance method
Pcor.test

Partial Correlation test of multiple columns
RDmn

Risk Difference and Score CI between two groups with strata by the MN method
Range

Range
RanTest

Test with Random Effects
SEM

Standard Error of the Sample Mean
RRmn

Relative Risk and Score CI of two groups with strata by the MN method
SD

Standard Deviation
PocockBound

Pocock (fixed) Bound for the cumulative Z-test with a final target alpha-value
RRmn1

Relative Risk and Score CI of two groups without strata by by MN method
T3test

Test Type III SS using error term other than MSE
RRinv

Relative Risk of two groups with strata by inverse variance method
ORinv

Odds Ratio of two groups with strata by inverse variance method
TTEST

Independent two groups t-test comparable to PROC TTEST
RR

Relative Risk of the two groups
ORmn

Odds Ratio and Score CI of two groups with strata by MN method
ScoreCI

Score Confidence Interval for a Proportion or a Binomial Distribution
WhiteTest

White's Model Specification Test
af

Convert some columns of a data.frame to factors
bk

Beautify the output of knitr::kable
cSS

Sum of Square with a Given Contrast Set
UNIV

Univariate Descriptive Statistics
UCL

Upper Confidence Limit
aov3

ANOVA with Type III SS
Skewness

Skewness
g2inv

Generalized type 2 inverse matrix, g2 inverse
e2

Get a Contrast Matrix for Type II SS
e3

Get a Contrast Matrix for Type III SS
geoCV

Geometric Coefficient of Variation in percentage
aspirinCHD

An example data for meta-analysis - aspirin in coronary heart disease
QuartileRange

Inter-Quartile Range
pD

Diagnostic Plot for Regression
est

Estimate Linear Functions
estmb

Estimability Check
pResD

Residual Diagnostic Plot for Regression
pB

Plot Confidence and Prediction Bands for Simple Linear Regression
T3MS

Type III Expected Mean Square Formula
SkewnessSE

Standard Error of Skewness
corFisher

Correlation test by Fisher's Z transformation
RDmn1

Risk Difference and Score CI between two groups without strata by the MN method
REG

Regression of Linear Least Square, similar to SAS PROC REG
aov1

ANOVA with Type I SS
SLICE

F Test with Slice
SS

Sum of Square
aov2

ANOVA with Type II SS
RD

Risk Difference between two groups
regD

Regression of Conventional Way with Rich Diagnostics
e1

Get a Contrast Matrix for Type I SS
lr0

Simple Linear Regressions with Each Independent Variable
tsum

Table Summary
geoMean

Geometric Mean without NA
tmtest

Independent two means test similar to t.test with summarized input
trimmedMean

Trimmed Mean
is.cor

Is it a correlation matrix?
sasLM-package

'SAS' Linear Model
tsum0

Table Summary 0 independent(x) variable
lfit

Linear Fit
lr

Linear Regression with g2 inverse
tsum3

Table Summary 3 independent(x) variables
tsum1

Table Summary 1 independent(x) variable
seqBound

Sequential bounds for cumulative Z-test in Group Sequential Design
seqCI

Confidence interval with the last Z-value for the group sequential design
tsum2

Table Summary 2 independent(x) variables
vtest

F-Test for the ratio of two groups' variances
satt

Satterthwaite Approximation of Variance and Degree of Freedom
mtest

Independent two groups t-test similar to PROC TTEST with summarized input
ztest

Test for the difference of two groups' means
Diffogram

Plot Pairwise Differences
BY

Analysis BY variable
Cor.test

Correlation test of multiple numeric columns
CumAlpha

Cumulative Alpha with various z's and ti
Coll

Collinearity Diagnostics
CONTR

F Test with a Set of Contrasts
CIest

Confidence Interval Estimation
CV

Coefficient of Variation in percentage
BasicUtil

Internal Functions
BEdata

An Example Data of Bioequivalence Study