Last data update: 2014.03.03

R: Fit Generalized Semiparametric Mixed-Effects Models
bGAMMR Documentation

Fit Generalized Semiparametric Mixed-Effects Models

Description

Fit a semiparametric mixed model or a generalized semiparametric mixed model.

Usage

bGAMM(fix=formula, add=formula, rnd=formula, 
      data, lambda, family = NULL, control = list())

Arguments

fix

a two-sided linear formula object describing the fixed-effects part of the model, with the response on the left of a ~ operator and the terms, separated by + operators, on the right. For categorical covariables use as.factor(.) in the formula. Note, that the corresponding dummies are treated as a group and are updated blockwise

add

a one-sided linear formula object describing the additive part of the model, with the additive terms on the right side of a ~ operator, separated by + operators. The smooth terms are expanded in B-spline basis functions, with a difference penalty apllied on adjacent spline coefficients.

rnd

a two-sided linear formula object describing the random-effects part of the model, with the grouping factor on the left of a ~ operator and the random terms, separated by + operators, on the right.

data

the data frame containing the variables named in formula.

lambda

the smoothing parameter that controls the smoothness of the additive terms. The optimal smoothing parameter is a tuning parameter of the procedure that has to be determined, e.g. by use of information criteria or cross validation.

family

a GLM family, see glm and family. If family is missing then a linear mixed model is fit; otherwise a generalized linear mixed model is fit.

control

a list of control values for the estimation algorithm to replace the default values returned by the function bGAMMControl. Defaults to an empty list.

Value

Generic functions such as print, predict, summary and plot have methods to show the results of the fit. The predict function uses also estimates of random effects for prediction, if possible (i.e. for known subjects of the grouping factor). The plot function shows the estimated smooth functions. Single functions can be specified by a suitable vector in the which argument. Default is which=Null and all smooth functions (up to a maximum of nine) are shown.

call

a list containing an image of the bGLMM call that produced the object.

coefficients

a vector containing the estimated fixed effects

ranef

a vector containing the estimated random effects.

spline.weights

a vector containing the estimated spline coefficients.

StdDev

a scalar or matrix containing the estimates of the random effects standard deviation or variance-covariance parameters, respectively.

fitted.values

a vector of fitted values.

phi

estimated scale parameter, if overdispersion=TRUE is used. Otherwise, it is equal to one.

HatMatrix

hat matrix corresponding to the final fit.

IC

a matrix containing the evaluated information criterion for the different covariates (columns) and for each boosting iteration (rows).

IC_sel

a vector containing the evaluated information criterion for the selected covariate at different boosting iterations.

components

a vector containing the selected components at different boosting iterations.

opt

number of optimal boosting steps with respect to AIC or BIC, respectively, if OPT=TRUE. Otherwise, opt is equal to the number of iterations. Note, that the boosting algorithm is also stopped, if it has converged with respect to the parameter estimates [coefficients,ranef] or with respect to the IC_sel.

Deltamatrix

a matrix containing the estimates of fixed and random effects (columns) for each boosting iteration (rows).

Q_long

a list containing the estimates of the random effects standard deviation or variance-covariance parameters, respectively, for each boosting iteration.

fixerror

a vector with standrad errors for the fixed effects.

ranerror

a vector with standrad errors for the random effects.

smootherror

a matrix with pointwise standard errors for the smooth function estimates.

Author(s)

Andreas Groll andreas.groll@stat.uni-muenchen.de

References

Groll, A. and G. Tutz (2012). Regularization for Generalized Additive Mixed Models by Likelihood-Based Boosting. Methods of Information in Medicine 51(2), 168–177.

See Also

bGAMMControl

Examples

  
data("soccer")

gamm1 <- bGAMM(points ~ ball.possession + tackles,
         ~ transfer.spendings + transfer.receits 
         + unfair.score + ave.attend + sold.out,
         rnd = list(team=~1), data = soccer, lambda = 1e+5,
         family = poisson(link = log), control = list(steps=200, overdispersion=TRUE,
         start=c(1,rep(0,25))))

plot(gamm1)

