heavyLme: Linear mixed-effects models under heavy-tailed distributions

Description Usage Arguments Value References Examples

View source: R/lme.R

Description

This function fits a linear mixed-effects model under heavy-tailed errors using the formulation described in Pinheiro et al. (2001).

Usage

1
2
heavyLme(fixed, random, groups, data, family = Student(df = 4),
  subset, na.action, control)

Arguments

fixed

a two-sided linear formula object describing the fixed-effects part of the model, with the response on the left of a ~ operator and the terms, separated by + operators.

random

a one-sided formula of the form ~x1+...+xn specifying the model for the random effects.

groups

a one-sided formula for specifying the grouping variable.

data

an optional data frame containing the variables named in fixed, random and group. By default the variables are taken from the environment from which heavy.lme is called.

family

a description of the error distribution to be used in the model. By default the Student-t distribution with 4 degrees of freedom is considered.

subset

an optional expression indicating the subset of the rows of data that should be used in the fitting process.

na.action

a function that indicates what should happen when the data contain NAs.

control

a list of control values for the estimation algorithm to replace the default values returned by the function heavy.control.

Value

An object of class heavyLme representing the linear mixed-effects model fit. Generic function print and summary, show the results of the fit.

The following components must be included in a legitimate heavyLme object.

lmeData

an object representing a list of mixed-effects model components.

call

a list containing an image of the heavyLme call that produced the object.

family

the heavy.family object used, with the estimated shape parameters (if requested).

coefficients

final estimate of the fixed effects.

theta

final estimate of the scale parameters associated to the random effects.

scale

final scale estimate of the random error.

logLik

the log-likelihood at convergence.

numIter

the number of iterations used in the iterative algorithm.

ranef

a matrix with the estimated random effects.

weights

estimated weights corresponding to the assumed heavy-tailed distribution.

distances

estimated squared Mahalanobis distances.

Fitted

a data frame with the "marginal" and "conditional" fitted values as columns.

Resid

a data frame with the "marginal" and "conditional" residuals as columns.

References

Pinheiro, J.C., Liu, C., and Wu, Y.N. (2001). Efficient algorithms for robust estimation in linear mixed-effects models using the multivariate t distribution. Journal of Computational and Graphical Statistics 10, 249–276.

Examples

1
2
3
4
5
6
7
8
9
data(dental)
fm0 <- heavyLme(distance ~ age * Sex, random = ~ age, groups = ~ Subject,
  data = dental, family = Student(df = 4))
summary(fm0)

# fitting model with fixed degrees of freedom
fm1 <- heavyLme(distance ~ age * Sex, random = ~ age, groups = ~ Subject,
  data = dental, family = Student(df = 4), control = heavy.control(fix.shape = TRUE))
summary(fm1) # fixed at df = 4

Example output

Linear mixed-effects model under heavy-tailed distributions
 Data: dental; Family: Student(df = 5.57571) 
 Log-likelihood: -213.6174 

Random effects:
 Formula: ~age; Groups: ~Subject 
 Scale matrix estimate:
            (Intercept) age        
(Intercept)  3.99479782            
age         -0.23905366  0.04887959
Within-Group scale parameter: 0.8829409 

Fixed: distance ~ age * Sex 
              Estimate Std.Error Z-value p-value
(Intercept)   16.9819   1.6995    9.9922  0.0000
age            0.7170   0.1677    4.2765  0.0000
SexFemale      0.6798   2.6626    0.2553  0.7985
age:SexFemale -0.0678   0.2627   -0.2579  0.7965

Number of Observations: 108 
Number of Groups: 27 
Linear mixed-effects model under heavy-tailed distributions
 Data: dental; Family: Student(df = 4) 
 Log-likelihood: -213.8493 

Random effects:
 Formula: ~age; Groups: ~Subject 
 Scale matrix estimate:
            (Intercept) age        
(Intercept)  3.78322192            
age         -0.22618058  0.04693866
Within-Group scale parameter: 0.8276335 

Fixed: distance ~ age * Sex 
              Estimate Std.Error Z-value p-value
(Intercept)   17.0353   1.6768   10.1594  0.0000
age            0.7108   0.1661    4.2788  0.0000
SexFemale      0.6622   2.6270    0.2521  0.8010
age:SexFemale -0.0657   0.2603   -0.2524  0.8008

Number of Observations: 108 
Number of Groups: 27 

heavy documentation built on Oct. 30, 2019, 9:48 a.m.

Related to heavyLme in heavy...