Learn R Programming

⚠️There's a newer version (3.1-168) of this package.Take me there.

nlme (version 3.1-30)

Linear and nonlinear mixed effects models

Description

Fit and compare Gaussian linear and nonlinear mixed-effects models.

Copy Link

Version

Install

install.packages('nlme')

Monthly Downloads

84,769

Version

3.1-30

License

GPL version 2 or later

Maintainer

Douglas Bates

Last Published

March 31st, 2025

Functions in nlme (3.1-30)

MEestimate

Estimate mixed-effects parameters
Initialize.lmeStruct

Initialize an lmeStruct Object
corAR1

AR(1) Correlation Structure
logDet.corStruct

Extract corStruct Log-Determinant
Matrix

Assign Matrix Values
Variogram.corExp

Calculate Semi-variogram for a corExp Object
formula.nlsList

Extract nlsList Object Formula
BIC.logLik

BIC of a logLik Object
Initialize.glsStruct

Initialize a glsStruct Object
MEEM

EM iterations for mixed-effects
plot.ranef.lmList

Plot a ranef.lmList Object
Initialize

Initialize Object
print.lmList

Print an lmList Object
print.varFunc

Print a varFunc Object
Names

Names Associated with an Object
plot.intervals.lmList

Plot lmList Confidence Intervals
Initialize.reStruct

Initialize reStruct Object
lmeStruct

Linear Mixed-Effects Structure
ACF

Autocorrelation Function
corFactor

Factor of a Correlation Matrix
formula.corStruct

Extract corStruct Object Formula
plot.gls

Plot a gls Object
Dim

Extract Dimensions from an Object
Names.formula

Extract Names from a formula
solve.pdMat

Calculate Inverse of a Positive-Definite Matrix
lme.lmList

LME fit from lmList Object
predict.gnls

Predictions from a gnls Object
Variogram.corSpher

Calculate Semi-variogram for a corSpher Object
pdMat

Positive-Definite Matrix
fixed.effects

Extract Fixed Effects
predict.nlme

Predictions from an nlme Object
print.gls

Print a gls Object
pdMatrix.reStruct

Extract Matrix or Square-Root Factor from Components of an reStruct Object
Covariate

Assign Covariate Values
Names.reStruct

Names of an reStruct Object
Variogram.corSpatial

Calculate Semi-variogram for a corSpatial Object
plot.compareFits

Plot a compareFits Object
MEdims

