Hi all! I've got this error while running
example(Glm) library("rms") > example(Glm) Glm> ## Dobson (1990) Page 93: Randomized Controlled Trial : Glm> counts <- c(18,17,15,20,10,20,25,13,12) Glm> outcome <- gl(3,1,9) Glm> treatment <- gl(3,3) Glm> f <- glm(counts ~ outcome + treatment, family=poisson()) Glm> f Call: glm(formula = counts ~ outcome + treatment, family = poisson()) Coefficients: (Intercept) outcome2 outcome3 treatment2 treatment3 3.045e+00 -4.543e-01 -2.930e-01 -4.210e-16 -3.997e-16 Degrees of Freedom: 8 Total (i.e. Null); 4 Residual Null Deviance: 10.58 Residual Deviance: 5.129 AIC: 56.76 Glm> anova(f) Analysis of Deviance Table Model: poisson, link: log Response: counts Terms added sequentially (first to last) Df Deviance Resid. Df Resid. Dev NULL 8 10.5814 outcome 2 5.4523 6 5.1291 treatment 2 0.0000 4 5.1291 Glm> summary(f) Call: glm(formula = counts ~ outcome + treatment, family = poisson()) Deviance Residuals: 1 2 3 4 5 6 7 8 -0.67125 0.96272 -0.16965 -0.21999 -0.95552 1.04939 0.84715 -0.09167 9 -0.96656 Coefficients: Estimate Std. Error z value Pr(>|z|) (Intercept) 3.045e+00 1.709e-01 17.815 <2e-16 *** outcome2 -4.543e-01 2.022e-01 -2.247 0.0246 * outcome3 -2.930e-01 1.927e-01 -1.520 0.1285 treatment2 -4.210e-16 2.000e-01 0.000 1.0000 treatment3 -3.997e-16 2.000e-01 0.000 1.0000 --- Signif. codes: 0 â***â 0.001 â**â 0.01 â*â 0.05 â.â 0.1 â â 1 (Dispersion parameter for poisson family taken to be 1) Null deviance: 10.5814 on 8 degrees of freedom Residual deviance: 5.1291 on 4 degrees of freedom AIC: 56.761 Number of Fisher Scoring iterations: 4 Glm> f <- Glm(counts ~ outcome + treatment, family=poisson()) Error in Design(eval(mf, parent.frame())) : dataset dd not found for options(datadist=) My session Info sessionInfo() R version 2.12.1 Patched (2011-01-08 r53945) Platform: x86_64-unknown-linux-gnu (64-bit) locale: [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 [5] LC_MONETARY=C LC_MESSAGES=en_US.UTF-8 [7] LC_PAPER=en_US.UTF-8 LC_NAME=C [9] LC_ADDRESS=C LC_TELEPHONE=C [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C attached base packages: [1] tcltk tools splines stats graphics grDevices utils [8] datasets methods base other attached packages: [1] lattice_0.19-17 debug_1.2.4 mvbutils_2.5.4 rms_3.1-0 [5] mgcv_1.7-2 Hmisc_3.8-3 survival_2.36-2 foreign_0.8-41 loaded via a namespace (and not attached): [1] cluster_1.13.2 grid_2.12.1 Matrix_0.999375-46 nlme_3.1-97 While I don't have this issue on another R-machine > library(rms) > example(Glm) Glm> ## Dobson (1990) Page 93: Randomized Controlled Trial : Glm> counts <- c(18,17,15,20,10,20,25,13,12) Glm> outcome <- gl(3,1,9) Glm> treatment <- gl(3,3) Glm> f <- glm(counts ~ outcome + treatment, family=poisson()) Glm> f Call: glm(formula = counts ~ outcome + treatment, family = poisson()) Coefficients: (Intercept) outcome2 outcome3 treatment2 treatment3 3.045e+00 -4.543e-01 -2.930e-01 8.717e-16 4.557e-16 Degrees of Freedom: 8 Total (i.e. Null); 4 Residual Null Deviance: 10.58 Residual Deviance: 5.129 AIC: 56.76 Glm> anova(f) Analysis of Deviance Table Model: poisson, link: log Response: counts Terms added sequentially (first to last) Df Deviance Resid. Df Resid. Dev NULL 8 10.5814 outcome 2 5.4523 6 5.1291 treatment 2 0.0000 4 5.1291 Glm> summary(f) Call: glm(formula = counts ~ outcome + treatment, family = poisson()) Deviance Residuals: 1 2 3 4 5 6 7 8 -0.67125 0.96272 -0.16965 -0.21999 -0.95552 1.04939 0.84715 -0.09167 9 -0.96656 Coefficients: Estimate Std. Error z value Pr(>|z|) (Intercept) 3.045e+00 1.709e-01 17.815 <2e-16 *** outcome2 -4.543e-01 2.022e-01 -2.247 0.0246 * outcome3 -2.930e-01 1.927e-01 -1.520 0.1285 treatment2 8.717e-16 2.000e-01 0.000 1.0000 treatment3 4.557e-16 2.000e-01 0.000 1.0000 --- Signif. codes: 0 â***â 0.001 â**â 0.01 â*â 0.05 â.â 0.1 â â 1 (Dispersion parameter for poisson family taken to be 1) Null deviance: 10.5814 on 8 degrees of freedom Residual deviance: 5.1291 on 4 degrees of freedom AIC: 56.761 Number of Fisher Scoring iterations: 4 Glm> f <- Glm(counts ~ outcome + treatment, family=poisson()) Glm> # could have had rcs( ) etc. if there were continuous predictors Glm> f General Linear Model Glm(formula = counts ~ outcome + treatment, family = poisson()) Model Likelihood Ratio Test Obs 9 LR chi2 5.45 Residual d.f. 4 d.f. 4 g 0.227 Pr(> chi2) 0.2440 Coef S.E. Wald Z Pr(>|Z|) Intercept 3.0445 0.1709 17.81 <0.0001 outcome2 -0.4543 0.2022 -2.25 0.0246 outcome3 -0.2930 0.1927 -1.52 0.1285 treatment2 0.0000 0.2000 0.00 1.0000 treatment3 0.0000 0.2000 0.00 1.0000 Glm> anova(f) Wald Statistics Response: counts Factor Chi-Square d.f. P outcome 5.49 2 0.0643 treatment 0.00 2 1.0000 TOTAL 5.49 4 0.2409 Glm> summary(f, outcome=c('1','2','3'), treatment=c('1','2','3')) Effects Response : counts Factor Low High Diff. Effect S.E. Lower 0.95 Upper 0.95 outcome - 1:2 2 1 NA 0.45 0.20 0.06 0.85 outcome - 3:2 2 3 NA 0.16 0.22 -0.26 0.58 treatment - 1:2 2 1 NA 0.00 0.20 -0.39 0.39 treatment - 3:2 2 3 NA 0.00 0.20 -0.39 0.39 > sessionInfo() R version 2.12.1 (2010-12-16) Platform: i686-pc-linux-gnu (32-bit) locale: [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 [5] LC_MONETARY=C LC_MESSAGES=en_US.UTF-8 [7] LC_PAPER=en_US.UTF-8 LC_NAME=C [9] LC_ADDRESS=C LC_TELEPHONE=C [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C attached base packages: [1] splines stats graphics grDevices utils datasets methods [8] base other attached packages: [1] rms_3.1-0 Hmisc_3.8-3 survival_2.36-2 loaded via a namespace (and not attached): [1] cluster_1.13.2 grid_2.12.1 lattice_0.19-13 tools_2.12.1 Many thanks Anna Anna Freni Sterrantino Ph.D Student Department of Statistics University of Bologna, Italy via Belle Arti 41, 40124 BO. [[alternative HTML version deleted]]
______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.