Yet Another GEE Solver

Description

Solves GEEs in an extensible way, with a C++ engine. $Header: /udd/stvjc/VCROOT/yags/man/yags.Rd,v 5.1 2007/12/11 16:57:19 stvjc Exp $

Usage

1
2
3
4
yags(formula, id, cor.met=NULL, family=gaussian(), corstruct="independence", 
    control=yags.control(), weights=NULL, betainit=NULL, alphainit=NULL, 
    data=list(), subset=NULL, allcrit=FALSE, lhetfam= NULL, qhetfam = NULL,
    icritalp = NULL, critar1tag = "ar1")

Arguments

formula

GLM formula

id

numeric vector of cluster discriminators; data assumed sorted by this vector

cor.met

correlation metameter: vector of observation times for longitudinal data, matrix of coordinates for other designs. If unstructured working correlation, this must have nonnegative integer values with zero origin.

family

GLM family – can use default (gaussian – linear link, constant variance), poisson() (log link, variance = mean), Gamma() (reciprocal link, variance = mu*mu), binomial (logit link, binomial variance), quasi(link=log, var=mu^2), quasi(link = "identity", var=mu), or quasi(link=:identity:, var=mu^2)

corstruct

string describing working correlation model. For Wang and Carey 2004 JASA article structure, use "UQ.fom"

Other options are "independence", "exchangeable", "UJ.fom", "ar1", "unstructured".

control

list of control parameters, see yags.control()

weights

vector of weights

betainit

initial value of regression parameters

alphainit

initial value of working correlation model parameters

data

data source for model fit

subset

expression selecting a subset for fitting

allcrit

logical – if TRUE, compute all criteria for candidate models

lhetfam

the glm family object defining the candidate model expressing linear heteroskedasticity

qhetfam

the glm family object defining the candidate model expressing quadratic heteroskedasticity

icritalp

numeric initial value of alpha parameter for candidate model fits for criteria computation

critar1tag

string defining the corstruct to be used for candidate model fits

Value

see yags.object

Author(s)

VJ Carey, stvjc@gauss.med.harvard.edu

References

Liang KY, Zeger SL. Biometrika 1986

See Also

glm

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#
# trivial demo
#
library(methods)
data(stackloss)
Y1 <- yags(stack.loss~Air.Flow,id=1:21, data=stackloss)
#
# spruce examples for gaussian family and various corstructs
#
data(Spruce)
SPRind <- yags(y~Time+treated,id=Subject,data=Spruce)
SPRexc <- yags(y~Time+treated,id=Subject,data=Spruce,
		corstr="exchangeable", alphainit=0.)
# unstructured:
SPRuns <- yags(y~Time+treated,id=Subject,data=Spruce,
		corstr="unstructured", alphainit=rep(.1,45),
                cor.met=as.double(rep(0:9,79)))
# U_J of Wang and Carey JASA 2004
SPRUJ <- yags(y~Time+treated,id=Subject,data=Spruce,
		corstr="UJ.fom", alphainit=.1,
                cor.met=as.double(rep(0:9,79)))
#
# some criteria of adequacy over ranges of models
SPRUJ <- yags(y~Time+treated,id=Subject,data=Spruce,
                corstr="ar1", alphainit=.1,
                cor.met=as.double(rep(0:9,79)), allcrit=TRUE,
                  lhetfam=quasi(variance="mu"), qhetfam=quasi(variance="mu^2"))
sort(SPRUJ@m2LG)
sort(SPRUJ@del1)