/ Home

Statistical Modelling in S-Plus

A library of functions for S-Plus

This page links to source code and documentation for a variety of S-Plus functions for statistical modelling. You can download source code for each function from its help page (see the link 'download script' in the top-right of each page). All functions have been tested in S-Plus 2000 for Windows.

I (Gordon Smyth) am the author of all code below unless otherwise specified. All the code below is open source under LGPL license.

Note that I now use R rather than S-Plus for statistical programming. While I will respond to bug reports for the functions below, I have no plans to develop these functions further or to port them to later versions of S-Plus. See my R libraries for my current work.

Data Analysis and Programming

Produce an added variable plot for each covariate in a linear model.
Modified Bessel function of order 0.
Copy the current plot to the Windows clipboard as a metafile in S-Plus 3.3 or earlier.
Binomial coefficients.
Leverage, residuals and influence for a linear model, generalized linear model or generalized additive model.
Function minimization by the Nelder-Mead simplex algorithm. Implementation by Bill Clark and David Clifford.
Normal probability plot surrounded by random plots for calibration.
Scatterplot with circle size indexing a third variable. A method of plotting three numeric variables simultaneously.
Truncated Poisson Distribution
Random number generation from the truncated Poisson distribution.
Shared R2 values for the columns of two dimensional array.
Symmetry plot of a sample of numbers.
Density of a distribution with specified cumulants.

Generalized Linear Models

Inverse Gaussian Distribution
Density, distribution function and random deviates for the inverse Gaussian distribution.
Poisson Gamma Distribution
Density and distribution function for the Poisson gamma (or compound Poisson) distribution.
Polygamma Functions
The digamma and trigamma functions, first and second derivates of log(gamma(x)). Slightly edited from original functions written by Bill Venables.
Predicted values and confidence intervals for logistic regression.
Randomized quantile residuals for generalized linear models.
Estimated a generalized linear model with random factors using the method of Schall (1991).
Tweedie Distributions
Density, cumulative distribution function and quantiles for the Tweedie distributions. Includes the normal, Poison, Poison-gamma and inverse-Gaussian distributions as special cases.
Tweedie Family
Specify a generalized linear model family with any power variance function and any power link. Includes the Gaussian, Poisson, gamma and inverse-Gaussian families as special cases.

Double Generalized Linear Models

REML estimation for a heteroscedastic linear regression model.
Double generalized linear models. Simultaneously model the mean and dispersion in generalized linear models.
Digamma Family
Specify a Digamma generalized linear model family. The Digamma distribution is the unit deviance distribution for the gamma family.
Describes the object produced by the dglm function.
Fit Tweedie's compound Poisson model to insurance claims data.

Frequency Estimation

Matrix by Vector
Multiply the rows or columns of a matrix by the elements of a vector.
Compute the coefficients of a polynomial given its roots.
Compute the value of a polynomial.
Frequency estimation using an eigenanalysis based method. Does not require starting values.
Frequency estimation by separable least squares.

Robust Estimation

MM estimation of a nonlinear regression function.
M estimation of a scale parameter.
Hampel's redescending psi function.
The integral of Hampel's redescending psi function.
MM estimation of a sum of sinusoidal signals.
Robust frequency estimation using a multistage algorithm.

Extended Poisson Process Models for Count Data

Computes a saddlepoint approximation based on the negative binomial distribution for the probabilities in an extended Poisson process model.
Computes a saddlepoint approximation based on the gamma distribution for the probabilities in an extended Poisson process model.
Computes a saddlepoint approximation based on the normal distribution for the probabilities in an extended Poisson process model.
Computes a saddlepoint approximation based on matching the first 6 cumulants for the probabilities in an extended Poisson process model.
Computes the probabilities in an extended Poisson process model by numerically inverting a moment generating function.

See also S-Plus Bugs.


Home - About Us - Contact Us
Copyright © Gordon Smyth