R : Copyright 2005, The R Foundation for Statistical Computing Version 2.1.1 (2005-06-20), ISBN 3-900051-07-0 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 a HTML browser interface to help. Type 'q()' to quit R. > ### *
> ### > attach(NULL, name = "CheckExEnv") > assign(".CheckExEnv", as.environment(2), pos = length(search())) # base > ## add some hooks to label plot pages for base and grid graphics > setHook("plot.new", ".newplot.hook") > setHook("persp", ".newplot.hook") > setHook("grid.newpage", ".gridplot.hook") > > assign("cleanEx", + function(env = .GlobalEnv) { + rm(list = ls(envir = env, all.names = TRUE), envir = env) + RNGkind("default", "default") + set.seed(1) + options(warn = 1) + delayedAssign("T", stop("T used instead of TRUE"), + assign.env = .CheckExEnv) + delayedAssign("F", stop("F used instead of FALSE"), + assign.env = .CheckExEnv) + sch <- search() + newitems <- sch[! sch %in% .oldSearch] + for(item in rev(newitems)) + eval(substitute(detach(item), list(item=item))) + missitems <- .oldSearch[! .oldSearch %in% sch] + if(length(missitems)) + warning("items ", paste(missitems, collapse=", "), + " have been removed from the search path") + }, + env = .CheckExEnv) > assign("..nameEx", "__{must remake R-ex/*.R}__", env = .CheckExEnv) # for now > assign("ptime", proc.time(), env = .CheckExEnv) > grDevices::postscript("glmmML-Examples.ps") > assign("par.postscript", graphics::par(no.readonly = TRUE), env = .CheckExEnv) > options(contrasts = c(unordered = "contr.treatment", ordered = "contr.poly")) > options(warn = 1) > library('glmmML') > > assign(".oldSearch", search(), env = .CheckExEnv) > assign(".oldNS", loadedNamespaces(), env = .CheckExEnv) > cleanEx(); ..nameEx <- "glmmML" > > ### * glmmML > > flush(stderr()); flush(stdout()) > > ### Name: glmmML > ### Title: Generalized Linear Models with random intercept > ### Aliases: glmmML > ### Keywords: regression > > ### ** Examples > > id <- factor(rep(1:20, rep(5, 20))) > y <- rbinom(100, prob = rep(runif(20), rep(5, 20)), size = 1) > x <- rnorm(100) > dat <- data.frame(y = y, x = x, id = id) > glmmML(y ~ x, data = dat, cluster = id) Call: glmmML(formula = y ~ x, data = dat, cluster = id) coef se(coef) z Pr(>|z|) (Intercept) 0.4878 0.4332 1.126 0.260 x 0.1387 0.2938 0.472 0.637 Standard deviation in mixing distribution: 1.511 Std. Error: 0.4922 Residual deviance: 124.8 on 97 degrees of freedom AIC: 130.8 > > > > cleanEx(); ..nameEx <- "glmmML.fit" > > ### * glmmML.fit > > flush(stderr()); flush(stdout()) > > ### Name: glmmML.fit > ### Title: Generalized Linear Model with random intercept > ### Aliases: glmmML.fit > ### Keywords: regression > > ### ** Examples > > x <- cbind(rep(1, 14), rnorm(14)) > y <- rbinom(14, prob = 0.5, size = 1) > id <- rep(1:7, 2) > > glmmML.fit(x, y, cluster = id, mixed = TRUE, method = 1) $beta [1] 0.5353834 0.6468762 $sigma [1] 2.193987 $loglik [1] -8.720531 $coef.variance [,1] [,2] [1,] 1.4174344 0.2655526 [2,] 0.2655526 1.1151869 $sigma.variance [1] 4.614609 $frail [1] 0.75920696 -0.22808166 -0.91905638 0.54919344 -1.06570998 -0.02043518 [7] 0.92182042 $residuals function (object, ...) UseMethod("residuals") $fitted.values [1] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 $family Family: binomial Link function: logit $deviance [1] 17.44106 $aic [1] 23.44106 $df.residual [1] 11 $df.null [1] 13 $convergence [1] 1 > > > > > cleanEx(); ..nameEx <- "glmmboot" > > ### * glmmboot > > flush(stderr()); flush(stdout()) > > ### Name: glmmboot > ### Title: Generalized Linear Models with fixed effects grouping > ### Aliases: glmmboot > ### Keywords: regression nonlinear > > ### ** Examples > > id <- factor(rep(1:20, rep(5, 20))) > y <- rbinom(100, prob = rep(runif(20), rep(5, 20)), size = 1) > x <- rnorm(100) > dat <- data.frame(y = y, x = x, id = id) > res <- glmmboot(y ~ x, cluster = id, data = dat, boot = 5000) > ##system.time(res.glm <- glm(y ~ x + id, family = binomial)) > > > > cleanEx(); ..nameEx <- "print.glmmML" > > ### * print.glmmML > > flush(stderr()); flush(stdout()) > > ### Name: print.glmmML > ### Title: Prints a 'glmmML' object. > ### Aliases: print.glmmML > ### Keywords: print > > ### ** Examples > > ## The function is currently defined as > function (x, digits = max(3, getOption("digits") - 3), na.print = "", + ...) + { + cat("\nCall: ", deparse(x$call), "\n\n") + cat("Coefficients:\n") + print.default(format(x$coefficients, digits = digits), print.gap = 2, + quote = FALSE) + cat("Standard errors:\n") + print.default(format(x$sd, digits = digits), print.gap = 2, + quote = FALSE) + if(x$mixed){ + cat("Standard deviation in mixing distribution: ", x$sigma, "\n") + cat("Std. Error: ", x$sigma.sd, "\n") + } + cat("\nDegrees of Freedom:", + x$df.residual, "Residual\n") + cat("Residual Deviance:", + format(signif(x$deviance, digits)), + "\tAIC:", + format(signif(x$aic, digits)), "\n") + invisible(x) + } function (x, digits = max(3, getOption("digits") - 3), na.print = "", ...) { cat("\nCall: ", deparse(x$call), "\n\n") cat("Coefficients:\n") print.default(format(x$coefficients, digits = digits), print.gap = 2, quote = FALSE) cat("Standard errors:\n") print.default(format(x$sd, digits = digits), print.gap = 2, quote = FALSE) if (x$mixed) { cat("Standard deviation in mixing distribution: ", x$sigma, "\n") cat("Std. Error: ", x$sigma.sd, "\n") } cat("\nDegrees of Freedom:", x$df.residual, "Residual\n") cat("Residual Deviance:", format(signif(x$deviance, digits)), "\tAIC:", format(signif(x$aic, digits)), "\n") invisible(x) } > > > > cleanEx(); ..nameEx <- "summary.glmmML" > > ### * summary.glmmML > > flush(stderr()); flush(stdout()) > > ### Name: summary.glmmML > ### Title: Summary of a glmmML object > ### Aliases: summary.glmmML > ### Keywords: print > > ### ** Examples > > ##---- Should be DIRECTLY executable !! ---- > ##-- ==> Define data, use random, > ##-- or do help(data=index) for the standard data sets. > > ## The function is currently defined as > function(object, ...){ + print.glmmML(object, ...) + } function (object, ...) { print.glmmML(object, ...) } > > > > cleanEx(); ..nameEx <- "summary.glmmboot" > > ### * summary.glmmboot > > flush(stderr()); flush(stdout()) > > ### Name: summary.glmmboot > ### Title: Summary of a glmmboot object > ### Aliases: summary.glmmboot > ### Keywords: print > > ### ** Examples > > ##---- Should be DIRECTLY executable !! ---- > ##-- ==> Define data, use random, > ##-- or do help(data=index) for the standard data sets. > > ## The function is currently defined as > function(object, ...){ + print.glmmboot(object, ...) + } function (object, ...) { print.glmmboot(object, ...) } > > > > ### *