compar.gee: Comparative Analysis with GEEs

Description Usage Arguments Details Value Note Author(s) References See Also Examples

View source: R/compar.gee.R

Description

compar.gee performs the comparative analysis using generalized estimating equations as described by Paradis and Claude (2002).

drop1 tests single effects of a fitted model output from compar.gee.

predict returns the predicted (fitted) values of the model.

Usage

1
2
3
4
5
6
compar.gee(formula, data = NULL, family = "gaussian", phy, corStruct,
          scale.fix = FALSE, scale.value = 1)
## S3 method for class 'compar.gee'
drop1(object, scope, quiet = FALSE, ...)
## S3 method for class 'compar.gee'
predict(object, newdata = NULL, type = c("link", "response"), ...)

Arguments

formula

a formula giving the model to be fitted.

data

the name of the data frame where the variables in formula are to be found; by default, the variables are looked for in the global environment.

family

a function specifying the distribution assumed for the response; by default a Gaussian distribution (with link identity) is assumed (see ?family for details on specifying the distribution, and on changing the link function).

phy

an object of class "phylo" (ignored if corStruct is used).

corStruct

a (phylogenetic) correlation structure.

scale.fix

logical, indicates whether the scale parameter should be fixed (TRUE) or estimated (FALSE, the default).

scale.value

if scale.fix = TRUE, gives the value for the scale (default: scale.value = 1).

object

an object of class "compar.gee" resulting from fitting compar.gee.

scope

<unused>.

quiet

a logical specifying whether to display a warning message about eventual “marginality principle violation”.

newdata

a data frame with column names matching the variables in the formula of the fitted object (see predict for details).

type

a character string specifying the type of predicted values. By default, the linear (link) prediction is returned.

...

further arguments to be passed to drop1.

Details

If a data frame is specified for the argument data, then its rownames are matched to the tip labels of phy. The user must be careful here since the function requires that both series of names perfectly match, so this operation may fail if there is a typing or syntax error. If both series of names do not match, the values in the data frame are taken to be in the same order than the tip labels of phy, and a warning message is issued.

If data = NULL, then it is assumed that the variables are in the same order than the tip labels of phy.

Value

compar.gee returns an object of class "compar.gee" with the following components:

call

the function call, including the formula.

effect.assign

a vector of integers assigning the coefficients to the effects (used by drop1).

nobs

the number of observations.

QIC

the quasilikelihood information criterion as defined by Pan (2001).

coefficients

the estimated coefficients (or regression parameters).

residuals

the regression residuals.

family

a character string, the distribution assumed for the response.

link

a character string, the link function used for the mean function.

scale

the scale (or dispersion parameter).

W

the variance-covariance matrix of the estimated coefficients.

dfP

the phylogenetic degrees of freedom (see Paradis and Claude for details on this).

drop1 returns an object of class "anova".

predict returns a vector or a data frame if newdata is used.

Note

The calculation of the phylogenetic degrees of freedom is likely to be approximative for non-Brownian correlation structures (this will be refined soon).

The calculation of the quasilikelihood information criterion (QIC) needs to be tested.

Author(s)

Emmanuel Paradis

References

Pan, W. (2001) Akaike's information criterion in generalized estimating equations. Biometrics, 57, 120–125.

Paradis, E. and Claude J. (2002) Analysis of comparative data using generalized estimating equations. Journal of theoretical Biology, 218, 175–185.

See Also

read.tree, pic, compar.lynch, drop1

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
### The example in Phylip 3.5c (originally from Lynch 1991)
### (the same analysis than in help(pic)...)
tr <- "((((Homo:0.21,Pongo:0.21):0.28,Macaca:0.49):0.13,Ateles:0.62):0.38,Galago:1.00);"
tree.primates <- read.tree(text = tr)
X <- c(4.09434, 3.61092, 2.37024, 2.02815, -1.46968)
Y <- c(4.74493, 3.33220, 3.36730, 2.89037, 2.30259)
### Both regressions... the results are quite close to those obtained
### with pic().
compar.gee(X ~ Y, phy = tree.primates)
compar.gee(Y ~ X, phy = tree.primates)
### Now do the GEE regressions through the origin: the results are quite
### different!
compar.gee(X ~ Y - 1, phy = tree.primates)
compar.gee(Y ~ X - 1, phy = tree.primates)

