~ubuntu-branches/ubuntu/breezy/lme4/breezy

« back to all changes in this revision

Viewing changes to R/AllClass.R

  • Committer: Bazaar Package Importer
  • Author(s): Douglas Bates
  • Date: 2005-05-20 09:30:11 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20050520093011-vp8clxugp8hbjejp
Tags: 0.95.8-1
* New upstream release
* Upstream release no longer requires r-cran-latticeextra. Closes: Bug#307497 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
.onLoad <- function(lib, pkg)
2
 
{
3
 
    if ("package:nlme" %in% search()) {
4
 
        stop(paste("Package lme4 conflicts with package nlme.\n",
5
 
                   "To attach lme4 you must restart R without package nlme."))
6
 
    }
7
 
}
 
1
## Class definitions for the package
8
2
 
9
3
setOldClass("data.frame")
10
4
setOldClass("family")
11
5
setOldClass("logLik")
12
6
setOldClass("terms")
13
7
 
14
 
setClass("lme", representation(call = "call",
15
 
                               facs = "list",
16
 
                               x = "list",
17
 
                               model = "data.frame",
18
 
                               REML = "logical",
19
 
                               rep = "ssclme",
20
 
                               fitted = "numeric",
21
 
                               residuals = "numeric",
22
 
                               terms = "terms",
23
 
                               assign = "integer"))
24
 
 
25
 
setClass("GLMM", representation(family = "family",
26
 
                                logLik = "numeric",
27
 
                                fixef = "numeric",
28
 
                                Hessian = "matrix",
29
 
                                method = "character"),
30
 
         contains = "lme")
31
 
 
32
8
setClass("lmList",
33
9
         representation(call = "call",
34
10
                        pool = "logical"),
40
16
                        useScale="logical"),
41
17
         prototype = list(scale = 1.0, useScale = TRUE))
42
18
 
43
 
setClass("summary.ssclme",
44
 
         representation(coefficients="matrix",
45
 
                        scale="numeric",
46
 
                        denomDF="integer",
47
 
                        REML="logical",
48
 
                        ngrps="integer",
49
 
                        nobs="integer",
50
 
                        corFixed="corrmatrix",
51
 
                        VarCorr="VarCorr",
52
 
                        useScale="logical",
53
 
                        showCorrelation="logical"
54
 
                        ))
55
 
 
56
 
setClass("summary.lme",
57
 
         representation(call = "call",
 
19
## mixed effects representation
 
20
setClass("mer",
 
21
         representation(
 
22
                        flist = "list", # list of grouping factors
 
23
                        perm = "list",  # list of permutations of levels (0-based)
 
24
                        Parent = "list",# list of Parent arrays for ZZpO
 
25
                        D = "list",     # list of diagonal factors (upper triangle)
 
26
                        bVar = "list",  # list of conditional variance factors (upper triangle)
 
27
                        L = "list",     # list of blocks of L
 
28
                        ZZpO = "list",  # list of diagonal blocks of Z'Z+Omega
 
29
                        Omega = "list", # list of relative precision matrices
 
30
                        REML = "logical", 
 
31
                        RXX = "matrix", # Augmented RXX component or its inverse
 
32
                        RZX = "matrix", # Augmented RZX component or its inverse
 
33
                        XtX = "matrix", # Original X'X matrix
 
34
                        ZtZ = "list",   # list of blocks of Z'Z
 
35
                        ZtX = "matrix", # Original Z'X matrix
 
36
                        cnames = "list",# column names of model matrices
 
37
                        devComp = "numeric", # Components of deviance
 
38
                        deviance = "numeric", # Current deviance (ML and REML)
 
39
                        nc = "integer", # number of columns in (augmented)
 
40
                                        # model matrices and number of observations
 
41
                        Gp = "integer", # Pointers to groups of rows in RZX
 
42
                        status = "logical"
 
43
                        ),
 
44
         validity = function(object) {
 
45
             .Call("lmer_validate", object, PACKAGE = "Matrix")
 
46
         })
 
47
 
 
48
## Representation of a linear mixed effects model
 
49
setClass("lmer",
 
50
         representation(call = "call", terms = "terms",
 
51
                        assign = "integer", fitted = "numeric",
 
52
                        residuals = "numeric", frame = "data.frame"),
 
53
         contains = "mer")
 
54
                                
 
55
## Representation of a generalized linear mixed effects model
 
56
setClass("glmer",
 
57
         representation(family = "family", glmmll = "numeric",
 
58
                        method = "character", fixed = "numeric"),
 
59
         contains = "lmer")
 
60
 
 
61
setClass("summary.lmer",
 
62
         representation(useScale="logical",
 
63
                        showCorrelation="logical",
 
64
                        method = "character",
 
65
                        family = "family",
58
66
                        logLik = "logLik",
59
 
                        re = "summary.ssclme",
60
 
                        residuals = "numeric"))
61
 
 
62
 
setClass("summary.GLMM", representation(family = "family"),
63
 
         contains = "summary.lme")
 
67
                        fixed = "numeric"),
 
68
         contains = "lmer")
 
69
 
 
70
setClass("lmList.confint", contains = "array")
 
71
 
 
72
setClass("lmer.ranef",
 
73
         representation(varFac = "list", stdErr = "numeric"),
 
74
         contains = "list")
 
75
 
 
76
setClass("lmer.ranef.confint", contains = "list")
 
77
 
 
78
setClass("lmer.coef",
 
79
         representation(varFac = "list", stdErr = "numeric"),
 
80
         contains = "list")
 
81
 
 
82
 
 
83