geeboost: GEEBoost

Description Usage Arguments Details Value See Also Examples

View source: R/geeboost.R

Description

Thresholded boosting for correlated data via GEE

Usage

1
2
geeboost(Y, X, id = 1:length(Y), family = "gaussian", corstr = "ind",
  traceplot = FALSE, ...)

Arguments

Y

Vector of (presumably correlated) outcomes

X

Matrix of predictors

id

Index indicating clusters of correlated observations

family

Outcome distribution to be used. "gaussian" (the default), "binomial", and "poisson" are currently implemented.

corstr

Working correlation structure to use. "ind" (for independence, the default) and "exch" (for exchanageable) are currently implemented.

traceplot

Option of whether or not to produce a traceplot of the coefficient values. See coef_traceplot for details.

...

Additional arguments to be passed to the threeboost function. See the threeboost help page for details.

Details

This function implements thresholded EEBoost for the Generalized Estimating Equations. The arguments are consistent with those used by geepack.

Value

A list with three entries:

See Also

threeboost

Wolfson, J. EEBoost: A general method for prediction and variable selection using estimating equations. Journal of the American Statistical Association, 2011.

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
30
31
32
33
34
35
36
37
38
39
40
41
# Generate some test data
library(mvtnorm)
library(Matrix)
n <- 30
n.var <- 50
clust.size <- 4

B <- c(rep(2,5),rep(0.2,5),rep(0.05,10),rep(0,n.var-20))
mn.X <- rep(0,n.var)
sd.X <- 0.5
rho.X <- 0.3
cov.sig.X <- sd.X^2*((1-rho.X)*diag(rep(1,10)) + rho.X*matrix(data=1,nrow=10,ncol=10))
sig.X <- as.matrix( Matrix::bdiag(lapply(1:(n.var/10),function(x) { cov.sig.X } ) ) )
sd.Y <- 0.5
rho.Y <- 0.3
indiv.Sig <- sd.Y^2*( (1-rho.Y)*diag(rep(1,4)) + rho.Y*matrix(data=1,nrow=4,ncol=4) )
sig.list <- list(length=n)
for(i in 1:n) { sig.list[[i]] <- indiv.Sig }
Sig <- Matrix::bdiag(sig.list)
indiv.index <- rep(1:n,each=clust.size)
sig.Y <- as.matrix(Sig)

if(require(mvtnorm)) {
X <- mvtnorm::rmvnorm(n*clust.size,mean=mn.X,sigma=sig.X)
mn.Y <- X %*% B
Y <- mvtnorm::rmvnorm(1,mean=mn.Y,sigma=sig.Y) ## Correlated continuous outcomes
expit <- function(x) { exp(x) / (1 + exp(x)) }
## Correlated binary outcomes
Y.bin <- rbinom(n*clust.size,1,p=expit(mvtnorm::rmvnorm(1,mean=mn.Y,sigma=sig.Y)))
Y.pois <- rpois(length(Y),lambda=exp(mn.Y)) ## Correlated Poisson outcomes
} else { stop('Need mvtnorm package to generate correlated data.')}

## Run EEBoost (w/ indep working correlation)
results.lin <- geeboost(Y,X,id=indiv.index,maxit=1000)
## Not run: 
 results.bin <- geeboost(Y.bin,X,id=indiv.index,family="binomial",maxit=1000)
 results.pois <- geeboost(Y.pois,X,id=indiv.index,family="poisson",maxit=1000,traceplot=TRUE)

## End(Not run)

print(results.lin$final.model)

Example output

[1] "Stopped due to oscillating values at iteration 742"
[1] "Stopped due to oscillating values at iteration 872"
    intcpts                                                             
-0.04083558  1.05000000  0.94000000  1.03000000  1.01000000  0.95000000 
                                                                        
 0.07000000  0.13000000  0.02000000  0.15000000  0.18000000  0.00000000 
                                                                        
 0.00000000  0.05000000  0.05000000  0.00000000  0.00000000  0.00000000 
                                                                        
 0.00000000  0.00000000  0.00000000  0.00000000  0.00000000  0.00000000 
                                                                        
 0.00000000  0.00000000  0.02000000  0.00000000  0.00000000  0.00000000 
                                                                        
 0.00000000  0.00000000 -0.02000000  0.00000000  0.00000000  0.00000000 
                                                                        
 0.00000000 -0.03000000  0.00000000  0.00000000  0.00000000  0.00000000 
                                                                        
 0.00000000  0.00000000  0.00000000  0.00000000  0.02000000  0.00000000 
                                    
 0.00000000  0.00000000  0.00000000 

threeboost documentation built on May 2, 2019, 2:37 a.m.