Example output

Beginning Cgee S-function, @(#) geeformula.q 4.13 98/01/27
running glm to get initial regression estimate
(Intercept)           Y 
  -4.559093    2.009296 
Beginning Cgee S-function, @(#) geeformula.q 4.13 98/01/27
running glm to get initial regression estimate
(Intercept)           Y 
  -4.559093    2.009296 
Call: compar.gee(formula = X ~ Y, phy = tree.primates)
Number of observations:  5 
Model:
                      Link: identity 
 Variance to Mean Relation: gaussian 

QIC: 20.4241 

Summary of Residuals:
       Min         1Q     Median         3Q        Max 
-1.9460519  0.8312820  0.9651706  1.1805002  2.1069920 


Coefficients:
              Estimate      S.E.          t Pr(T > |t|)
(Intercept) -1.8216247 2.5273632 -0.7207609   0.5770502
Y            0.9980051 0.7410169  1.3468048   0.3637334

Estimated Scale Parameter:  3.747566
"Phylogenetic" df (dfP):  3.32 
Beginning Cgee S-function, @(#) geeformula.q 4.13 98/01/27
running glm to get initial regression estimate
(Intercept)           X 
  2.5989768   0.3425349 
Beginning Cgee S-function, @(#) geeformula.q 4.13 98/01/27
running glm to get initial regression estimate
(Intercept)           X 
  2.5989768   0.3425349 
Call: compar.gee(formula = Y ~ X, phy = tree.primates)
Number of observations:  5 
Model:
                      Link: identity 
 Variance to Mean Relation: gaussian 

QIC: 9.239319 

Summary of Residuals:
       Min         1Q     Median         3Q        Max 
-0.7275418 -0.4857216 -0.1565515  0.4373258  0.4763833 


Coefficients:
             Estimate      S.E.        t Pr(T > |t|)
(Intercept) 2.5000672 0.4325167 5.780279  0.06773259
X           0.4319328 0.1597932 2.703074  0.17406821

Estimated Scale Parameter:  0.4026486
"Phylogenetic" df (dfP):  3.32 
Beginning Cgee S-function, @(#) geeformula.q 4.13 98/01/27
running glm to get initial regression estimate
        Y 
0.7151854 
Beginning Cgee S-function, @(#) geeformula.q 4.13 98/01/27
running glm to get initial regression estimate
        Y 
0.7151854 
Call: compar.gee(formula = X ~ Y - 1, phy = tree.primates)
Number of observations:  5 
Model:
                      Link: identity 
 Variance to Mean Relation: gaussian 

QIC: 18.26341 

Summary of Residuals:
       Min         1Q     Median         3Q        Max 
-2.6818546  0.5065447  0.5975598  1.5964208  1.8567179 


Coefficients:
   Estimate      S.E.        t Pr(T > |t|)
Y 0.5264396 0.3338464 1.576892    0.238429

Estimated Scale Parameter:  3.450493
"Phylogenetic" df (dfP):  3.32 
Beginning Cgee S-function, @(#) geeformula.q 4.13 98/01/27
running glm to get initial regression estimate
       X 
1.005403 
Beginning Cgee S-function, @(#) geeformula.q 4.13 98/01/27
running glm to get initial regression estimate
       X 
1.005403 
Call: compar.gee(formula = Y ~ X - 1, phy = tree.primates)
Number of observations:  5 
Model:
                      Link: identity 
 Variance to Mean Relation: gaussian 

QIC: 22.25351 

Summary of Residuals:
      Min        1Q    Median        3Q       Max 
0.3139433 1.1951019 1.3225974 1.3860895 3.5310502 


Coefficients:
   Estimate      S.E.        t Pr(T > |t|)
X 0.8358692 0.4759221 1.756315   0.2034785

Estimated Scale Parameter:  4.416413
"Phylogenetic" df (dfP):  3.32 

ape documentation built on April 25, 2021, 9:06 a.m.