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("Fahrmeir-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('Fahrmeir') > > assign(".oldSearch", search(), env = .CheckExEnv) > assign(".oldNS", loadedNamespaces(), env = .CheckExEnv) > cleanEx(); ..nameEx <- "Regensburg" > > ### * Regensburg > > flush(stderr()); flush(stdout()) > > ### Name: Regensburg > ### Title: Job Expectation > ### Aliases: Regensburg > ### Keywords: datasets > > ### ** Examples > > str(Regensburg) `data.frame': 30 obs. of 4 variables: $ y : int 1 2 3 1 2 3 1 2 3 1 ... $ n : int 1 2 0 5 18 2 6 19 2 1 ... $ age : int 19 19 19 20 20 20 21 21 21 22 ... $ lage: num 2.94 2.94 2.94 3.00 3.00 ... > summary(Regensburg) y n age lage Min. :1.000 Min. : 0.0 Min. :19.00 Min. :2.944 1st Qu.:1.000 1st Qu.: 1.0 1st Qu.:21.00 1st Qu.:3.045 Median :2.000 Median : 2.0 Median :23.50 Median :3.156 Mean :1.967 Mean : 3.4 Mean :24.40 Mean :3.180 3rd Qu.:3.000 3rd Qu.: 4.5 3rd Qu.:26.75 3rd Qu.:3.287 Max. :3.000 Max. :19.0 Max. :34.00 Max. :3.526 > # Example 3.5 page 83 in book: > library(MASS) > Regensburg$y <- ordered(Regensburg$y) > Regensburg.polr <- polr(y~lage, data=Regensburg) > summary(Regensburg.polr) Re-fitting to get Hessian Call: polr(formula = y ~ lage, data = Regensburg) Coefficients: Value Std. Error t value lage -1.313762 1.995241 -0.6584478 Intercepts: Value Std. Error t value 1|2 -4.8848 6.3825 -0.7653 2|3 -3.3264 6.3465 -0.5241 Residual Deviance: 65.28225 AIC: 71.28225 > class(Regensburg.polr) [1] "polr" > > > > cleanEx(); ..nameEx <- "breath" > > ### * breath > > flush(stderr()); flush(stdout()) > > ### Name: breath > ### Title: Breathing Test > ### Aliases: breath > ### Keywords: datasets > > ### ** Examples > > str(breath) `data.frame': 18 obs. of 4 variables: $ Age : Factor w/ 2 levels "<40","40-59": 1 1 1 1 1 1 1 1 1 2 ... $ n : int 577 27 7 192 20 3 682 46 11 164 ... $ Smoking.status: Factor w/ 3 levels "Current.smoker",..: 3 3 3 2 2 2 1 1 1 3 ... $ Breathing.test: Factor w/ 3 levels "Abnormal","Borderline",..: 3 2 1 3 2 1 3 2 1 3 ... > breath$Breathing.test <- ordered(breath$Breathing.test) > library(MASS) > breath.polr1 <- polr(Breathing.test ~ Age*Smoking.status, weight=n, + data=breath) > breath.polr2 <- polr(Breathing.test ~ Age*Smoking.status, weight=n, + data=breath, method="cloglog") > summary(breath.polr1) Re-fitting to get Hessian Call: polr(formula = Breathing.test ~ Age * Smoking.status, data = breath, weights = n) Coefficients: Value Std. Error t value Age40-59 -1.3149375 0.1909916 -6.884793 Smoking.statusFormer.smoker -0.3499662 0.2597749 -1.347190 Smoking.statusNever.smoked 0.3472380 0.2238473 1.551227 Age40-59:Smoking.statusFormer.smoker 1.0548697 0.3703823 2.848057 Age40-59:Smoking.statusNever.smoked 2.2008916 0.5688948 3.868715 Intercepts: Value Std. Error t value Abnormal|Borderline -3.9605 0.1819 -21.7785 Borderline|Normal -2.4862 0.1378 -18.0428 Residual Deviance: 1564.968 AIC: 1578.968 > summary(breath.polr2) Re-fitting to get Hessian Call: polr(formula = Breathing.test ~ Age * Smoking.status, data = breath, weights = n, method = "cloglog") Coefficients: Value Std. Error t value Age40-59 -0.5513881 0.07962738 -6.924604 Smoking.statusFormer.smoker -0.1037143 0.09640687 -1.075798 Smoking.statusNever.smoked 0.1087904 0.07301109 1.490053 Age40-59:Smoking.statusFormer.smoker 0.4045246 0.14759874 2.740705 Age40-59:Smoking.statusNever.smoked 0.8378758 0.16357044 5.122416 Intercepts: Value Std. Error t value Abnormal|Borderline -1.4440 0.0556 -25.9828 Borderline|Normal -0.9389 0.0482 -19.4986 Residual Deviance: 1559.949 AIC: 1573.949 > # continuation ratio models (as of page 89) might be fitted with > # Design or VGAM package. > > > > cleanEx(); ..nameEx <- "caesar" > > ### * caesar > > flush(stderr()); flush(stdout()) > > ### Name: caesar > ### Title: Caesarian Birth Study > ### Aliases: caesar > ### Keywords: datasets > > ### ** Examples > > summary(caesar) y w noplan factor antib 1:8 Min. : 0.00 not :12 risk factors:12 antibiotics:12 2:8 1st Qu.: 0.00 planned:12 without :12 without :12 3:8 Median : 4.00 Mean :10.46 3rd Qu.:11.50 Max. :87.00 yl patco Min. :0.0000 Min. :1.00 1st Qu.:0.0000 1st Qu.:2.75 Median :1.0000 Median :4.50 Mean :0.6667 Mean :4.50 3rd Qu.:1.0000 3rd Qu.:6.25 Max. :1.0000 Max. :8.00 > caesar.glm1 <- glm(yl ~ noplan+factor+antib, data=caesar, weight=w, + family=binomial) > caesar.glm2 <- glm(yl ~ noplan+factor+antib, data=caesar, weight=w, + family=binomial(link=probit)) > summary(caesar.glm1) Call: glm(formula = yl ~ noplan + factor + antib, family = binomial, data = caesar, weights = w) Deviance Residuals: Min 1Q Median 3Q Max -6.7711 -0.4177 0.0000 2.8827 5.5078 Coefficients: Estimate Std. Error z value Pr(>|z|) (Intercept) -2.0452 0.3074 -6.653 2.87e-11 *** noplanplanned -1.0720 0.4254 -2.520 0.0117 * factorwithout -2.0299 0.4553 -4.459 8.25e-06 *** antibwithout 3.2544 0.4813 6.761 1.37e-11 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 (Dispersion parameter for binomial family taken to be 1) Null deviance: 299.01 on 15 degrees of freedom Residual deviance: 226.52 on 12 degrees of freedom AIC: 234.52 Number of Fisher Scoring iterations: 6 > summary(caesar.glm2) Call: glm(formula = yl ~ noplan + factor + antib, family = binomial(link = probit), data = caesar, weights = w) Deviance Residuals: Min 1Q Median 3Q Max -6.8413 -0.3341 0.0000 2.9129 5.4860 Coefficients: Estimate Std. Error z value Pr(>|z|) (Intercept) -1.1926 0.1597 -7.466 8.29e-14 *** noplanplanned -0.6076 0.2427 -2.503 0.0123 * factorwithout -1.1975 0.2572 -4.656 3.22e-06 *** antibwithout 1.9047 0.2635 7.229 4.88e-13 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 (Dispersion parameter for binomial family taken to be 1) Null deviance: 299.01 on 15 degrees of freedom Residual deviance: 227.02 on 12 degrees of freedom AIC: 235.02 Number of Fisher Scoring iterations: 5 > > > > cleanEx(); ..nameEx <- "cells" > > ### * cells > > flush(stderr()); flush(stdout()) > > ### Name: cells > ### Title: Cellular Differentiation > ### Aliases: cells > ### Keywords: datasets > > ### ** Examples > > str(cells) `data.frame': 16 obs. of 3 variables: $ y : int 11 18 20 39 22 38 52 69 31 68 ... $ TNF: int 0 0 0 0 1 1 1 1 10 10 ... $ IFN: int 0 4 20 100 0 4 20 100 0 4 ... > cells.poisson <- glm(y~TNF+IFN+TNF:IFN, data=cells, + family=poisson) > summary(cells.poisson) Call: glm(formula = y ~ TNF + IFN + TNF:IFN, family = poisson, data = cells) Deviance Residuals: Min 1Q Median 3Q Max -4.6824 -2.8179 -0.8222 1.9183 4.4728 Coefficients: Estimate Std. Error z value Pr(>|z|) (Intercept) 3.436e+00 6.377e-02 53.877 < 2e-16 *** TNF 1.553e-02 8.308e-04 18.689 < 2e-16 *** IFN 8.946e-03 9.669e-04 9.253 < 2e-16 *** TNF:IFN -5.670e-05 1.348e-05 -4.205 2.61e-05 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 (Dispersion parameter for poisson family taken to be 1) Null deviance: 707.03 on 15 degrees of freedom Residual deviance: 142.39 on 12 degrees of freedom AIC: 243.69 Number of Fisher Scoring iterations: 4 > confint(cells.poisson) Waiting for profiling to be done... 2.5 % 97.5 % (Intercept) 3.3083036628 3.558359e+00 TNF 0.0139060411 1.716434e-02 IFN 0.0070438184 1.083599e-02 TNF:IFN -0.0000831869 -3.031366e-05 > # Now we follow the book, example 2.6, page 51: > # there seems to be overdispersion? > cells.quasi <- glm(y~TNF+IFN+TNF:IFN, data=cells, + family=quasipoisson) > summary(cells.quasi) Call: glm(formula = y ~ TNF + IFN + TNF:IFN, family = quasipoisson, data = cells) Deviance Residuals: Min 1Q Median 3Q Max -4.6824 -2.8179 -0.8222 1.9183 4.4728 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 3.436e+00 2.184e-01 15.728 2.26e-09 *** TNF 1.553e-02 2.846e-03 5.456 0.000146 *** IFN 8.946e-03 3.312e-03 2.701 0.019271 * TNF:IFN -5.670e-05 4.619e-05 -1.228 0.243169 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 (Dispersion parameter for quasipoisson family taken to be 11.73497) Null deviance: 707.03 on 15 degrees of freedom Residual deviance: 142.39 on 12 degrees of freedom AIC: NA Number of Fisher Scoring iterations: 4 > anova(cells.quasi) Analysis of Deviance Table Model: quasipoisson, link: log Response: y Terms added sequentially (first to last) Df Deviance Resid. Df Resid. Dev NULL 15 707.03 TNF 1 468.60 14 238.43 IFN 1 78.27 13 160.16 TNF:IFN 1 17.78 12 142.39 > confint(cells.quasi) Waiting for profiling to be done... 2.5 % 97.5 % (Intercept) 2.9785714563 3.838435e+00 TNF 0.0100047145 2.121923e-02 IFN 0.0023367838 1.540793e-02 TNF:IFN -0.0001481673 3.358189e-05 > # We follow the book, example 2.7, page 56: > with(cells, tapply(y, factor(TNF), function(x) c(mean(x), var(x)))) $"0" [1] 22.0000 143.3333 $"1" [1] 45.2500 400.9167 $"10" [1] 74.000 1608.667 $"100" [1] 161.5 1655.0 > # which might indicate the use of a negative binomial model > > > > cleanEx(); ..nameEx <- "credit" > > ### * credit > > flush(stderr()); flush(stdout()) > > ### Name: credit > ### Title: Credit Score Data From a South German Bank > ### Aliases: credit > ### Keywords: datasets > > ### ** Examples > > summary(credit) Y Cuenta Mes Ppag buen:700 no :274 Min. : 4.00 pre buen pagador:911 mal :300 good running:394 1st Qu.:12.00 pre mal pagador : 89 bad running :332 Median :18.00 Mean :20.90 3rd Qu.:24.00 Max. :72.00 Uso DM Sexo Estc privado :657 Min. : 250 mujer :402 no vive solo:640 profesional:343 1st Qu.: 1366 hombre:598 vive solo :360 Median : 2320 Mean : 3271 3rd Qu.: 3972 Max. :18424 > > > > cleanEx(); ..nameEx <- "happy" > > ### * happy > > flush(stderr()); flush(stdout()) > > ### Name: happy > ### Title: Reported Happiness > ### Aliases: happy > ### Keywords: datasets > > ### ** Examples > > str(happy) `data.frame': 24 obs. of 4 variables: $ Rep.happiness: Ord.factor w/ 3 levels "Not to happy"<..: 1 1 1 1 2 2 2 2 3 3 ... $ School : Factor w/ 4 levels "<12",">16","12",..: 1 3 4 2 1 3 4 2 1 3 ... $ Sex : Factor w/ 2 levels "Females","Males": 2 2 2 2 2 2 2 2 2 2 ... $ n : int 40 21 14 3 131 116 112 27 82 61 ... > table(happy) , , Sex = Females, n = 3 School Rep.happiness <12 >16 12 13-16 Not to happy 0 1 0 0 Pretty happy 0 0 0 0 Very happy 0 0 0 0 , , Sex = Males, n = 3 School Rep.happiness <12 >16 12 13-16 Not to happy 0 1 0 0 Pretty happy 0 0 0 0 Very happy 0 0 0 0 , , Sex = Females, n = 12 School Rep.happiness <12 >16 12 13-16 Not to happy 0 0 0 1 Pretty happy 0 0 0 0 Very happy 0 0 0 0 , , Sex = Males, n = 12 School Rep.happiness <12 >16 12 13-16 Not to happy 0 0 0 0 Pretty happy 0 0 0 0 Very happy 0 0 0 0 , , Sex = Females, n = 14 School Rep.happiness <12 >16 12 13-16 Not to happy 0 0 0 0 Pretty happy 0 0 0 0 Very happy 0 0 0 0 , , Sex = Males, n = 14 School Rep.happiness <12 >16 12 13-16 Not to happy 0 0 0 1 Pretty happy 0 0 0 0 Very happy 0 0 0 0 , , Sex = Females, n = 15 School Rep.happiness <12 >16 12 13-16 Not to happy 0 0 0 0 Pretty happy 0 1 0 0 Very happy 0 1 0 0 , , Sex = Males, n = 15 School Rep.happiness <12 >16 12 13-16 Not to happy 0 0 0 0 Pretty happy 0 0 0 0 Very happy 0 0 0 0 , , Sex = Females, n = 21 School Rep.happiness <12 >16 12 13-16 Not to happy 0 0 0 0 Pretty happy 0 0 0 0 Very happy 0 0 0 0 , , Sex = Males, n = 21 School Rep.happiness <12 >16 12 13-16 Not to happy 0 0 1 0 Pretty happy 0 0 0 0 Very happy 0 0 0 0 , , Sex = Females, n = 26 School Rep.happiness <12 >16 12 13-16 Not to happy 0 0 1 0 Pretty happy 0 0 0 0 Very happy 0 0 0 0 , , Sex = Males, n = 26 School Rep.happiness <12 >16 12 13-16 Not to happy 0 0 0 0 Pretty happy 0 0 0 0 Very happy 0 0 0 0 , , Sex = Females, n = 27 School Rep.happiness <12 >16 12 13-16 Not to happy 0 0 0 0 Pretty happy 0 0 0 0 Very happy 0 0 0 0 , , Sex = Males, n = 27 School Rep.happiness <12 >16 12 13-16 Not to happy 0 0 0 0 Pretty happy 0 1 0 0 Very happy 0 1 0 0 , , Sex = Females, n = 40 School Rep.happiness <12 >16 12 13-16 Not to happy 0 0 0 0 Pretty happy 0 0 0 0 Very happy 0 0 0 0 , , Sex = Males, n = 40 School Rep.happiness <12 >16 12 13-16 Not to happy 1 0 0 0 Pretty happy 0 0 0 0 Very happy 0 0 0 0 , , Sex = Females, n = 55 School Rep.happiness <12 >16 12 13-16 Not to happy 0 0 0 0 Pretty happy 0 0 0 0 Very happy 0 0 0 0 , , Sex = Males, n = 55 School Rep.happiness <12 >16 12 13-16 Not to happy 0 0 0 0 Pretty happy 0 0 0 0 Very happy 0 0 0 1 , , Sex = Females, n = 61 School Rep.happiness <12 >16 12 13-16 Not to happy 0 0 0 0 Pretty happy 0 0 0 0 Very happy 0 0 0 0 , , Sex = Males, n = 61 School Rep.happiness <12 >16 12 13-16 Not to happy 0 0 0 0 Pretty happy 0 0 0 0 Very happy 0 0 1 0 , , Sex = Females, n = 62 School Rep.happiness <12 >16 12 13-16 Not to happy 1 0 0 0 Pretty happy 0 0 0 0 Very happy 0 0 0 0 , , Sex = Males, n = 62 School Rep.happiness <12 >16 12 13-16 Not to happy 0 0 0 0 Pretty happy 0 0 0 0 Very happy 0 0 0 0 , , Sex = Females, n = 76 School Rep.happiness <12 >16 12 13-16 Not to happy 0 0 0 0 Pretty happy 0 0 0 0 Very happy 0 0 0 1 , , Sex = Males, n = 76 School Rep.happiness <12 >16 12 13-16 Not to happy 0 0 0 0 Pretty happy 0 0 0 0 Very happy 0 0 0 0 , , Sex = Females, n = 82 School Rep.happiness <12 >16 12 13-16 Not to happy 0 0 0 0 Pretty happy 0 0 0 0 Very happy 0 0 0 0 , , Sex = Males, n = 82 School Rep.happiness <12 >16 12 13-16 Not to happy 0 0 0 0 Pretty happy 0 0 0 0 Very happy 1 0 0 0 , , Sex = Females, n = 87 School Rep.happiness <12 >16 12 13-16 Not to happy 0 0 0 0 Pretty happy 0 0 0 0 Very happy 1 0 0 0 , , Sex = Males, n = 87 School Rep.happiness <12 >16 12 13-16 Not to happy 0 0 0 0 Pretty happy 0 0 0 0 Very happy 0 0 0 0 , , Sex = Females, n = 95 School Rep.happiness <12 >16 12 13-16 Not to happy 0 0 0 0 Pretty happy 0 0 0 1 Very happy 0 0 0 0 , , Sex = Males, n = 95 School Rep.happiness <12 >16 12 13-16 Not to happy 0 0 0 0 Pretty happy 0 0 0 0 Very happy 0 0 0 0 , , Sex = Females, n = 112 School Rep.happiness <12 >16 12 13-16 Not to happy 0 0 0 0 Pretty happy 0 0 0 0 Very happy 0 0 0 0 , , Sex = Males, n = 112 School Rep.happiness <12 >16 12 13-16 Not to happy 0 0 0 0 Pretty happy 0 0 0 1 Very happy 0 0 0 0 , , Sex = Females, n = 116 School Rep.happiness <12 >16 12 13-16 Not to happy 0 0 0 0 Pretty happy 0 0 0 0 Very happy 0 0 0 0 , , Sex = Males, n = 116 School Rep.happiness <12 >16 12 13-16 Not to happy 0 0 0 0 Pretty happy 0 0 1 0 Very happy 0 0 0 0 , , Sex = Females, n = 127 School Rep.happiness <12 >16 12 13-16 Not to happy 0 0 0 0 Pretty happy 0 0 0 0 Very happy 0 0 1 0 , , Sex = Males, n = 127 School Rep.happiness <12 >16 12 13-16 Not to happy 0 0 0 0 Pretty happy 0 0 0 0 Very happy 0 0 0 0 , , Sex = Females, n = 131 School Rep.happiness <12 >16 12 13-16 Not to happy 0 0 0 0 Pretty happy 0 0 0 0 Very happy 0 0 0 0 , , Sex = Males, n = 131 School Rep.happiness <12 >16 12 13-16 Not to happy 0 0 0 0 Pretty happy 1 0 0 0 Very happy 0 0 0 0 , , Sex = Females, n = 155 School Rep.happiness <12 >16 12 13-16 Not to happy 0 0 0 0 Pretty happy 1 0 0 0 Very happy 0 0 0 0 , , Sex = Males, n = 155 School Rep.happiness <12 >16 12 13-16 Not to happy 0 0 0 0 Pretty happy 0 0 0 0 Very happy 0 0 0 0 , , Sex = Females, n = 156 School Rep.happiness <12 >16 12 13-16 Not to happy 0 0 0 0 Pretty happy 0 0 1 0 Very happy 0 0 0 0 , , Sex = Males, n = 156 School Rep.happiness <12 >16 12 13-16 Not to happy 0 0 0 0 Pretty happy 0 0 0 0 Very happy 0 0 0 0 > > > > cleanEx(); ..nameEx <- "headneck" > > ### * headneck > > flush(stderr()); flush(stdout()) > > ### Name: headneck > ### Title: Head and Neck Cancer data > ### Aliases: headneck > ### Keywords: datasets > > ### ** Examples > > str(headneck) `data.frame': 47 obs. of 4 variables: $ month : int 1 2 3 4 5 6 7 8 9 10 ... $ atrisk : int 51 50 48 42 40 32 25 24 21 19 ... $ deaths : int 1 2 5 2 8 7 0 3 2 2 ... $ withdrawals: int 0 0 1 0 0 0 1 0 0 1 ... > summary(headneck) month atrisk deaths withdrawals Min. : 1.0 Min. : 2.00 Min. :0.0000 Min. :0.0000 1st Qu.:12.5 1st Qu.: 7.00 1st Qu.:0.0000 1st Qu.:0.0000 Median :24.0 Median : 7.00 Median :0.0000 Median :0.0000 Mean :24.0 Mean :13.36 Mean :0.8936 Mean :0.1915 3rd Qu.:35.5 3rd Qu.:15.00 3rd Qu.:1.0000 3rd Qu.:0.0000 Max. :47.0 Max. :51.00 Max. :8.0000 Max. :1.0000 > with(headneck, {plot(month, atrisk, type="s"); + lines(month, deaths, type="s", col="red"); + lines(month, withdrawals, type="S", col="green")}) > > > > cleanEx(); ..nameEx <- "ohio" > > ### * ohio > > flush(stderr()); flush(stdout()) > > ### Name: ohio > ### Title: Air Pollution and Health > ### Aliases: ohio > ### Keywords: datasets > > ### ** Examples > > str(ohio) `data.frame': 32 obs. of 6 variables: $ a7 : int 0 0 0 0 0 0 0 0 1 1 ... $ a8 : int 0 0 0 0 1 1 1 1 0 0 ... $ a9 : int 0 0 1 1 0 0 1 1 0 0 ... $ a10 : int 0 1 0 1 0 1 0 1 0 1 ... $ mother.smoke: Factor w/ 2 levels "no","yes": 1 1 1 1 1 1 1 1 1 1 ... $ n : int 237 10 15 4 16 2 7 3 24 3 ... > summary(ohio) a7 a8 a9 a10 mother.smoke Min. :0.0 Min. :0.0 Min. :0.0 Min. :0.0 no :16 1st Qu.:0.0 1st Qu.:0.0 1st Qu.:0.0 1st Qu.:0.0 yes:16 Median :0.5 Median :0.5 Median :0.5 Median :0.5 Mean :0.5 Mean :0.5 Mean :0.5 Mean :0.5 3rd Qu.:1.0 3rd Qu.:1.0 3rd Qu.:1.0 3rd Qu.:1.0 Max. :1.0 Max. :1.0 Max. :1.0 Max. :1.0 n Min. : 1.00 1st Qu.: 3.00 Median : 4.50 Mean : 16.78 3rd Qu.: 8.50 Max. :237.00 > > > > cleanEx(); ..nameEx <- "rheuma" > > ### * rheuma > > flush(stderr()); flush(stdout()) > > ### Name: rheuma > ### Title: Data from Patients with Acute Rheumatoid Arthritis > ### Aliases: rheuma > ### Keywords: datasets > > ### ** Examples > > str(rheuma) `data.frame': 10 obs. of 3 variables: $ Drug : Factor w/ 2 levels "Active.control",..: 2 2 2 2 2 1 1 1 1 1 $ Improvement: Ord.factor w/ 5 levels "Much.worse"<"Worse"<..: 1 2 3 4 5 1 2 3 4 5 $ n : int 24 37 21 19 6 11 51 22 21 7 > summary(rheuma) Drug Improvement n Active.control:5 Much.worse :2 Min. : 6.0 New.agent :5 Worse :2 1st Qu.:13.0 No.change :2 Median :21.0 Improved :2 Mean :21.9 Much.improved:2 3rd Qu.:23.5 Max. :51.0 > > > > cleanEx(); ..nameEx <- "tonsil" > > ### * tonsil > > flush(stderr()); flush(stdout()) > > ### Name: tonsil > ### Title: Data Set of Tonsil Size in Children > ### Aliases: tonsil > ### Keywords: datasets > > ### ** Examples > > str(tonsil) `data.frame': 6 obs. of 3 variables: $ Streptococcus.p: Factor w/ 2 levels "carriers","noncarriers": 1 1 1 2 2 2 $ Size : int 1 2 3 1 2 3 $ n : int 19 29 24 497 560 269 > summary(tonsil) Streptococcus.p Size n carriers :3 Min. :1.00 Min. : 19.00 noncarriers:3 1st Qu.:1.25 1st Qu.: 25.25 Median :2.00 Median :149.00 Mean :2.00 Mean :233.00 3rd Qu.:2.75 3rd Qu.:440.00 Max. :3.00 Max. :560.00 > > > > cleanEx(); ..nameEx <- "visual" > > ### * visual > > flush(stderr()); flush(stdout()) > > ### Name: visual > ### Title: Visual Impairment Data > ### Aliases: visual > ### Keywords: datasets > > ### ** Examples > > str(visual) List of 2 $ left :`data.frame': 16 obs. of 4 variables: ..$ left: Factor w/ 2 levels "no","yes": 2 1 2 1 2 1 2 1 2 1 ... ..$ race: Factor w/ 2 levels "black","white": 2 2 2 2 2 2 2 2 1 1 ... ..$ age : Factor w/ 4 levels "40-50","51-60",..: 1 1 2 2 3 3 4 4 1 1 ... ..$ n : int [1:16] 15 617 24 557 42 789 139 673 29 750 ... $ right:`data.frame': 16 obs. of 4 variables: ..$ right: Factor w/ 2 levels "no","yes": 2 1 2 1 2 1 2 1 2 1 ... ..$ race : Factor w/ 2 levels "black","white": 2 2 2 2 2 2 2 2 1 1 ... ..$ age : Factor w/ 4 levels "40-50","51-60",..: 1 1 2 2 3 3 4 4 1 1 ... ..$ n : int [1:16] 19 613 25 556 48 783 146 666 31 748 ... > summary(visual) Length Class Mode left 4 data.frame list right 4 data.frame list > > > > cleanEx(); ..nameEx <- "wine" > > ### * wine > > flush(stderr()); flush(stdout()) > > ### Name: wine > ### Title: Bitterness of White Wines > ### Aliases: wine > ### Keywords: datasets > > ### ** Examples > > str(wine) `data.frame': 72 obs. of 5 variables: $ temp : Factor w/ 2 levels "high","low": 2 2 2 2 2 2 2 2 2 2 ... $ contact: Factor w/ 2 levels "no","yes": 1 1 1 1 1 1 1 1 1 1 ... $ bottle : Factor w/ 8 levels "1","2","3","4",..: 1 1 1 1 1 1 1 1 1 2 ... $ judge : Factor w/ 9 levels "1","2","3","4",..: 1 2 3 4 5 6 7 8 9 1 ... $ score : int 2 1 2 3 2 3 1 2 1 3 ... > summary(wine) temp contact bottle judge score high:36 no :36 1 : 9 1 : 8 Min. :1.000 low :36 yes:36 2 : 9 2 : 8 1st Qu.:2.000 3 : 9 3 : 8 Median :3.000 4 : 9 4 : 8 Mean :2.917 5 : 9 5 : 8 3rd Qu.:4.000 6 : 9 6 : 8 Max. :5.000 (Other):18 (Other):24 > > > > ### *