Calculate dimensions in mixed-effects
[.pdMat

Subscript a pdMat Object
summary.lme

Summarize an lme Object
print.reStruct

Print an reStruct Object
Dim.corStruct

Dimensions of a corStruct Object
pdSymm

General Positive-Definite Matrix
summary.corStruct

Summarize a corStruct Object
print.summary.modelStruct

Print a summary.modelStruct Object
gnlsControl

Control Values for gnls Fit
ACF.gls

Autocorrelation Function for gls Residuals
Names.pdBlocked

Names of a pdBlocked Object
varExp

Exponential Variance Function
pdMatrix

Extract Matrix or Square-Root Factor from a pdMat Object
pairs.lmList

Pairs Plot of an lmList Object
summary.pdMat

Summarize a pdMat Object
print.summary.varFunc

Print a summary.varFunc Object
as.matrix.reStruct

Matrices of an reStruct Object
getData.lmList

Extract lmList Object Data
corMatrix.reStruct

Extract Correlation Matrix from Components of an reStruct Object
pruneLevels

Prune Factor Levels
fitted.gls

Extract gls Fitted Values
Initialize.corStruct

Initialize corStruct Object
recalc.corStruct

Recalculate for corStruct Object
anova.lme

Compare Likelihoods of Fitted Objects
LDEsysMat

Generate system matrix for LDEs
fitted.lmList

Extract lmList Fitted Values
logLik.glsStruct

Log-Likelihood of a glsStruct Object
Initialize.varFunc

Initialize varFunc Object
print.summary.lme

Print a summary.lme Object
Covariate.varFunc

Assign varFunc Covariate
solve.reStruct

Apply Solve to an reStruct Object
logDet.pdMat

Extract Log-Determinant from a pdMat Object
residuals.lmeStruct

Calculate lmeStruct Residuals
pdFactor

Square-Root Factor of a Positive-Definite Matrix
MEdecomp

Decompose a mixed-effects model
residuals.lme

Extract lme Residuals
predict.gls

Predictions from a gls Object
coef.reStruct

reStruct Object Coefficients
varWeights

Extract Variance Function Weights
plot.nffGroupedData

Plot an nffGroupedData Object
fixef.lme

Extract lme Fixed Effects
ranef.lme

Extract lme Random Effects
varWeights.lmeStruct

Variance Weights for lmeStruct Object
summary.modelStruct

Summarize a modelStruct Object
logLik.varFunc

Extract varFunc logLik
VarCorr

Extract variance and correlation components
getResponse.gls

Extract gls Object Response
formula.nlme

Extract nlme Object Formula
pdLogChol

General Positive-Definite Matrix
plot.lmList

Plot an lmList Object
getCovariate

Extract Covariate from an Object
coef.lme

Extract lme Coefficients
residuals.lmList

Extract lmList Residuals
varFixed

Fixed Variance Function
random.effects

Extract Random Effects
splitFormula

Split a Formula
varWeights.glsStruct

Variance Weights for glsStruct Object
plot.ranef.lme

Plot a ranef.lme Object
Variogram.corRatio

Calculate Semi-variogram for a corRatio Object
corCompSymm

Compound Symmetry Correlation Structure
corARMA

ARMA(p,q) Correlation Structure
plot.nfnGroupedData

Plot an nfnGroupedData Object
summary.lmList

Summarize an lmList Object
AIC

Akaike Information Criterion
pdConstruct.pdBlocked

Construct pdBlocked Objects
coef.gnls

Extract gnls Coefficients
summary.varFunc

Summarize varFunc Object
Names.pdMat

Names of a pdMat Object
corSpatial

Spatial Correlation Structure
BIC

Bayesian Information Criterion
asTable

Convert groupedData to a matrix
print.anova.lme

Print an anova.lme Object
fixef.lmList

Extract lmList Fixed Effects
formula.modelStruct

Extract modelStruct Object Formula
nlsList.selfStart

nlsList Fit from a selfStart Function
plot.augPred

Plot an augPred Object
plot.Variogram

Plot a Variogram Object
fitted.gnls

Extract gnls Fitted Values
pdClasses

Positive-Definite Matrix Classes
Dim.corSpatial

Dimensions of a corSpatial Object
coef.pdCompSymm

pdCompSymm Object Coefficients
logLik.lme

Log-Likelihood of an lme Object
pdCompSymm

Positive-Definite Matrix with Compound Symmetry Structure
allCoef

Extract Coefficients from a Set of Objects
recalc.modelStruct

Recalculate for a modelStruct Object
Variogram.lme

Calculate Semi-variogram for Residuals from an lme Object
collapse

Collapse According to Groups
gsummary

Summarize by Groups
qqnorm.lme

Normal Plot of Residuals or Random Effects from an lme Object
logLik.gnls

Log-Likelihood of a gnls Object
corMatrix.corStruct

Matrix of a corStruct Object
getResponse.lme

Extract lme Object Response
AIC.lme

Akaike Information Criterion
corExp

Exponential Correlation Structure
residuals.gls

Extract gls Residuals
corCAR1

Continuous AR(1) Correlation Structure
getData

Extract Data from an Object
Variogram

Calculate Semi-variogram
fdHess

Finite difference Hessian
intervals.lme

Confidence Intervals on lme Parameters
phenoModel

Model function for the Phenobarb data
fitted.glsStruct

Calculate glsStruct Fitted Values
varPower

Power Variance Function
logDet.reStruct

Extract reStruct Log-Determinants
summary.nlsList

Summarize an nlsList Object
pdConstruct

Construct pdMat Objects
logLik.gls

Log-Likelihood of a gls Object
varFunc

Variance Function Structure
print.lme

Print an lme Object
ACF.lme

Autocorrelation Function for lme Residuals
plot.lme

Plot an lme or nls object
contr.SAS

Contrast Matrices
gnlsStruct

Generalized Nonlinear Least Squares Structure
pairs.lme

Pairs Plot of an lme Object
isInitialized.reStruct

Check if an reStruct Object is Initialized
recalc

Recalculate Condensed Linear Model Object
fitted.nlmeStruct

Calculate nlmeStruct Fitted Values
Variogram.default

Calculate Semi-variogram
Dim.pdMat

Dimensions of a pdMat Object
residuals.gnlsStruct

Calculate gnlsStruct Residuals
simulate.lme

simulate lme models
Matrix.pdMat

Assign Matrix to a pdMat Object
formula.gnls

Extract gnls Object Formula
groupedData

Construct a groupedData Object
Variogram.corLin

Calculate Semi-variogram for a corLin Object
coef.pdIdent

pdIdent Object Coefficients
getData.lme

Extract lme Object Data
corMatrix.pdMat

Extract Correlation Matrix from a pdMat Object
print.summary.lmList

Print a summary.lmList Object
coef.corStruct

Coefficients of a corStruct Object
pairs.compareFits

Pairs Plot of compareFits Object
reStruct

Random Effects Structure
quinModel

Model function for the Quinidine data
anova.gls

Compare Likelihoods of Fitted Objects
getCovariate.data.frame

Extract Data Frame Covariate
logLik.lmeStruct

Log-Likelihood of an lmeStruct Object
glsStruct

Generalized Least Squares Structure
logLik.corStruct

Extract corStruct Log-Likelihood
nlme

Nonlinear Mixed-Effects Models
augPred

Augmented Predictions
varIdent

Constant Variance Function
pooledSD

Extract Pooled Standard Deviation
recalc.reStruct

Recalculate for an reStruct Object
recalc.varFunc

Recalculate for varFunc Object
intervals

Confidence Intervals on Coefficients
fitted.lmeStruct

Calculate lmeStruct Fitted Values
corFactor.corStruct

Factor of a corStruct Object Matrix
pdDiag

Diagonal Positive-Definite Matrix
update.modelStruct

Update a modelStruct Object
Coef

Assign Values to Coefficients
Variogram.gls

Calculate Semi-variogram for Residuals from a gls Object
print.groupedData

Print a groupedData Object
lmList

List of lm Objects with a Common Model
coef.modelStruct

Extract modelStruct Object Coefficients
corClasses

Correlation Structure Classes
Matrix.reStruct

Assign reStruct Matrices
print.summary.corStruct

Print a summary.corStruct Object
isBalanced

Check a Design for Balance
varClasses

Variance Function Classes
gls

Fit Linear Model Using Generalized Least Squares
Variogram.corGaus

Calculate Semi-variogram for a corGaus Object
corSymm

General Correlation Structure
pdIdent

Multiple of the Identity Positive-Definite Matrix
getResponse

Extract Response Variable from an Object
qqnorm.gls

Normal Plot of Residuals from a gls Object
print.summary.pdMat

Print a summary.pdMat Object
coef.varFunc

varFunc Object Coefficients
update.varFunc

Update varFunc Object
logDet

Extract the Logarithm of the Determinant
glsObject

Fitted gls Object
residuals.nlmeStruct

Calculate nlmeStruct Residuals
formula.pdMat

Extract pdMat Formula
getGroups.corStruct

Extract corStruct Groups
corNatural

General correlation in natural parameterization
formula.varFunc

Extract varFunc Formula
logLik.gnlsStruct

Log-Likelihood of a gnlsStruct Object
formula.lme

Extract lme Object Formula
getCovariateFormula

Extract Covariates Formula
getData.gls

Extract gls Object Data
formula.reStruct

Extract reStruct Object Formula
gapply

Apply a Function by Groups
formula.pdBlocked

Extract pdBlocked Formula
formula.groupedData

Extract groupedData Formula
getGroups.data.frame

Extract Groups from a Data Frame
getCovariate.corStruct

Extract corStruct Object Covariate
getGroups.gls

Extract gls Object Groups
asOneFormula

Combine Formulas of a Set of Objects
as.matrix.pdMat

Matrix of a pdMat Object
fitted.gnlsStruct

Calculate gnlsStruct Fitted Values
logLik.lmList

Log-Likelihood of an lmList Object
getGroups

Extract Grouping Factors from an Object
getGroupsFormula

Extract Grouping Formula
comparePred

Compare Predictions
getGroups.varFunc

Extract varFunc Groups
getGroups.lme

Extract lme Object Groups
getResponse.lmList

Extract lmList Object Response
nlsList

List of nls Objects with a Common Model
getResponse.data.frame

Extract Response from a Data Frame
compareFits

Compare Fitted Objects
needUpdate.modelStruct

Check if a modelStruct Object Needs Updating
as.matrix.corStruct

Matrix of a corStruct Object
nlme.nlsList

NLME fit from nlsList Object
nlmeStruct

Nonlinear Mixed-Effects Structure
coef.gls

Extract gls Coefficients
coef.pdMat

pdMat Object Coefficients
summary.gls

Summarize a gls Object
varComb

Combination of Variance Functions
nlmeObject

Fitted nlme Object
residuals.glsStruct

Calculate glsStruct Residuals
predict.lme

Predictions from an lme Object
predict.lmList

Predictions from an lmList Object
print.modelStruct

Print a modelStruct Object
corRatio

Rational Quadratic Correlation Structure
getVarCov

Extract variance-covariance matrix
print.summary.gls

Print a summary.gls Object
plot.ACF

Plot an ACF Object
lmeScale

Scale for lme Optimization
glsControl

Control Values for gls Fit
pdBlocked

Positive-Definite Block Diagonal Matrix
gnlsObject

Fitted gnls Object
intervals.lmList

Confidence Intervals on lmList Coefficients
lmList.groupedData

lmList Fit from a groupedData Object
formula.gls

Extract gls Object Formula
print.pdMat

Print a pdMat Object
isInitialized

Check if Object is Initialized
lmeControl

Control Values for lme Fit
lmeObject

Fitted lme Object
intervals.gls

Confidence Intervals on gls Parameters
plot.nmGroupedData

Plot an nmGroupedData Object
getResponseFormula

Extract Formula Specifying Response Variable
lme

Linear Mixed-Effects Models
corGaus

Gaussian Correlation Structure
gnls

Fit Nonlinear Model Using Generalized Least Squares
corSpher

Spherical Correlation Structure
getGroups.lmList

Extract lmList Object Groups
print.corStruct

Print a corStruct Object
fitted.lme

Extract lme Fitted Values
getCovariate.varFunc

Extract varFunc Covariate
corLin

Linear Correlation Structure
lme.groupedData

LME fit from groupedData Object
pdNatural

General Positive-Definite Matrix in Natural Parametrization
coef.lmList

Extract lmList Coefficients
varConstPower

Constant Plus Power Variance Function
ranef.lmList

Extract lmList Random Effects
coef.pdDiag

pdDiag Object Coefficients
pdFactor.reStruct

Extract Square-Root Factor from Components of an reStruct Object
corMatrix

Extract Correlation Matrix
collapse.groupedData

Collapse a groupedData Object
balancedGrouped

Create a groupedData object from a matrix
formula.lmList

Extract lmList Object Formula
model.matrix.reStruct

reStruct Model Matrix
logLik.reStruct

Calculate reStruct Log-Likelihood
nlmeControl

Control Values for nlme Fit
nlme-internal

Internal nlme functions
needUpdate

Check if Update is Needed
ergoStool

Ergometrics experiment with stool types
MathAchSchool

School demographic data for MathAchieve
Nitrendipene

Assay of nitrendipene
Wafer

Modeling of Analog MOS Circuits
PBG

Effect of Phenylbiguanide on Blood Pressure
Alfalfa

Split-Plot Experiment on Varieties of Alfalfa
Orthodont

Growth curve data on an orthdontic measurement
RatPupWeight

The weight of rat pups
Muscle

Contraction of heart muscle sections
Ovary

Counts of Ovarian Follicles
Gun

Methods for firing naval guns
BodyWeight

Rat weight over time for different diets
Oxboys

Heights of Boys in Oxford
MathAchieve

Mathematics achievement scores
Phenobarb

Phenobarbitol Kinetics
Pixel

X-ray pixel intensities over time
Rail

Evaluation of Stress in Railway Rails
Tetracycline2

Pharmacokinetics of tetracycline
Meat

Tenderness of meat
Soybean

Growth of soybean plants
Oxide

Variability in Semiconductor Manufacturing
Earthquake

Earthquake Intensity
Oats

Split-plot Experiment on Varieties of Oats
Cefamandole

Pharmacokinetics of Cefamandole
Wheat2

Wheat Yield Trials
Remifentanil

Pharmacokinetics of remifentanil
Milk

Protein content of cows' milk
Quinidine

Quinidine Kinetics
Tetracycline1

Pharmacokinetics of tetracycline
Fatigue

Cracks caused by metal fatigue
Dialyzer

High-Flux Hemodialyzer
IGF

Radioimmunoassay of IGF-I Protein
Wheat

Yields by growing conditions
Glucose

Glucose levels over time
Relaxin

Assay for Relaxin
bdf

Language scores
Glucose2

Glucose Levels Following Alcohol Ingestion
Spruce

Growth of Spruce Trees
Assay

Bioassay on Cell Culture Plate
Gasoline

Refinery yield of gasoline
Machines

Productivity Scores for Machines and Workers