# see also demo("bGAMM-soccer")

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(GMMBoost)
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/GMMBoost/bGAMM.rd_%03d_medium.png", width=480, height=480)
> ### Name: bGAMM
> ### Title: Fit Generalized Semiparametric Mixed-Effects Models
> ### Aliases: bGAMM
> ### Keywords: models methods
> 
> ### ** Examples
>   
> data("soccer")
> 
> gamm1 <- bGAMM(points ~ ball.possession + tackles,
+          ~ transfer.spendings + transfer.receits 
+          + unfair.score + ave.attend + sold.out,
+          rnd = list(team=~1), data = soccer, lambda = 1e+5,
+          family = poisson(link = log), control = list(steps=200, overdispersion=TRUE,
+          start=c(1,rep(0,25))))
[1] "Iteration 1"
[1] "Iteration 2"
[1] "Iteration 3"
[1] "Iteration 4"
[1] "Iteration 5"
[1] "Iteration 6"
[1] "Iteration 7"
[1] "Iteration 8"
[1] "Iteration 9"
[1] "Iteration 10"
[1] "Iteration 11"
[1] "Iteration 12"
[1] "Iteration 13"
[1] "Iteration 14"
[1] "Iteration 15"
[1] "Iteration 16"
[1] "Iteration 17"
[1] "Iteration 18"
[1] "Iteration 19"
[1] "Iteration 20"
[1] "Iteration 21"
[1] "Iteration 22"
[1] "Iteration 23"
[1] "Iteration 24"
[1] "Iteration 25"
[1] "Iteration 26"
[1] "Iteration 27"
[1] "Iteration 28"
[1] "Iteration 29"
[1] "Iteration 30"
[1] "Iteration 31"
[1] "Iteration 32"
[1] "Iteration 33"
[1] "Iteration 34"
[1] "Iteration 35"
[1] "Iteration 36"
[1] "Iteration 37"
[1] "Iteration 38"
[1] "Iteration 39"
[1] "Iteration 40"
[1] "Iteration 41"
[1] "Iteration 42"
[1] "Iteration 43"
[1] "Iteration 44"
[1] "Iteration 45"
[1] "Iteration 46"
[1] "Iteration 47"
[1] "Iteration 48"
[1] "Iteration 49"
[1] "Iteration 50"
[1] "Iteration 51"
[1] "Iteration 52"
[1] "Iteration 53"
[1] "Iteration 54"
[1] "Iteration 55"
[1] "Iteration 56"
[1] "Iteration 57"
[1] "Iteration 58"
[1] "Iteration 59"
[1] "Iteration 60"
[1] "Iteration 61"
[1] "Iteration 62"
[1] "Iteration 63"
[1] "Iteration 64"
[1] "Iteration 65"
[1] "Iteration 66"
[1] "Iteration 67"
[1] "Iteration 68"
[1] "Iteration 69"
[1] "Iteration 70"
[1] "Iteration 71"
[1] "Iteration 72"
[1] "Iteration 73"
[1] "Iteration 74"
[1] "Iteration 75"
[1] "Iteration 76"
[1] "Iteration 77"
[1] "Iteration 78"
[1] "Iteration 79"
[1] "Iteration 80"
[1] "Iteration 81"
[1] "Iteration 82"
[1] "Iteration 83"
[1] "Iteration 84"
[1] "Iteration 85"
[1] "Iteration 86"
[1] "Iteration 87"
[1] "Iteration 88"
[1] "Iteration 89"
[1] "Iteration 90"
[1] "Iteration 91"
[1] "Iteration 92"
[1] "Iteration 93"
[1] "Iteration 94"
[1] "Iteration 95"
[1] "Iteration 96"
[1] "Iteration 97"
[1] "Iteration 98"
[1] "Iteration 99"
[1] "Iteration 100"
[1] "Iteration 101"
[1] "Iteration 102"
[1] "Iteration 103"
[1] "Iteration 104"
[1] "Iteration 105"
[1] "Iteration 106"
[1] "Iteration 107"
[1] "Iteration 108"
[1] "Iteration 109"
[1] "Iteration 110"
[1] "Iteration 111"
[1] "Iteration 112"
[1] "Iteration 113"
[1] "Iteration 114"
[1] "Iteration 115"
[1] "Iteration 116"
[1] "Iteration 117"
[1] "Iteration 118"
[1] "Iteration 119"
[1] "Iteration 120"
[1] "Iteration 121"
[1] "Iteration 122"
[1] "Iteration 123"
[1] "Iteration 124"
[1] "Iteration 125"
[1] "Iteration 126"
[1] "Iteration 127"
[1] "Iteration 128"
[1] "Iteration 129"
[1] "Iteration 130"
[1] "Iteration 131"
[1] "Iteration 132"
[1] "Iteration 133"
[1] "Iteration 134"
[1] "Iteration 135"
[1] "Iteration 136"
[1] "Iteration 137"
[1] "Iteration 138"
[1] "Iteration 139"
[1] "Iteration 140"
[1] "Iteration 141"
[1] "Iteration 142"
[1] "Iteration 143"
[1] "Iteration 144"
[1] "Iteration 145"
[1] "Iteration 146"
[1] "Iteration 147"
[1] "Iteration 148"
[1] "Iteration 149"
[1] "Iteration 150"
[1] "Iteration 151"
[1] "Iteration 152"
[1] "Iteration 153"
[1] "Iteration 154"
[1] "Iteration 155"
[1] "Iteration 156"
[1] "Iteration 157"
[1] "Iteration 158"
[1] "Iteration 159"
[1] "Iteration 160"
[1] "Iteration 161"
[1] "Iteration 162"
[1] "Iteration 163"
[1] "Iteration 164"
[1] "Iteration 165"
[1] "Iteration 166"
[1] "Iteration 167"
[1] "Iteration 168"
[1] "Iteration 169"
[1] "Iteration 170"
[1] "Iteration 171"
[1] "Iteration 172"
[1] "Iteration 173"
[1] "Iteration 174"
[1] "Iteration 175"
[1] "Iteration 176"
[1] "Iteration 177"
[1] "Iteration 178"
[1] "Iteration 179"
[1] "Iteration 180"
[1] "Iteration 181"
[1] "Iteration 182"
[1] "Iteration 183"
[1] "Iteration 184"
[1] "Iteration 185"
[1] "Iteration 186"
[1] "Iteration 187"
[1] "Iteration 188"
[1] "Iteration 189"
[1] "Iteration 190"
[1] "Iteration 191"
[1] "Iteration 192"
[1] "Iteration 193"
[1] "Iteration 194"
[1] "Iteration 195"
[1] "Iteration 196"
[1] "Iteration 197"
[1] "Iteration 198"
[1] "Iteration 199"
[1] "Iteration 200"
> 
> plot(gamm1)
> 
> # see also demo("bGAMM-soccer")
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>