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("aod-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('aod') Package aod, version 1.1-4 > > assign(".oldSearch", search(), env = .CheckExEnv) > assign(".oldNS", loadedNamespaces(), env = .CheckExEnv) > cleanEx(); ..nameEx <- "anova.glimML" > > ### * anova.glimML > > flush(stderr()); flush(stdout()) > > ### Name: anova-methods > ### Title: Likelihood-Ratio Tests for Nested ML Models > ### Aliases: anova-methods anova,ANY-method anova,glimML-method > ### anova.glimML-class show,anova.glimML-method > ### Keywords: regression > > ### ** Examples > > data(orob2) > # likelihood ratio test for the effect of root > fm1 <- betabin(cbind(y, n - y) ~ seed, ~ 1, data = orob2) > fm2 <- betabin(cbind(y, n - y) ~ seed + root, ~ 1, data = orob2) > anova(fm1, fm2) Analysis of Deviance Table (beta-binomial models) fm1: fixed = cbind(y, n - y) ~ seed; random = ~1 fm2: fixed = cbind(y, n - y) ~ seed + root; random = ~1 logL k AIC BIC Resid. dev. Resid. Df Test Deviance Df P(> Chi2) fm1 -63.55 3 133.1 136.2 50.51 18 fm2 -55.83 4 119.7 123.8 35.07 17 fm1-fm2 15.44 1 8.509e-05 > > > > cleanEx(); ..nameEx <- "betabin" > > ### * betabin > > flush(stderr()); flush(stdout()) > > ### Name: betabin > ### Title: Beta-Binomial Model for Proportions > ### Aliases: betabin > ### Keywords: regression > > ### ** Examples > > data(orob2) > fm1 <- betabin(cbind(y, n - y) ~ seed, ~ 1, data = orob2) > fm2 <- betabin(cbind(y, n - y) ~ seed + root, ~ 1, data = orob2) > fm3 <- betabin(cbind(y, n - y) ~ seed * root, ~ 1, data = orob2) > # show the model > fm1; fm2; fm3 Beta-binomial model ------------------- betabin(formula = cbind(y, n - y) ~ seed, random = ~1, data = orob2) Convergence was obtained after 80 iterations. Fixed-effect coefficients: Estimate Std. Error z value Pr(> |z|) (Intercept) -0.2602 0.2262 -1.1502 0.2500 seedO75 0.4130 0.2993 1.3798 0.1676 Overdispersion coefficients: Estimate Std. Error z value Pr(> z) phi.(Intercept) 0.078 0.0302 2.5885 0.0048 Log-likelihood = -63.553; nbpar = 3; df.residual = 18; Deviance = 50.509; AIC = 133.105 Beta-binomial model ------------------- betabin(formula = cbind(y, n - y) ~ seed + root, random = ~1, data = orob2) Convergence was obtained after 167 iterations. Fixed-effect coefficients: Estimate Std. Error z value Pr(> |z|) (Intercept) -0.7280 0.1995 -3.6489 0.0003 seedO75 0.3427 0.2106 1.6269 0.1038 rootCUCUMBER 1.0108 0.2020 5.0037 < 1e-4 Overdispersion coefficients: Estimate Std. Error z value Pr(> z) phi.(Intercept) 0.0194 0.0142 1.3678 0.0857 Log-likelihood = -55.832; nbpar = 4; df.residual = 17; Deviance = 35.067; AIC = 119.664 Beta-binomial model ------------------- betabin(formula = cbind(y, n - y) ~ seed * root, random = ~1, data = orob2) Convergence was obtained after 196 iterations. Fixed-effect coefficients: Estimate Std. Error z value Pr(> |z|) (Intercept) -0.4456 0.2183 -2.0411 0.0412 seedO75 -0.0961 0.2737 -0.3512 0.7255 rootCUCUMBER 0.5235 0.2968 1.7636 0.0778 seedO75:rootCUCUMBER 0.7962 0.3779 2.1068 0.0351 Overdispersion coefficients: Estimate Std. Error z value Pr(> z) phi.(Intercept) 0.0124 0.0113 1.0927 0.1373 Log-likelihood = -53.767; nbpar = 5; df.residual = 16; Deviance = 30.937; AIC = 117.534 > # AIC > AIC(fm1, fm2, fm3) df AIC fm1 3 133.1054 fm2 4 119.6637 fm3 5 117.5336 > # Wald test for root effect > wald.test(b = coef(fm3), Sigma = vcov(fm3), Terms = 3:4) Wald test: ---------- Chi-squared test: X2 = 34.9, df = 2, P(> X2) = 2.6e-08 > # likelihood ratio test for root effect > anova(fm1, fm3) Analysis of Deviance Table (beta-binomial models) fm1: fixed = cbind(y, n - y) ~ seed; random = ~1 fm3: fixed = cbind(y, n - y) ~ seed * root; random = ~1 logL k AIC BIC Resid. dev. Resid. Df Test Deviance Df P(> Chi2) fm1 -63.55 3 133.1 136.2 50.51 18 fm3 -53.77 5 117.5 122.8 30.94 16 fm1-fm3 19.57 2 5.624e-05 > # model predictions > New <- expand.grid(seed = levels(orob2$seed), + root = levels(orob2$root)) > data.frame(New, predict(fm3, New, se = TRUE, type = "response")) seed root fit se.fit 1 O73 BEAN 0.3904148 0.05195385 2 O75 BEAN 0.3677958 0.03808118 3 O73 CUCUMBER 0.5194646 0.05118758 4 O75 CUCUMBER 0.6852506 0.03616440 > # Djallonke sheep data > data(dja) > betabin(cbind(y, n - y) ~ group, ~ 1, dja) Beta-binomial model ------------------- betabin(formula = cbind(y, n - y) ~ group, random = ~1, data = dja) Convergence was obtained after 68 iterations. Fixed-effect coefficients: Estimate Std. Error z value Pr(> |z|) (Intercept) -0.5846 0.1861 -3.1408 0.0017 groupTREAT -0.8522 0.2527 -3.3717 0.0007 Overdispersion coefficients: Estimate Std. Error z value Pr(> z) phi.(Intercept) 0.056 0.0301 1.8594 0.0315 Log-likelihood = -107.103; nbpar = 3; df.residual = 72; Deviance = 108.394; AIC = 220.206 > # heterogeneous phi > betabin(cbind(y, n - y) ~ group, ~ group, dja) Beta-binomial model ------------------- betabin(formula = cbind(y, n - y) ~ group, random = ~group, data = dja) Convergence was obtained after 501 iterations. Fixed-effect coefficients: Estimate Std. Error z value Pr(> |z|) (Intercept) -0.6072 0.2254 -2.6938 0.0071 groupTREAT -0.8429 0.2647 -3.1838 0.0015 Overdispersion coefficients: Estimate Std. Error z value Pr(> z) phi.groupCTRL 0.1642 0.0744 2.2059 0.0137 phi.groupTREAT 0.0000 0.0000 135633.5389 < 1e-4 Log-likelihood = -102.886; nbpar = 4; df.residual = 71; Deviance = 99.960; AIC = 213.772 > # phi fixed to zero in group TREAT > betabin(cbind(y, n - y) ~ group, ~ group, dja, + fixpar = list(4, 0)) Beta-binomial model ------------------- betabin(formula = cbind(y, n - y) ~ group, random = ~group, data = dja, fixpar = list(4, 0)) Convergence was obtained after 85 iterations. Fixed-effect coefficients: Estimate Std. Error z value Pr(> |z|) (Intercept) -0.6081 0.2249 -2.7036 0.0069 groupTREAT -0.8425 0.2644 -3.1868 0.0014 Overdispersion coefficients: Estimate Std. Error z value Pr(> z) phi.groupCTRL 0.1624 0.0737 2.2026 0.0138 Overdispersion coefficients set to fixed values: Value phi.groupTREAT 0 Log-likelihood = -102.886; nbpar = 3; df.residual = 72; Deviance = 99.960; AIC = 211.771 > # glim without overdispersion > summary(glm(cbind(y, n - y) ~ group, + family = binomial, data = dja)) Call: glm(formula = cbind(y, n - y) ~ group, family = binomial, data = dja) Deviance Residuals: Min 1Q Median 3Q Max -3.3440 -0.9653 -0.1476 0.6731 3.3036 Coefficients: Estimate Std. Error z value Pr(>|z|) (Intercept) -0.5217 0.1477 -3.531 0.000414 *** groupTREAT -0.9289 0.2028 -4.581 4.63e-06 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 (Dispersion parameter for binomial family taken to be 1) Null deviance: 136.68 on 74 degrees of freedom Residual deviance: 115.57 on 73 degrees of freedom AIC: 225.38 Number of Fisher Scoring iterations: 4 > # phi fixed to zero in both groups > betabin(cbind(y, n - y) ~ group, ~ group, dja, + fixpar = list(c(3, 4), c(0, 0))) Beta-binomial model ------------------- betabin(formula = cbind(y, n - y) ~ group, random = ~group, data = dja, fixpar = list(c(3, 4), c(0, 0))) Convergence was obtained after 41 iterations. Fixed-effect coefficients: Estimate Std. Error z value Pr(> |z|) (Intercept) -0.5217 0.1477 -3.5312 4e-04 groupTREAT -0.9289 0.2028 -4.5808 < 1e-4 Overdispersion coefficients set to fixed values: Value phi.groupCTRL 0 phi.groupTREAT 0 Log-likelihood = -110.692; nbpar = 2; df.residual = 73; Deviance = 115.573; AIC = 225.384 > > > > cleanEx(); ..nameEx <- "donner" > > ### * donner > > flush(stderr()); flush(stdout()) > > ### Name: donner > ### Title: Test of Proportion Homogeneity using Donner's Adjustment > ### Aliases: donner show,donner-class > ### Keywords: htest > > ### ** Examples > > data(rats) > donner(formula = cbind(y, n - y) ~ group, data = rats) Test of proportion homogeneity (Donner, 1989) --------------------------------------------- donner(formula = cbind(y, n - y) ~ group, data = rats) N = 32 clusters, n = 303 subjects, y = 254 cases, I = 2 groups. Data and correction factors: group N n y p C 1 CTRL 16 158 142 0.8987 3.350 2 TREAT 16 145 112 0.7724 3.115 Intra-cluster correlation (anova estimate): 0.2506 Adjusted chi-squared test: X2 = 2.8, df = 1, P(> X2) = 0.0966 > donner(formula = y/n ~ group, weights = n, data = rats) Test of proportion homogeneity (Donner, 1989) --------------------------------------------- donner(formula = y/n ~ group, weights = n, data = rats) N = 32 clusters, n = 303 subjects, y = 254 cases, I = 2 groups. Data and correction factors: group N n y p C 1 CTRL 16 158 142 0.8987 3.350 2 TREAT 16 145 112 0.7724 3.115 Intra-cluster correlation (anova estimate): 0.2506 Adjusted chi-squared test: X2 = 2.8, df = 1, P(> X2) = 0.0966 > donner(response = cbind(y, n - y), group = group, data = rats) Test of proportion homogeneity (Donner, 1989) --------------------------------------------- donner(response = cbind(y, n - y), group = group, data = rats) N = 32 clusters, n = 303 subjects, y = 254 cases, I = 2 groups. Data and correction factors: group N n y p C 1 CTRL 16 158 142 0.8987 3.350 2 TREAT 16 145 112 0.7724 3.115 Intra-cluster correlation (anova estimate): 0.2506 Adjusted chi-squared test: X2 = 2.8, df = 1, P(> X2) = 0.0966 > donner(response = y/n, weights = n, group = group, data = rats) Test of proportion homogeneity (Donner, 1989) --------------------------------------------- donner(response = y/n, weights = n, group = group, data = rats) N = 32 clusters, n = 303 subjects, y = 254 cases, I = 2 groups. Data and correction factors: group N n y p C 1 CTRL 16 158 142 0.8987 3.350 2 TREAT 16 145 112 0.7724 3.115 Intra-cluster correlation (anova estimate): 0.2506 Adjusted chi-squared test: X2 = 2.8, df = 1, P(> X2) = 0.0966 > # standard test > donner(cbind(y, n - y) ~ group, data = rats, C = c(1, 1)) Test of proportion homogeneity (Donner, 1989) --------------------------------------------- donner(formula = cbind(y, n - y) ~ group, data = rats, C = c(1, 1)) N = 32 clusters, n = 303 subjects, y = 254 cases, I = 2 groups. Data and correction factors: group N n y p C 1 CTRL 16 158 142 0.8987 1 2 TREAT 16 145 112 0.7724 1 Intra-cluster correlation (anova estimate): 0.2506 Adjusted chi-squared test: X2 = 8.9, df = 1, P(> X2) = 0.0029 > data(antibio) > donner(cbind(y, n - y) ~ treatment, data = antibio) Test of proportion homogeneity (Donner, 1989) --------------------------------------------- donner(formula = cbind(y, n - y) ~ treatment, data = antibio) N = 24 clusters, n = 542 subjects, y = 67 cases, I = 4 groups. Data and correction factors: treatment N n y p C 1 1 7 144 18 0.12500 2.030 2 2 6 129 8 0.06202 1.982 3 3 5 130 24 0.18462 2.224 4 4 6 139 17 0.12230 2.129 Intra-cluster correlation (anova estimate): 0.0439 Adjusted chi-squared test: X2 = 4.3, df = 3, P(> X2) = 0.2318 > > > > cleanEx(); ..nameEx <- "icc" > > ### * icc > > flush(stderr()); flush(stdout()) > > ### Name: icc > ### Title: Intra-Cluster Correlation > ### Aliases: icc show,icc-method > ### Keywords: htest > > ### ** Examples > > data(rats) > icc(n, y, rats[rats$group == "CTRL", ]) Loading required package: nlme Intra-cluster correlation ------------------------- icc(n = n, y = y, data = rats[rats$group == "CTRL", ]) N = 16 clusters, n = 158 subjects, y = 142 cases. rho se REML 0.0267 0.0763 ANOVA 0.0291 F test for ML/REML method (H0: rho = 0): F = 1.3, df num. = 15, df denom. = 142, P(> F) = 0.2128 > res <- icc(n, y, rats[rats$group == "TREAT", ], R = 5000) Loading required package: MASS > res Intra-cluster correlation ------------------------- icc(n = n, y = y, data = rats[rats$group == "TREAT", ], R = 5000) N = 16 clusters, n = 145 subjects, y = 112 cases. rho se CI.low CI.up REML 0.3846 0.0856 0.1984 0.6166 ANOVA 0.3721 (Monte Carlo 95%CI based on 5000 replications) F test for ML/REML method (H0: rho = 0): F = 6.4, df num. = 15, df denom. = 129, P(> F) = 0 > hist(res@rho.MC) > by(rats, + list(group = rats$group), + function(x) icc(n, y, data = x)) group: CTRL Intra-cluster correlation ------------------------- icc(n = n, y = y, data = x) N = 16 clusters, n = 158 subjects, y = 142 cases. rho se REML 0.0267 0.0763 ANOVA 0.0291 F test for ML/REML method (H0: rho = 0): F = 1.3, df num. = 15, df denom. = 142, P(> F) = 0.2128 ------------------------------------------------------------ group: TREAT Intra-cluster correlation ------------------------- icc(n = n, y = y, data = x) N = 16 clusters, n = 145 subjects, y = 112 cases. rho se REML 0.3846 0.0856 ANOVA 0.3721 F test for ML/REML method (H0: rho = 0): F = 6.4, df num. = 15, df denom. = 129, P(> F) = 0 > > > > cleanEx(); ..nameEx <- "invlink" > > ### * invlink > > flush(stderr()); flush(stdout()) > > ### Name: invlink > ### Title: Transformation from the Link Scale to the Observation Scale > ### Aliases: invlink > ### Keywords: math > > ### ** Examples > > x <- seq(-5, 5, length = 100) > plot(x, invlink(x, type = "logit"), + type = "l", lwd = 2, ylab = "Probability") > lines(x, invlink(x, type = "cloglog"), lty = 2, lwd = 2) > grid(col = "black") > legend(-5, 1, legend = c("alogit(x)", "acloglog(x)"), + lty = c(1, 2), bg = "white") > > > > cleanEx(); ..nameEx <- "link" > > ### * link > > flush(stderr()); flush(stdout()) > > ### Name: link > ### Title: Transformation from the Observation Scale to the Link Scale > ### Aliases: link > ### Keywords: math > > ### ** Examples > > x <- seq(.001, .999, length = 100) > plot(x, link(x, type = "logit"), + type = "l", lwd = 2, ylab = "link(proba.)") > lines(x, link(x, type = "cloglog"), lty = 2, lwd = 2) > grid(col = "black") > legend(0, 6, legend = c("logit(x)", "cloglog(x)"), + lty = c(1, 2), bg = "white") > > > > cleanEx(); ..nameEx <- "lizards" > > ### * lizards > > flush(stderr()); flush(stdout()) > > ### Name: lizards > ### Title: A Comparison of Site Preferences of Two Species of Lizard > ### Aliases: lizards > ### Keywords: datasets > > ### ** Examples > data(lizards) > > > cleanEx(); ..nameEx <- "negbin" > > ### * negbin > > flush(stderr()); flush(stdout()) > > ### Name: negbin > ### Title: Negative-Binomial Model for Counts > ### Aliases: negbin > ### Keywords: regression > > ### ** Examples > > # without offset > data(salmonella) > negbin(y ~ log(dose + 10) + dose, ~ 1, salmonella) Negative-binomial model ----------------------- negbin(formula = y ~ log(dose + 10) + dose, random = ~1, data = salmonella) Convergence was obtained after 165 iterations. Fixed-effect coefficients: Estimate Std. Error z value Pr(> |z|) (Intercept) 2.1976 0.3566 6.1618 < 1e-4 log(dose + 10) 0.3125 0.0994 3.1440 0.0017 dose -0.0010 0.0005 -2.0369 0.0417 Overdispersion coefficients: Estimate Std. Error z value Pr(> z) phi.(Intercept) 0.0488 0.0324 1.5062 0.066 Log-likelihood = -62.890; nbpar = 4; df.residual = 14; Deviance = 33.243; AIC = 133.779 > library(MASS) # function glm.nb in MASS > fm.nb <- glm.nb(y ~ log(dose + 10) + dose, + link = log, data = salmonella) > coef(fm.nb) (Intercept) log(dose + 10) dose 2.1976273870 0.3125097501 -0.0009802996 > 1 / fm.nb$theta # theta = 1 / phi [1] 0.0487684 > c(logLik(fm.nb), AIC(fm.nb)) [1] -62.88959 133.77918 > # with offset > data(dja) > negbin(y ~ group + offset(log(trisk)), ~ group, dja) Negative-binomial model ----------------------- negbin(formula = y ~ group + offset(log(trisk)), random = ~group, data = dja) Convergence was obtained after 243 iterations. Fixed-effect coefficients: Estimate Std. Error z value Pr(> |z|) (Intercept) -0.5404 0.2297 -2.3530 0.0186 groupTREAT -1.0355 0.2616 -3.9584 < 1e-4 Overdispersion coefficients: Estimate Std. Error z value Pr(> z) phi.groupCTRL 0.8388 0.418 2.0067 0.0224 phi.groupTREAT 0.0000 0.000 616167.5865 < 1e-4 Log-likelihood = -121.150; nbpar = 4; df.residual = 71; Deviance = 111.829; AIC = 250.301 > # phi fixed to zero in group TREAT > negbin(y ~ group + offset(log(trisk)), ~ group, dja, + fixpar = list(4, 0)) Negative-binomial model ----------------------- negbin(formula = y ~ group + offset(log(trisk)), random = ~group, data = dja, fixpar = list(4, 0)) Convergence was obtained after 113 iterations. Fixed-effect coefficients: Estimate Std. Error z value Pr(> |z|) (Intercept) -0.5526 0.2277 -2.4267 0.0152 groupTREAT -1.0205 0.2598 -3.9287 < 1e-4 Overdispersion coefficients: Estimate Std. Error z value Pr(> z) phi.groupCTRL 0.8287 0.412 2.0117 0.0221 Overdispersion coefficients set to fixed values: Value phi.groupTREAT 0 Log-likelihood = -121.149; nbpar = 3; df.residual = 72; Deviance = 111.826; AIC = 248.297 > # glim without overdispersion > summary(glm(y ~ group + offset(log(trisk)), + family = poisson, data = dja)) Call: glm(formula = y ~ group + offset(log(trisk)), family = poisson, data = dja) Deviance Residuals: Min 1Q Median 3Q Max -3.3888 -1.0801 -0.1201 0.6566 3.7450 Coefficients: Estimate Std. Error z value Pr(>|z|) (Intercept) -0.6975 0.1170 -5.960 2.53e-09 *** groupTREAT -0.8754 0.1712 -5.112 3.19e-07 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 (Dispersion parameter for poisson family taken to be 1) Null deviance: 162.67 on 74 degrees of freedom Residual deviance: 136.86 on 73 degrees of freedom AIC: 271.33 Number of Fisher Scoring iterations: 5 > # phi fixed to zero in both groups > negbin(y ~ group + offset(log(trisk)), ~ group, dja, + fixpar = list(c(3, 4), c(0, 0))) Negative-binomial model ----------------------- negbin(formula = y ~ group + offset(log(trisk)), random = ~group, data = dja, fixpar = list(c(3, 4), c(0, 0))) Convergence was obtained after 41 iterations. Fixed-effect coefficients: Estimate Std. Error z value Pr(> |z|) (Intercept) -0.6975 0.1170 -5.9596 < 1e-4 groupTREAT -0.8754 0.1712 -5.1121 < 1e-4 Overdispersion coefficients set to fixed values: Value phi.groupCTRL 0 phi.groupTREAT 0 Log-likelihood = -133.664; nbpar = 2; df.residual = 73; Deviance = 136.856; AIC = 271.328 > > > > cleanEx(); ..nameEx <- "quasibin" > > ### * quasibin > > flush(stderr()); flush(stdout()) > > ### Name: quasibin > ### Title: Quasi-Likelihood Model for Proportions > ### Aliases: quasibin > ### Keywords: regression > > ### ** Examples > > data(orob2) > fm1 <- glm(cbind(y, n - y) ~ seed * root, + family = binomial, data = orob2) > fm2 <- quasibin(cbind(y, n - y) ~ seed * root, + data = orob2, phi = 0) > fm3 <- quasibin(cbind(y, n - y) ~ seed * root, + data = orob2) > rbind(fm1 = coef(fm1), fm2 = coef(fm2), fm3 = coef(fm3)) (Intercept) seedO75 rootCUCUMBER seedO75:rootCUCUMBER fm1 -0.4122448 -0.14592695 0.5400782 0.7781037 fm2 -0.4122448 -0.14592695 0.5400782 0.7781037 fm3 -0.4653218 -0.07008965 0.5102360 0.8195562 > # show the model > fm3 Quasi-likelihood generalized linear model ----------------------------------------- quasibin(formula = cbind(y, n - y) ~ seed * root, data = orob2) Fixed-effect coefficients: Estimate Std. Error z value Pr(>|z|) (Intercept) -0.4653 0.2439 -1.9081 0.0564 seedO75 -0.0701 0.3115 -0.2250 0.8219 rootCUCUMBER 0.5102 0.3347 1.5244 0.1274 seedO75:rootCUCUMBER 0.8196 0.4352 1.8831 0.0597 Overdispersion parameter: phi 0.0249 Pearson's chi-squared goodness-of-fit statistic = 17.0007 > # dispersion parameter and goodness-of-fit statistic > c(phi = fm3@phi, + X2 = sum(residuals(fm3, type = "pearson")^2)) phi X2 0.02493559 17.00065130 > # model predictions > predfm1 <- predict(fm1, type = "response", se = TRUE) > predfm3 <- predict(fm3, type = "response", se = TRUE) > New <- expand.grid(seed = levels(orob2$seed), + root = levels(orob2$root)) > predict(fm3, New, se = TRUE, type = "response") $fit 1 2 3 4 0.3857241 0.3692557 0.5112267 0.6887712 $se.fit 1 2 3 4 0.05778166 0.04512309 0.05728607 0.04278711 $residual.scale [1] 1 > data.frame(orob2, p1 = predfm1$fit, + se.p1 = predfm1$se.fit, + p3 = predfm3$fit, + se.p3 = predfm3$se.fit) seed root n y p1 se.p1 p3 se.p3 1 O75 BEAN 39 10 0.3639706 0.02917342 0.3692557 0.04512309 2 O75 BEAN 62 23 0.3639706 0.02917342 0.3692557 0.04512309 3 O75 BEAN 81 23 0.3639706 0.02917342 0.3692557 0.04512309 4 O75 BEAN 51 26 0.3639706 0.02917342 0.3692557 0.04512309 5 O75 BEAN 39 17 0.3639706 0.02917342 0.3692557 0.04512309 6 O75 CUCUMBER 6 5 0.6813559 0.02712870 0.6887712 0.04278711 7 O75 CUCUMBER 74 53 0.6813559 0.02712870 0.6887712 0.04278711 8 O75 CUCUMBER 72 55 0.6813559 0.02712870 0.6887712 0.04278711 9 O75 CUCUMBER 51 32 0.6813559 0.02712870 0.6887712 0.04278711 10 O75 CUCUMBER 79 46 0.6813559 0.02712870 0.6887712 0.04278711 11 O75 CUCUMBER 13 10 0.6813559 0.02712870 0.6887712 0.04278711 12 O73 BEAN 16 8 0.3983740 0.04414243 0.3857241 0.05778166 13 O73 BEAN 30 10 0.3983740 0.04414243 0.3857241 0.05778166 14 O73 BEAN 28 8 0.3983740 0.04414243 0.3857241 0.05778166 15 O73 BEAN 45 23 0.3983740 0.04414243 0.3857241 0.05778166 16 O73 BEAN 4 0 0.3983740 0.04414243 0.3857241 0.05778166 17 O73 CUCUMBER 12 3 0.5319149 0.04202173 0.5112267 0.05728607 18 O73 CUCUMBER 41 22 0.5319149 0.04202173 0.5112267 0.05728607 19 O73 CUCUMBER 30 15 0.5319149 0.04202173 0.5112267 0.05728607 20 O73 CUCUMBER 51 32 0.5319149 0.04202173 0.5112267 0.05728607 21 O73 CUCUMBER 7 3 0.5319149 0.04202173 0.5112267 0.05728607 > fm4 <- quasibin(cbind(y, n - y) ~ seed + root, + data = orob2, phi = fm3@phi) > # Pearson's chi-squared goodness-of-fit statistic > # compare with fm3's X2 > sum(residuals(fm4, type = "pearson")^2) [1] 20.72527 > > > > cleanEx(); ..nameEx <- "quasipois" > > ### * quasipois > > flush(stderr()); flush(stdout()) > > ### Name: quasipois > ### Title: Quasi-Likelihood Model for Counts > ### Aliases: quasipois > ### Keywords: regression > > ### ** Examples > > # without offset > data(salmonella) > quasipois(y ~ log(dose + 10) + dose, + data = salmonella) Quasi-likelihood generalized linear model ----------------------------------------- quasipois(formula = y ~ log(dose + 10) + dose, data = salmonella) Fixed-effect coefficients: Estimate Std. Error z value Pr(>|z|) (Intercept) 2.2031 0.3636 6.0591 < 1e-4 log(dose + 10) 0.3110 0.0991 3.1394 0.0017 dose -0.0010 0.0004 -2.2284 0.0259 Overdispersion parameter: phi 0.0718 Pearson's chi-squared goodness-of-fit statistic = 15.0004 > quasipois(y ~ log(dose + 10) + dose, + data = salmonella, phi = 0.07180449) Quasi-likelihood generalized linear model ----------------------------------------- quasipois(formula = y ~ log(dose + 10) + dose, data = salmonella, phi = 0.07180449) Fixed-effect coefficients: Estimate Std. Error z value Pr(>|z|) (Intercept) 2.2031 0.3636 6.0591 < 1e-4 log(dose + 10) 0.3110 0.0991 3.1394 0.0017 dose -0.0010 0.0004 -2.2284 0.0259 Overdispersion parameter: phi 0.0718 Pearson's chi-squared goodness-of-fit statistic = 15.0004 > summary(glm(y ~ log(dose + 10) + dose, + family = poisson, data = salmonella)) Call: glm(formula = y ~ log(dose + 10) + dose, family = poisson, data = salmonella) Deviance Residuals: Min 1Q Median 3Q Max -2.5173 -1.1731 -0.4032 0.7995 3.7041 Coefficients: Estimate Std. Error z value Pr(>|z|) (Intercept) 2.1727730 0.2184269 9.947 < 2e-16 *** log(dose + 10) 0.3198250 0.0570014 5.611 2.01e-08 *** dose -0.0010130 0.0002452 -4.131 3.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: 78.358 on 17 degrees of freedom Residual deviance: 43.716 on 15 degrees of freedom AIC: 142.25 Number of Fisher Scoring iterations: 4 > quasipois(y ~ log(dose + 10) + dose, + data = salmonella, phi = 0) Quasi-likelihood generalized linear model ----------------------------------------- quasipois(formula = y ~ log(dose + 10) + dose, data = salmonella, phi = 0) Fixed-effect coefficients: Estimate Std. Error z value Pr(>|z|) (Intercept) 2.1728 0.2184 9.9474 < 1e-4 log(dose + 10) 0.3198 0.0570 5.6108 < 1e-4 dose -0.0010 0.0002 -4.1311 < 1e-4 Overdispersion parameter: phi 0 Pearson's chi-squared goodness-of-fit statistic = 46.2707 > # with offset > data(cohorts) > i <- cohorts$age ; levels(i) <- 1:7 > j <- cohorts$period ; levels(j) <- 1:7 > i <- as.numeric(i); j <- as.numeric(j) > cohorts$cohort <- j + max(i) - i > cohorts$cohort <- as.factor(1850 + 5 * cohorts$cohort) > fm1 <- quasipois(y ~ age + period + cohort + offset(log(n)), + data = cohorts) > fm1 Quasi-likelihood generalized linear model ----------------------------------------- quasipois(formula = y ~ age + period + cohort + offset(log(n)), data = cohorts) Fixed-effect coefficients: Estimate Std. Error z value Pr(>|z|) (Intercept) -8.0269 0.0750 -106.9987 < 1e-4 age55- 0.7222 0.0432 16.7251 < 1e-4 age60- 1.3511 0.0463 29.1893 < 1e-4 age65- 1.8291 0.0523 35.0026 < 1e-4 age70- 2.2917 0.0604 37.9489 < 1e-4 age75- 2.6606 0.0698 38.0943 < 1e-4 age80- 2.8568 0.0750 38.0816 < 1e-4 period1940- 0.1134 0.0448 2.5337 0.0113 period1945- 0.2490 0.0473 5.2633 < 1e-4 period1950- 0.3920 0.0529 7.4086 < 1e-4 period1955- 0.4630 0.0606 7.6418 < 1e-4 period1960- 0.5186 0.0695 7.4648 < 1e-4 period1965- 0.6386 0.0750 8.5130 < 1e-4 cohort1860 0.2453 0.1249 1.9643 0.0495 cohort1865 0.2928 0.1099 2.6644 0.0077 cohort1870 0.4258 0.0996 4.2732 < 1e-4 cohort1875 0.5545 0.0919 6.0317 < 1e-4 cohort1880 0.5954 0.0857 6.9451 < 1e-4 cohort1885 0.6436 0.0798 8.0611 < 1e-4 cohort1890 0.7819 0.0793 9.8547 < 1e-4 cohort1895 0.7082 0.0796 8.8992 < 1e-4 cohort1900 0.6599 0.0818 8.0692 < 1e-4 cohort1905 0.4080 0.0870 4.6919 < 1e-4 cohort1910 0.2246 0.0955 2.3511 0.0187 cohort1915 NA NA NA Overdispersion parameter: phi 0.0033 Pearson's chi-squared goodness-of-fit statistic = 25.0004 > quasipois(y ~ age + cohort + offset(log(n)), + data = cohorts, phi = fm1@phi) Quasi-likelihood generalized linear model ----------------------------------------- quasipois(formula = y ~ age + cohort + offset(log(n)), data = cohorts, phi = fm1@phi) Fixed-effect coefficients: Estimate Std. Error z value Pr(>|z|) (Intercept) -8.6441 0.1236 -69.9115 < 1e-4 age55- 0.8225 0.0436 18.8858 < 1e-4 age60- 1.5490 0.0441 35.1408 < 1e-4 age65- 2.1276 0.0450 47.2789 < 1e-4 age70- 2.6960 0.0466 57.8405 < 1e-4 age75- 3.1715 0.0487 65.0778 < 1e-4 age80- 3.4741 0.0520 66.8309 < 1e-4 cohort1860 0.3550 0.1312 2.7055 0.0068 cohort1865 0.5194 0.1237 4.1982 < 1e-4 cohort1870 0.7743 0.1208 6.4082 < 1e-4 cohort1875 1.0121 0.1196 8.4596 < 1e-4 cohort1880 1.1508 0.1190 9.6676 < 1e-4 cohort1885 1.2996 0.1187 10.9467 < 1e-4 cohort1890 1.5449 0.1206 12.8121 < 1e-4 cohort1895 1.5749 0.1217 12.9435 < 1e-4 cohort1900 1.6271 0.1232 13.2088 < 1e-4 cohort1905 1.4643 0.1260 11.6223 < 1e-4 cohort1910 1.3720 0.1314 10.4435 < 1e-4 cohort1915 1.2559 0.1479 8.4940 < 1e-4 Overdispersion parameter: phi 0.0033 Pearson's chi-squared goodness-of-fit statistic = 31.9015 > > > > cleanEx(); ..nameEx <- "raoscott" > > ### * raoscott > > flush(stderr()); flush(stdout()) > > ### Name: raoscott > ### Title: Test of Proportion Homogeneity using Rao and Scott's Adjustment > ### Aliases: raoscott show,raoscott-class > ### Keywords: htest > > ### ** Examples > > data(rats) > # deff by group > raoscott(cbind(y, n - y) ~ group, data = rats) Test of proportion homogeneity (Rao and Scott, 1993) ---------------------------------------------------- raoscott(formula = cbind(y, n - y) ~ group, data = rats) N = 32 clusters, n = 303 subjects, y = 254 cases, I = 2 groups. Data and design effects: group N n y p vbin vratio deff 1 CTRL 16 158 142 0.8987 0.000576 0.000710 1.232 2 TREAT 16 145 112 0.7724 0.001212 0.004792 3.953 Adjusted chi-squared test: X2 = 4, df = 1, P(> X2) = 0.0444 > raoscott(y/n ~ group, weights = n, data = rats) Test of proportion homogeneity (Rao and Scott, 1993) ---------------------------------------------------- raoscott(formula = y/n ~ group, weights = n, data = rats) N = 32 clusters, n = 303 subjects, y = 254 cases, I = 2 groups. Data and design effects: group + n N n y p vbin vratio deff 1 CTRL 16 158 142 0.8987 0.000576 0.000710 1.232 2 TREAT 16 145 112 0.7724 0.001212 0.004792 3.953 Adjusted chi-squared test: X2 = 4, df = 1, P(> X2) = 0.0444 > raoscott(response = cbind(y, n - y), group = group, data = rats) Test of proportion homogeneity (Rao and Scott, 1993) ---------------------------------------------------- raoscott(response = cbind(y, n - y), group = group, data = rats) N = 32 clusters, n = 303 subjects, y = 254 cases, I = 2 groups. Data and design effects: group + NULL N n y p vbin vratio deff 1 CTRL 16 158 142 0.8987 0.000576 0.000710 1.232 2 TREAT 16 145 112 0.7724 0.001212 0.004792 3.953 Adjusted chi-squared test: X2 = 4, df = 1, P(> X2) = 0.0444 > raoscott(response = y/n, weights = n, group = group, data = rats) Test of proportion homogeneity (Rao and Scott, 1993) ---------------------------------------------------- raoscott(response = y/n, weights = n, group = group, data = rats) N = 32 clusters, n = 303 subjects, y = 254 cases, I = 2 groups. Data and design effects: group + n N n y p vbin vratio deff 1 CTRL 16 158 142 0.8987 0.000576 0.000710 1.232 2 TREAT 16 145 112 0.7724 0.001212 0.004792 3.953 Adjusted chi-squared test: X2 = 4, df = 1, P(> X2) = 0.0444 > # pooled deff > raoscott(cbind(y, n - y) ~ group, data = rats, pooled = TRUE) Test of proportion homogeneity (Rao and Scott, 1993) ---------------------------------------------------- raoscott(formula = cbind(y, n - y) ~ group, data = rats, pooled = TRUE) N = 32 clusters, n = 303 subjects, y = 254 cases, I = 2 groups. Data and design effects: group N n y p vbin vratio deff 1 CTRL 16 158 142 0.8987 0.000576 0.000710 3.069 2 TREAT 16 145 112 0.7724 0.001212 0.004792 3.069 Adjusted chi-squared test: X2 = 2.9, df = 1, P(> X2) = 0.0886 > # standard test > raoscott(cbind(y, n - y) ~ group, data = rats, deff = c(1, 1)) Test of proportion homogeneity (Rao and Scott, 1993) ---------------------------------------------------- raoscott(formula = cbind(y, n - y) ~ group, data = rats, deff = c(1, 1)) N = 32 clusters, n = 303 subjects, y = 254 cases, I = 2 groups. Data and design effects: group N n y p vbin vratio deff 1 CTRL 16 158 142 0.8987 0.000576 0.000710 1 2 TREAT 16 145 112 0.7724 0.001212 0.004792 1 Adjusted chi-squared test: X2 = 8.9, df = 1, P(> X2) = 0.0029 > data(antibio) > raoscott(cbind(y, n - y) ~ treatment, data = antibio) Test of proportion homogeneity (Rao and Scott, 1993) ---------------------------------------------------- raoscott(formula = cbind(y, n - y) ~ treatment, data = antibio) N = 24 clusters, n = 542 subjects, y = 67 cases, I = 4 groups. Data and design effects: treatment N n y p vbin vratio deff 1 1 7 144 18 0.12500 0.0007595 0.0028676 3.775 2 2 6 129 8 0.06202 0.0004509 0.0007568 1.678 3 3 5 130 24 0.18462 0.0011579 0.0014880 1.285 4 4 6 139 17 0.12230 0.0007723 0.0020771 2.690 Adjusted chi-squared test: X2 = 5.9, df = 3, P(> X2) = 0.1174 > > > > cleanEx(); ..nameEx <- "residuals" > > ### * residuals > > flush(stderr()); flush(stdout()) > > ### Name: residuals-methods > ### Title: Residuals for Maximum-Likelihood and Quasi-Likelihood Models > ### Aliases: residuals-methods residuals,ANY-method residuals,glimML-method > ### residuals,glimQL-method > ### Keywords: regression > > ### ** Examples > > data(orob2) > fm <- betabin(cbind(y, n - y) ~ seed, ~ 1, + link = "logit", data = orob2) > #Pearson's chi-squared goodness-of-fit statistic > sum(residuals(fm, type = "pearson")^2) [1] 21.85501 > > > > cleanEx(); ..nameEx <- "splitbin" > > ### * splitbin > > flush(stderr()); flush(stdout()) > > ### Name: splitbin > ### Title: Splits Binomial Data into Bernoulli Data > ### Aliases: splitbin > ### Keywords: datagen > > ### ** Examples > > data(orob1) > splitbin(cbind(y, n - y) ~ 1, orob1) id y 1 1 0 2 1 0 3 1 0 4 1 0 5 1 0 6 1 0 7 1 0 8 1 0 9 1 0 10 1 0 11 1 0 12 1 0 13 1 0 14 1 0 15 1 0 16 1 0 17 1 0 18 1 0 19 1 0 20 1 0 21 1 0 22 1 0 23 1 0 24 1 0 25 1 0 26 1 0 27 1 0 28 1 0 29 1 0 30 1 0 31 1 0 32 1 0 33 1 0 34 1 0 35 1 0 36 1 0 37 1 0 38 1 0 39 1 0 40 1 0 41 1 0 42 1 1 43 1 1 44 2 0 45 2 0 46 2 0 47 2 0 48 2 0 49 2 0 50 2 0 51 2 0 52 2 0 53 2 0 54 2 0 55 2 0 56 2 0 57 2 0 58 2 0 59 2 0 60 2 0 61 2 0 62 2 0 63 2 0 64 2 0 65 2 0 66 2 0 67 2 0 68 2 0 69 2 0 70 2 0 71 2 0 72 2 0 73 2 0 74 2 0 75 2 0 76 2 0 77 2 0 78 2 0 79 2 0 80 2 0 81 2 0 82 2 0 83 2 0 84 2 0 85 2 0 86 2 1 87 2 1 88 2 1 89 2 1 90 2 1 91 2 1 92 2 1 93 2 1 94 2 1 95 3 0 96 3 0 97 3 0 98 3 0 99 3 0 100 3 0 101 3 0 102 3 0 103 3 0 104 3 0 105 3 0 106 3 0 107 3 0 108 3 0 109 3 0 110 3 0 111 3 0 112 3 0 113 3 0 114 3 0 115 3 0 116 3 0 117 3 0 118 3 0 119 3 0 120 3 0 121 3 0 122 3 0 123 3 0 124 3 0 125 3 0 126 3 0 127 3 0 128 3 0 129 3 0 130 3 0 131 3 0 132 3 0 133 3 0 134 3 1 135 3 1 136 3 1 137 3 1 138 3 1 139 4 0 140 4 0 141 4 0 142 4 0 143 4 0 144 4 0 145 4 0 146 4 0 147 4 0 148 4 0 149 4 0 150 4 0 151 4 0 152 4 0 153 4 0 154 4 0 155 4 0 156 4 0 157 4 0 158 4 0 159 4 0 160 4 0 161 4 0 162 4 0 163 4 0 164 4 0 165 4 0 166 4 0 167 4 0 168 4 0 169 4 0 170 4 0 171 4 0 172 4 0 173 4 0 174 4 0 175 4 0 176 4 0 177 4 0 178 4 0 179 4 0 180 4 0 181 4 0 182 4 0 183 4 0 184 4 0 185 4 0 186 4 0 187 4 0 188 4 0 189 4 0 190 4 0 191 4 0 192 4 0 193 4 0 194 4 1 195 4 1 196 4 1 197 4 1 198 4 1 199 4 1 200 4 1 201 4 1 202 4 1 203 4 1 204 4 1 205 4 1 206 4 1 207 4 1 208 4 1 209 4 1 210 5 0 211 5 0 212 5 0 213 5 0 214 5 0 215 5 0 216 5 0 217 5 0 218 5 0 219 5 0 220 5 0 221 5 0 222 5 0 223 5 0 224 5 0 225 5 0 226 5 0 227 5 0 228 5 0 229 5 0 230 5 0 231 5 0 232 5 1 233 5 1 234 6 0 235 6 0 236 6 0 237 6 0 238 6 0 239 6 0 240 6 0 241 7 0 242 7 0 243 7 1 244 7 1 245 7 1 246 7 1 247 7 1 248 7 1 249 7 1 250 7 1 251 7 1 252 7 1 253 7 1 254 7 1 255 7 1 256 7 1 257 7 1 258 7 1 259 7 1 260 8 0 261 8 0 262 8 0 263 8 0 264 8 0 265 8 0 266 8 0 267 8 0 268 8 0 269 8 0 270 8 0 271 8 0 272 8 0 273 8 1 274 8 1 275 8 1 276 8 1 277 8 1 278 8 1 279 8 1 280 8 1 281 8 1 282 8 1 283 8 1 284 8 1 285 8 1 286 8 1 287 8 1 288 8 1 289 8 1 290 8 1 291 8 1 292 8 1 293 8 1 294 8 1 295 8 1 296 8 1 297 8 1 298 8 1 299 8 1 300 8 1 301 8 1 302 8 1 303 8 1 304 8 1 305 8 1 306 8 1 307 8 1 308 8 1 309 8 1 310 8 1 311 8 1 312 8 1 313 8 1 314 8 1 315 8 1 316 9 0 317 9 0 318 9 0 319 9 0 320 9 0 321 9 0 322 9 0 323 9 0 324 9 1 325 9 1 326 9 1 327 9 1 328 9 1 329 9 1 330 9 1 331 9 1 332 9 1 333 9 1 334 9 1 335 9 1 336 9 1 337 9 1 338 9 1 339 9 1 340 9 1 341 9 1 342 9 1 343 9 1 344 9 1 345 9 1 346 9 1 347 9 1 348 9 1 349 9 1 350 9 1 351 9 1 352 9 1 353 9 1 354 9 1 355 9 1 356 9 1 357 9 1 358 9 1 359 9 1 360 9 1 361 9 1 362 9 1 363 9 1 364 9 1 365 9 1 366 9 1 367 9 1 368 9 1 369 9 1 370 9 1 371 9 1 372 9 1 373 9 1 374 9 1 375 9 1 376 9 1 377 9 1 378 9 1 379 9 1 380 9 1 381 9 1 382 9 1 383 9 1 384 9 1 385 9 1 386 9 1 387 9 1 388 9 1 389 9 1 390 9 1 391 9 1 392 9 1 393 9 1 394 9 1 395 9 1 396 9 1 397 9 1 398 9 1 399 9 1 400 9 1 401 9 1 402 9 1 403 10 0 404 10 0 405 10 0 406 10 0 407 10 0 408 10 1 409 10 1 410 10 1 411 10 1 412 10 1 413 10 1 414 10 1 415 10 1 416 10 1 417 10 1 418 10 1 419 10 1 420 10 1 421 10 1 422 10 1 423 10 1 424 10 1 425 10 1 426 10 1 427 10 1 428 10 1 429 10 1 430 10 1 431 10 1 432 10 1 433 10 1 434 10 1 435 10 1 436 10 1 437 10 1 438 10 1 439 10 1 440 10 1 441 10 1 442 10 1 443 10 1 444 10 1 445 10 1 446 10 1 447 10 1 448 10 1 449 10 1 450 10 1 451 10 1 452 10 1 453 10 1 454 10 1 455 10 1 456 10 1 457 10 1 458 11 0 459 11 1 460 11 1 461 11 1 462 11 1 463 11 1 464 11 1 465 11 1 466 11 1 467 11 1 468 12 0 469 12 0 470 12 1 471 12 1 472 12 1 473 12 1 474 12 1 475 12 1 476 12 1 477 12 1 478 12 1 479 12 1 480 12 1 481 13 0 482 13 0 483 13 0 484 13 0 485 13 0 486 13 0 487 13 0 488 13 0 489 13 0 490 13 0 491 13 0 492 13 0 493 13 0 494 13 0 495 13 0 496 13 1 497 13 1 498 13 1 499 13 1 500 13 1 501 13 1 502 13 1 503 13 1 504 13 1 505 13 1 506 13 1 507 13 1 508 13 1 509 13 1 510 13 1 511 13 1 512 13 1 513 13 1 514 13 1 515 13 1 516 13 1 517 13 1 518 13 1 519 13 1 520 13 1 521 13 1 522 13 1 523 13 1 524 13 1 525 13 1 526 13 1 527 13 1 528 13 1 529 13 1 530 13 1 531 13 1 532 13 1 533 13 1 534 13 1 535 13 1 536 13 1 537 13 1 538 13 1 539 13 1 540 13 1 541 13 1 542 13 1 543 14 0 544 14 0 545 14 0 546 14 0 547 14 0 548 14 0 549 14 0 550 14 0 551 14 0 552 14 0 553 14 0 554 14 0 555 14 0 556 14 0 557 14 1 558 14 1 559 14 1 560 14 1 561 14 1 562 14 1 563 14 1 564 14 1 565 14 1 566 14 1 567 14 1 568 14 1 569 14 1 570 14 1 571 14 1 572 14 1 573 14 1 574 14 1 575 14 1 576 14 1 577 14 1 578 14 1 579 14 1 580 14 1 581 14 1 582 14 1 583 14 1 584 14 1 585 14 1 586 14 1 587 14 1 588 14 1 589 14 1 590 14 1 591 14 1 592 14 1 593 14 1 594 14 1 595 14 1 596 14 1 597 14 1 598 14 1 599 14 1 600 14 1 601 14 1 602 14 1 603 14 1 604 14 1 605 14 1 606 14 1 607 14 1 608 14 1 609 14 1 610 14 1 611 14 1 612 14 1 613 14 1 614 14 1 615 14 1 616 14 1 617 14 1 618 14 1 619 14 1 620 14 1 621 14 1 622 14 1 623 14 1 624 14 1 625 14 1 626 14 1 627 14 1 628 14 1 629 14 1 630 14 1 631 14 1 632 14 1 633 14 1 634 14 1 635 14 1 636 14 1 637 14 1 638 14 1 639 14 1 640 14 1 641 14 1 642 14 1 643 14 1 644 14 1 645 14 1 646 14 1 647 15 0 648 15 0 649 15 0 650 15 0 651 15 0 652 15 1 653 15 1 654 15 1 655 15 1 656 15 1 657 15 1 658 15 1 659 15 1 660 15 1 661 15 1 662 15 1 663 15 1 664 15 1 665 15 1 666 15 1 667 15 1 668 15 1 669 15 1 670 15 1 671 15 1 672 15 1 673 15 1 674 15 1 675 15 1 676 15 1 677 15 1 678 15 1 679 15 1 680 15 1 681 15 1 682 15 1 683 15 1 684 15 1 685 15 1 686 15 1 687 15 1 688 15 1 689 15 1 690 15 1 691 15 1 692 15 1 693 15 1 694 15 1 695 15 1 696 15 1 697 15 1 698 16 0 699 16 0 700 16 1 701 16 1 702 16 1 703 16 1 704 16 1 705 16 1 706 16 1 707 16 1 708 16 1 > splitbin(cbind(y, n - y) ~ dilution, orob1) id y dilution 1 1 0 1/1 2 1 0 1/1 3 1 0 1/1 4 1 0 1/1 5 1 0 1/1 6 1 0 1/1 7 1 0 1/1 8 1 0 1/1 9 1 0 1/1 10 1 0 1/1 11 1 0 1/1 12 1 0 1/1 13 1 0 1/1 14 1 0 1/1 15 1 0 1/1 16 1 0 1/1 17 1 0 1/1 18 1 0 1/1 19 1 0 1/1 20 1 0 1/1 21 1 0 1/1 22 1 0 1/1 23 1 0 1/1 24 1 0 1/1 25 1 0 1/1 26 1 0 1/1 27 1 0 1/1 28 1 0 1/1 29 1 0 1/1 30 1 0 1/1 31 1 0 1/1 32 1 0 1/1 33 1 0 1/1 34 1 0 1/1 35 1 0 1/1 36 1 0 1/1 37 1 0 1/1 38 1 0 1/1 39 1 0 1/1 40 1 0 1/1 41 1 0 1/1 42 1 1 1/1 43 1 1 1/1 44 2 0 1/1 45 2 0 1/1 46 2 0 1/1 47 2 0 1/1 48 2 0 1/1 49 2 0 1/1 50 2 0 1/1 51 2 0 1/1 52 2 0 1/1 53 2 0 1/1 54 2 0 1/1 55 2 0 1/1 56 2 0 1/1 57 2 0 1/1 58 2 0 1/1 59 2 0 1/1 60 2 0 1/1 61 2 0 1/1 62 2 0 1/1 63 2 0 1/1 64 2 0 1/1 65 2 0 1/1 66 2 0 1/1 67 2 0 1/1 68 2 0 1/1 69 2 0 1/1 70 2 0 1/1 71 2 0 1/1 72 2 0 1/1 73 2 0 1/1 74 2 0 1/1 75 2 0 1/1 76 2 0 1/1 77 2 0 1/1 78 2 0 1/1 79 2 0 1/1 80 2 0 1/1 81 2 0 1/1 82 2 0 1/1 83 2 0 1/1 84 2 0 1/1 85 2 0 1/1 86 2 1 1/1 87 2 1 1/1 88 2 1 1/1 89 2 1 1/1 90 2 1 1/1 91 2 1 1/1 92 2 1 1/1 93 2 1 1/1 94 2 1 1/1 95 3 0 1/1 96 3 0 1/1 97 3 0 1/1 98 3 0 1/1 99 3 0 1/1 100 3 0 1/1 101 3 0 1/1 102 3 0 1/1 103 3 0 1/1 104 3 0 1/1 105 3 0 1/1 106 3 0 1/1 107 3 0 1/1 108 3 0 1/1 109 3 0 1/1 110 3 0 1/1 111 3 0 1/1 112 3 0 1/1 113 3 0 1/1 114 3 0 1/1 115 3 0 1/1 116 3 0 1/1 117 3 0 1/1 118 3 0 1/1 119 3 0 1/1 120 3 0 1/1 121 3 0 1/1 122 3 0 1/1 123 3 0 1/1 124 3 0 1/1 125 3 0 1/1 126 3 0 1/1 127 3 0 1/1 128 3 0 1/1 129 3 0 1/1 130 3 0 1/1 131 3 0 1/1 132 3 0 1/1 133 3 0 1/1 134 3 1 1/1 135 3 1 1/1 136 3 1 1/1 137 3 1 1/1 138 3 1 1/1 139 4 0 1/1 140 4 0 1/1 141 4 0 1/1 142 4 0 1/1 143 4 0 1/1 144 4 0 1/1 145 4 0 1/1 146 4 0 1/1 147 4 0 1/1 148 4 0 1/1 149 4 0 1/1 150 4 0 1/1 151 4 0 1/1 152 4 0 1/1 153 4 0 1/1 154 4 0 1/1 155 4 0 1/1 156 4 0 1/1 157 4 0 1/1 158 4 0 1/1 159 4 0 1/1 160 4 0 1/1 161 4 0 1/1 162 4 0 1/1 163 4 0 1/1 164 4 0 1/1 165 4 0 1/1 166 4 0 1/1 167 4 0 1/1 168 4 0 1/1 169 4 0 1/1 170 4 0 1/1 171 4 0 1/1 172 4 0 1/1 173 4 0 1/1 174 4 0 1/1 175 4 0 1/1 176 4 0 1/1 177 4 0 1/1 178 4 0 1/1 179 4 0 1/1 180 4 0 1/1 181 4 0 1/1 182 4 0 1/1 183 4 0 1/1 184 4 0 1/1 185 4 0 1/1 186 4 0 1/1 187 4 0 1/1 188 4 0 1/1 189 4 0 1/1 190 4 0 1/1 191 4 0 1/1 192 4 0 1/1 193 4 0 1/1 194 4 1 1/1 195 4 1 1/1 196 4 1 1/1 197 4 1 1/1 198 4 1 1/1 199 4 1 1/1 200 4 1 1/1 201 4 1 1/1 202 4 1 1/1 203 4 1 1/1 204 4 1 1/1 205 4 1 1/1 206 4 1 1/1 207 4 1 1/1 208 4 1 1/1 209 4 1 1/1 210 5 0 1/1 211 5 0 1/1 212 5 0 1/1 213 5 0 1/1 214 5 0 1/1 215 5 0 1/1 216 5 0 1/1 217 5 0 1/1 218 5 0 1/1 219 5 0 1/1 220 5 0 1/1 221 5 0 1/1 222 5 0 1/1 223 5 0 1/1 224 5 0 1/1 225 5 0 1/1 226 5 0 1/1 227 5 0 1/1 228 5 0 1/1 229 5 0 1/1 230 5 0 1/1 231 5 0 1/1 232 5 1 1/1 233 5 1 1/1 234 6 0 1/1 235 6 0 1/1 236 6 0 1/1 237 6 0 1/1 238 6 0 1/1 239 6 0 1/1 240 6 0 1/1 241 7 0 1/25 242 7 0 1/25 243 7 1 1/25 244 7 1 1/25 245 7 1 1/25 246 7 1 1/25 247 7 1 1/25 248 7 1 1/25 249 7 1 1/25 250 7 1 1/25 251 7 1 1/25 252 7 1 1/25 253 7 1 1/25 254 7 1 1/25 255 7 1 1/25 256 7 1 1/25 257 7 1 1/25 258 7 1 1/25 259 7 1 1/25 260 8 0 1/25 261 8 0 1/25 262 8 0 1/25 263 8 0 1/25 264 8 0 1/25 265 8 0 1/25 266 8 0 1/25 267 8 0 1/25 268 8 0 1/25 269 8 0 1/25 270 8 0 1/25 271 8 0 1/25 272 8 0 1/25 273 8 1 1/25 274 8 1 1/25 275 8 1 1/25 276 8 1 1/25 277 8 1 1/25 278 8 1 1/25 279 8 1 1/25 280 8 1 1/25 281 8 1 1/25 282 8 1 1/25 283 8 1 1/25 284 8 1 1/25 285 8 1 1/25 286 8 1 1/25 287 8 1 1/25 288 8 1 1/25 289 8 1 1/25 290 8 1 1/25 291 8 1 1/25 292 8 1 1/25 293 8 1 1/25 294 8 1 1/25 295 8 1 1/25 296 8 1 1/25 297 8 1 1/25 298 8 1 1/25 299 8 1 1/25 300 8 1 1/25 301 8 1 1/25 302 8 1 1/25 303 8 1 1/25 304 8 1 1/25 305 8 1 1/25 306 8 1 1/25 307 8 1 1/25 308 8 1 1/25 309 8 1 1/25 310 8 1 1/25 311 8 1 1/25 312 8 1 1/25 313 8 1 1/25 314 8 1 1/25 315 8 1 1/25 316 9 0 1/25 317 9 0 1/25 318 9 0 1/25 319 9 0 1/25 320 9 0 1/25 321 9 0 1/25 322 9 0 1/25 323 9 0 1/25 324 9 1 1/25 325 9 1 1/25 326 9 1 1/25 327 9 1 1/25 328 9 1 1/25 329 9 1 1/25 330 9 1 1/25 331 9 1 1/25 332 9 1 1/25 333 9 1 1/25 334 9 1 1/25 335 9 1 1/25 336 9 1 1/25 337 9 1 1/25 338 9 1 1/25 339 9 1 1/25 340 9 1 1/25 341 9 1 1/25 342 9 1 1/25 343 9 1 1/25 344 9 1 1/25 345 9 1 1/25 346 9 1 1/25 347 9 1 1/25 348 9 1 1/25 349 9 1 1/25 350 9 1 1/25 351 9 1 1/25 352 9 1 1/25 353 9 1 1/25 354 9 1 1/25 355 9 1 1/25 356 9 1 1/25 357 9 1 1/25 358 9 1 1/25 359 9 1 1/25 360 9 1 1/25 361 9 1 1/25 362 9 1 1/25 363 9 1 1/25 364 9 1 1/25 365 9 1 1/25 366 9 1 1/25 367 9 1 1/25 368 9 1 1/25 369 9 1 1/25 370 9 1 1/25 371 9 1 1/25 372 9 1 1/25 373 9 1 1/25 374 9 1 1/25 375 9 1 1/25 376 9 1 1/25 377 9 1 1/25 378 9 1 1/25 379 9 1 1/25 380 9 1 1/25 381 9 1 1/25 382 9 1 1/25 383 9 1 1/25 384 9 1 1/25 385 9 1 1/25 386 9 1 1/25 387 9 1 1/25 388 9 1 1/25 389 9 1 1/25 390 9 1 1/25 391 9 1 1/25 392 9 1 1/25 393 9 1 1/25 394 9 1 1/25 395 9 1 1/25 396 9 1 1/25 397 9 1 1/25 398 9 1 1/25 399 9 1 1/25 400 9 1 1/25 401 9 1 1/25 402 9 1 1/25 403 10 0 1/25 404 10 0 1/25 405 10 0 1/25 406 10 0 1/25 407 10 0 1/25 408 10 1 1/25 409 10 1 1/25 410 10 1 1/25 411 10 1 1/25 412 10 1 1/25 413 10 1 1/25 414 10 1 1/25 415 10 1 1/25 416 10 1 1/25 417 10 1 1/25 418 10 1 1/25 419 10 1 1/25 420 10 1 1/25 421 10 1 1/25 422 10 1 1/25 423 10 1 1/25 424 10 1 1/25 425 10 1 1/25 426 10 1 1/25 427 10 1 1/25 428 10 1 1/25 429 10 1 1/25 430 10 1 1/25 431 10 1 1/25 432 10 1 1/25 433 10 1 1/25 434 10 1 1/25 435 10 1 1/25 436 10 1 1/25 437 10 1 1/25 438 10 1 1/25 439 10 1 1/25 440 10 1 1/25 441 10 1 1/25 442 10 1 1/25 443 10 1 1/25 444 10 1 1/25 445 10 1 1/25 446 10 1 1/25 447 10 1 1/25 448 10 1 1/25 449 10 1 1/25 450 10 1 1/25 451 10 1 1/25 452 10 1 1/25 453 10 1 1/25 454 10 1 1/25 455 10 1 1/25 456 10 1 1/25 457 10 1 1/25 458 11 0 1/25 459 11 1 1/25 460 11 1 1/25 461 11 1 1/25 462 11 1 1/25 463 11 1 1/25 464 11 1 1/25 465 11 1 1/25 466 11 1 1/25 467 11 1 1/25 468 12 0 1/625 469 12 0 1/625 470 12 1 1/625 471 12 1 1/625 472 12 1 1/625 473 12 1 1/625 474 12 1 1/625 475 12 1 1/625 476 12 1 1/625 477 12 1 1/625 478 12 1 1/625 479 12 1 1/625 480 12 1 1/625 481 13 0 1/625 482 13 0 1/625 483 13 0 1/625 484 13 0 1/625 485 13 0 1/625 486 13 0 1/625 487 13 0 1/625 488 13 0 1/625 489 13 0 1/625 490 13 0 1/625 491 13 0 1/625 492 13 0 1/625 493 13 0 1/625 494 13 0 1/625 495 13 0 1/625 496 13 1 1/625 497 13 1 1/625 498 13 1 1/625 499 13 1 1/625 500 13 1 1/625 501 13 1 1/625 502 13 1 1/625 503 13 1 1/625 504 13 1 1/625 505 13 1 1/625 506 13 1 1/625 507 13 1 1/625 508 13 1 1/625 509 13 1 1/625 510 13 1 1/625 511 13 1 1/625 512 13 1 1/625 513 13 1 1/625 514 13 1 1/625 515 13 1 1/625 516 13 1 1/625 517 13 1 1/625 518 13 1 1/625 519 13 1 1/625 520 13 1 1/625 521 13 1 1/625 522 13 1 1/625 523 13 1 1/625 524 13 1 1/625 525 13 1 1/625 526 13 1 1/625 527 13 1 1/625 528 13 1 1/625 529 13 1 1/625 530 13 1 1/625 531 13 1 1/625 532 13 1 1/625 533 13 1 1/625 534 13 1 1/625 535 13 1 1/625 536 13 1 1/625 537 13 1 1/625 538 13 1 1/625 539 13 1 1/625 540 13 1 1/625 541 13 1 1/625 542 13 1 1/625 543 14 0 1/625 544 14 0 1/625 545 14 0 1/625 546 14 0 1/625 547 14 0 1/625 548 14 0 1/625 549 14 0 1/625 550 14 0 1/625 551 14 0 1/625 552 14 0 1/625 553 14 0 1/625 554 14 0 1/625 555 14 0 1/625 556 14 0 1/625 557 14 1 1/625 558 14 1 1/625 559 14 1 1/625 560 14 1 1/625 561 14 1 1/625 562 14 1 1/625 563 14 1 1/625 564 14 1 1/625 565 14 1 1/625 566 14 1 1/625 567 14 1 1/625 568 14 1 1/625 569 14 1 1/625 570 14 1 1/625 571 14 1 1/625 572 14 1 1/625 573 14 1 1/625 574 14 1 1/625 575 14 1 1/625 576 14 1 1/625 577 14 1 1/625 578 14 1 1/625 579 14 1 1/625 580 14 1 1/625 581 14 1 1/625 582 14 1 1/625 583 14 1 1/625 584 14 1 1/625 585 14 1 1/625 586 14 1 1/625 587 14 1 1/625 588 14 1 1/625 589 14 1 1/625 590 14 1 1/625 591 14 1 1/625 592 14 1 1/625 593 14 1 1/625 594 14 1 1/625 595 14 1 1/625 596 14 1 1/625 597 14 1 1/625 598 14 1 1/625 599 14 1 1/625 600 14 1 1/625 601 14 1 1/625 602 14 1 1/625 603 14 1 1/625 604 14 1 1/625 605 14 1 1/625 606 14 1 1/625 607 14 1 1/625 608 14 1 1/625 609 14 1 1/625 610 14 1 1/625 611 14 1 1/625 612 14 1 1/625 613 14 1 1/625 614 14 1 1/625 615 14 1 1/625 616 14 1 1/625 617 14 1 1/625 618 14 1 1/625 619 14 1 1/625 620 14 1 1/625 621 14 1 1/625 622 14 1 1/625 623 14 1 1/625 624 14 1 1/625 625 14 1 1/625 626 14 1 1/625 627 14 1 1/625 628 14 1 1/625 629 14 1 1/625 630 14 1 1/625 631 14 1 1/625 632 14 1 1/625 633 14 1 1/625 634 14 1 1/625 635 14 1 1/625 636 14 1 1/625 637 14 1 1/625 638 14 1 1/625 639 14 1 1/625 640 14 1 1/625 641 14 1 1/625 642 14 1 1/625 643 14 1 1/625 644 14 1 1/625 645 14 1 1/625 646 14 1 1/625 647 15 0 1/625 648 15 0 1/625 649 15 0 1/625 650 15 0 1/625 651 15 0 1/625 652 15 1 1/625 653 15 1 1/625 654 15 1 1/625 655 15 1 1/625 656 15 1 1/625 657 15 1 1/625 658 15 1 1/625 659 15 1 1/625 660 15 1 1/625 661 15 1 1/625 662 15 1 1/625 663 15 1 1/625 664 15 1 1/625 665 15 1 1/625 666 15 1 1/625 667 15 1 1/625 668 15 1 1/625 669 15 1 1/625 670 15 1 1/625 671 15 1 1/625 672 15 1 1/625 673 15 1 1/625 674 15 1 1/625 675 15 1 1/625 676 15 1 1/625 677 15 1 1/625 678 15 1 1/625 679 15 1 1/625 680 15 1 1/625 681 15 1 1/625 682 15 1 1/625 683 15 1 1/625 684 15 1 1/625 685 15 1 1/625 686 15 1 1/625 687 15 1 1/625 688 15 1 1/625 689 15 1 1/625 690 15 1 1/625 691 15 1 1/625 692 15 1 1/625 693 15 1 1/625 694 15 1 1/625 695 15 1 1/625 696 15 1 1/625 697 15 1 1/625 698 16 0 1/625 699 16 0 1/625 700 16 1 1/625 701 16 1 1/625 702 16 1 1/625 703 16 1 1/625 704 16 1 1/625 705 16 1 1/625 706 16 1 1/625 707 16 1 1/625 708 16 1 1/625 > > > > cleanEx(); ..nameEx <- "summary.glimML-class" > > ### * summary.glimML-class > > flush(stderr()); flush(stdout()) > > ### Name: summary.glimML-class > ### Title: Summary of Objects of Class "summary.glimML" > ### Aliases: summary.glimML-class show,glimML-class summary,glimML-method > ### show,summary.glimML-method > ### Keywords: classes > > ### ** Examples > > data(orob2) > fm1 <- betabin(cbind(y, n - y) ~ seed, ~ 1, data = orob2) > # show objects of class "glimML" > fm1 Beta-binomial model ------------------- betabin(formula = cbind(y, n - y) ~ seed, random = ~1, data = orob2) Convergence was obtained after 80 iterations. Fixed-effect coefficients: Estimate Std. Error z value Pr(> |z|) (Intercept) -0.2602 0.2262 -1.1502 0.2500 seedO75 0.4130 0.2993 1.3798 0.1676 Overdispersion coefficients: Estimate Std. Error z value Pr(> z) phi.(Intercept) 0.078 0.0302 2.5885 0.0048 Log-likelihood = -63.553; nbpar = 3; df.residual = 18; Deviance = 50.509; AIC = 133.105 > # summary for objects of class "glimML" > res <- summary(fm1) > res@Coef Estimate Std. Error z value Pr(> |z|) (Intercept) -0.2601803 0.2261948 -1.150248 0.2500415 seedO75 0.4130146 0.2993271 1.379810 0.1676452 > # show objects of class "summary.glimML" > res Beta-binomial model ------------------- betabin(formula = cbind(y, n - y) ~ seed, random = ~1, data = orob2) Convergence was obtained after 80 iterations. Fixed-effect coefficients: Estimate Std. Error z value Pr(> |z|) (Intercept) -0.2602 0.2262 -1.1502 0.2500 seedO75 0.4130 0.2993 1.3798 0.1676 Overdispersion coefficients: Estimate Std. Error z value Pr(> z) phi.(Intercept) 0.078 0.0302 2.5885 0.0048 Log-likelihood = -63.553; nbpar = 3; df.residual = 18; Deviance = 50.509; AIC = 133.105 > > > > cleanEx(); ..nameEx <- "varbin" > > ### * varbin > > flush(stderr()); flush(stdout()) > > ### Name: varbin > ### Title: Mean, Variance and Confidence Interval of a Proportion > ### Aliases: varbin show,varbin-class > ### Keywords: htest > > ### ** Examples > > data(rabbits) > varbin(n, y, rabbits[rabbits$group == "M", ]) varbin(n = n, y = y, data = rabbits[rabbits$group == "M", ]) N = 21 clusters, n = 151 subjects, y = 52 cases. Proportion ---------- p se lower upper Binomial 0.3444 0.0388 0.2683 0.4204 Ratio 0.3444 0.0603 0.2263 0.4625 Arithmetic 0.3453 0.0706 0.2069 0.4837 Jackknife 0.3444 0.0601 0.2267 0.4621 Bootstrap 0.3456 0.0593 0.2294 0.4619 alpha = 0.05 for the CIs; R = 5000 samples for the bootstrap estimates. > by(rabbits, + list(group = rabbits$group), + function(x) varbin(n = n, y = y, data = x, R = 1000)) group: C varbin(n = n, y = y, data = x, R = 1000) N = 27 clusters, n = 215 subjects, y = 29 cases. Proportion ---------- p se lower upper Binomial 0.1349 0.0234 0.0891 0.1807 Ratio 0.1349 0.0356 0.0651 0.2046 Arithmetic 0.1480 0.0407 0.0683 0.2277 Jackknife 0.1346 0.0356 0.0650 0.2043 Bootstrap 0.1340 0.0343 0.0668 0.2013 alpha = 0.05 for the CIs; R = 1000 samples for the bootstrap estimates. ------------------------------------------------------------ group: H varbin(n = n, y = y, data = x, R = 1000) N = 17 clusters, n = 101 subjects, y = 23 cases. Proportion ---------- p se lower upper Binomial 0.2277 0.0419 0.1455 0.3099 Ratio 0.2277 0.0545 0.1210 0.3345 Arithmetic 0.2512 0.0603 0.1330 0.3694 Jackknife 0.2263 0.0549 0.1187 0.3338 Bootstrap 0.2307 0.0548 0.1233 0.3382 alpha = 0.05 for the CIs; R = 1000 samples for the bootstrap estimates. ------------------------------------------------------------ group: L varbin(n = n, y = y, data = x, R = 1000) N = 19 clusters, n = 133 subjects, y = 18 cases. Proportion ---------- p se lower upper Binomial 0.1353 0.0298 0.0770 0.1937 Ratio 0.1353 0.0412 0.0546 0.2160 Arithmetic 0.1135 0.0358 0.0433 0.1836 Jackknife 0.1363 0.0417 0.0546 0.2180 Bootstrap 0.1344 0.0403 0.0554 0.2133 alpha = 0.05 for the CIs; R = 1000 samples for the bootstrap estimates. ------------------------------------------------------------ group: M varbin(n = n, y = y, data = x, R = 1000) N = 21 clusters, n = 151 subjects, y = 52 cases. Proportion ---------- p se lower upper Binomial 0.3444 0.0388 0.2683 0.4204 Ratio 0.3444 0.0603 0.2263 0.4625 Arithmetic 0.3453 0.0706 0.2069 0.4837 Jackknife 0.3444 0.0601 0.2267 0.4621 Bootstrap 0.3451 0.0579 0.2317 0.4586 alpha = 0.05 for the CIs; R = 1000 samples for the bootstrap estimates. > > > > cleanEx(); ..nameEx <- "wald.test" > > ### * wald.test > > flush(stderr()); flush(stdout()) > > ### Name: wald.test > ### Title: Wald Test for Model Coefficients > ### Aliases: wald.test print.wald.test > ### Keywords: htest > > ### ** Examples > > data(orob2) > fm <- quasibin(cbind(y, n - y) ~ seed * root, data = orob2) > # Wald test for the effect of root > wald.test(b = coef(fm), Sigma = vcov(fm), Terms = 3:4) Wald test: ---------- Chi-squared test: X2 = 25.2, df = 2, P(> X2) = 3.4e-06 > > > > ### *