[R] APE: compar.gee( )

juli g. pausas juli at ceam.es
Sun Feb 8 18:38:40 CET 2004


Dear all,
I don't understand the following behaviour: Running  compar.gee   (in 
library ape ) with and without the option 'data', it give me different 
results
Example:

.... Start R ....
> load("eiber.RData")
> ls()
[1] "gee.na" "mydata" "mytree"
> library(ape) 
> # runnig with the option data= mydata
> compar.gee(alt ~ R, family="gaussian", data=mydata, phy=mytree) 
Loading required package: gee 
[1] "Beginning Cgee S-function, @(#) geeformula.q 4.13 98/01/27"
[1] "running glm to get initial regression estimate"
[1] 7.9500000 0.5155172

Call:
  formula: alt ~ R

Number of observations:  37 

Model:
 Link:                      identity 
 Variance to Mean Relation: gaussian 

Summary of Residuals:
        Min          1Q      Median          3Q         Max 
-12.1267954  -9.4267954  -7.4267954  -0.4267954  20.7903982 


Coefficients:
            Estimate     S.E.        t Pr(T > |t|)
(Intercept) 9.209602 4.760274 1.934679  0.08798892
R1          3.217194 2.548273 1.262500  0.24130121

Estimated Scale Parameter:  86.39367
"Phylogenetic" df (dfP):  10.24615 

> # Second way, without the option data (so attaching the dataframe)
> attach(mydata)
> compar.gee(alt ~ R, family="gaussian", phy=mytree) 
[1] "Beginning Cgee S-function, @(#) geeformula.q 4.13 98/01/27"
[1] "running glm to get initial regression estimate"
[1] 7.9500000 0.5155172

Call:
  formula: alt ~ R

Number of observations:  37 

Model:
 Link:                      identity 
 Variance to Mean Relation: gaussian 

Summary of Residuals:
       Min         1Q     Median         3Q        Max 
-14.123399 -11.423399  -8.856398  -1.856398  20.143602 


Coefficients:
            Estimate     S.E.        t Pr(T > |t|)
(Intercept) 9.856398 5.137029 1.918696  0.09020828
R1          4.567001 2.351966 1.941781  0.08701965

Estimated Scale Parameter:  103.2713
"Phylogenetic" df (dfP):  10.24615 
> search()
 [1] ".GlobalEnv"      "mydata"          "package:gee"     "package:ape"    
 [5] "package:methods" "package:ctest"   "package:mva"     "package:modreg" 
 [9] "package:nls"     "package:ts"      "Autoloads"       "package:base"   
> 

(R 1.8.1 for Windows
ape 1.2)



Note that the results are different.
Am I doing something wrong? Which is the correct answer?
Thanks for any help

Juli




More information about the R-help mailing list