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("brlr-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('brlr') > > assign(".oldSearch", search(), env = .CheckExEnv) > assign(".oldNS", loadedNamespaces(), env = .CheckExEnv) > cleanEx(); ..nameEx <- "brlr" > > ### * brlr > > flush(stderr()); flush(stdout()) > > ### Name: brlr > ### Title: Bias-reduced Logistic Regression > ### Aliases: brlr print.brlr summary.brlr print.summary.brlr vcov.brlr > ### predict.brlr add1.brlr drop1.brlr > ### Keywords: models regression > > ### ** Examples > > ## Habitat preferences of lizards, from McCullagh and Nelder (1989, p129); > ## this reproduces the results given in Firth (1992). > ## > ## First the standard maximum-likelihood fit: > data(lizards) > glm(cbind(grahami, opalinus) ~ height + diameter + light + time, + family = binomial, data=lizards) Call: glm(formula = cbind(grahami, opalinus) ~ height + diameter + light + time, family = binomial, data = lizards) Coefficients: (Intercept) height>=5ft diameter>2in lightshady timemidday 1.9447 1.1300 -0.7626 -0.8473 0.2271 timelate -0.7368 Degrees of Freedom: 22 Total (i.e. Null); 17 Residual Null Deviance: 70.1 Residual Deviance: 14.2 AIC: 83.03 > ## Now the bias-reduced version: > brlr(cbind(grahami, opalinus) ~ height + diameter + light + time, + data=lizards) Call: brlr(formula = cbind(grahami, opalinus) ~ height + diameter + light + time, data = lizards) Coefficients: (Intercept) height>=5ft diameter>2in lightshady timemidday timelate 1.9017 1.1065 -0.7536 -0.8176 0.2280 -0.7273 Deviance: 14.2464 Penalized deviance: -4.0065 Residual df: 17 > > > > cleanEx(); ..nameEx <- "lizards" > > ### * lizards > > flush(stderr()); flush(stdout()) > > ### Name: lizards > ### Title: Habitat Preferences of Lizards > ### Aliases: lizards > ### Keywords: datasets > > ### ** Examples > > data(lizards) > glm(cbind(grahami, opalinus) ~ height + diameter + light + time, + family = binomial, data=lizards) Call: glm(formula = cbind(grahami, opalinus) ~ height + diameter + light + time, family = binomial, data = lizards) Coefficients: (Intercept) height>=5ft diameter>2in lightshady timemidday 1.9447 1.1300 -0.7626 -0.8473 0.2271 timelate -0.7368 Degrees of Freedom: 22 Total (i.e. Null); 17 Residual Null Deviance: 70.1 Residual Deviance: 14.2 AIC: 83.03 > > > > ### *