the function confint uses the profiling method of the function of the package MASS confint.glm even after the package has been detached! 1: might this be the intenden behavior? 2. How does the function remember its 'MASS' functionality after detaching the package? R: 1.8.0; Windows 2000 Here is a sample program> set.seed(7882) > x<-rep(c(0,1),c(20,20)) > p<-plogis(2+0.1*x) > y<-cbind(event,50-rbinom(length(p),50,p)) > xf<-factor(x) > g<-glm(y~xf,family=binomial) > > # conficence intervals according base package: > print(confint(g))2.5 % 97.5 % (Intercept) 1.65425534 2.0266122 xf1 0.06324695 0.6282106> > library(MASS) > print(confint(g))Waiting for profiling to be done... 2.5 % 97.5 % (Intercept) 1.66398057 2.0247678 xf1 0.07341592 0.6210034> > detach(package:MASS) > print(search())[1] ".GlobalEnv" "package:methods" "package:ctest" "package:mva" [5] "package:modreg" "package:nls" "package:ts" "Autoloads" [9] "package:base"> print(confint(g))Waiting for profiling to be done... 2.5 % 97.5 % (Intercept) 1.66398057 2.0247678 xf1 0.07341592 0.6210034 Ulrich Halekoh, PhD Institute of Agricultural Sciences, Biometry Group 8830 Tjele, Denmark, ulrich.halekoh at agrsci.dk
On Mon, 17 Nov 2003, Ulrich Halekoh wrote:> the function > confint > uses the profiling method of the function of the package MASS > > confint.glm > > even after the package has been detached!Why the exclamation mark? Note profile.glm is not actually in package:MASS (sic). Try looking for it:> getAnywhere("profile.glm")A single object matching 'profile.glm' was found It was found in the following places registered S3 method for profile from namespace MASS namespace:MASS with value ...> 1: might this be the intenden behavior?The accurate description is the intended behaviour.> 2. How does the function remember its 'MASS' functionality after > detaching the package?It isn't in the package .... There is currently no way to remove registered S3 methods like confint.glm in an R session. Nor is there likely to be in the near future, General comment: R has changed quite a lot recently, and older preconceptions do need to be checked against current information. The article `Name Space Management for R' in R-news 2003/1 may help (although it may tell you mor ethan you want to know). -- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272860 (secr) Oxford OX1 3TG, UK Fax: +44 1865 272595
Possibly Parallel Threads
- Problem in using confint method on polr model object
- glht (multcomp): NA's for confidence intervals using univariate_calpha (fwd)
- glht: Problem with symbolic contrast for factors with number-levels
- glht (multcomp): NA's for confidence intervals using univariate_calpha
- rstandard does not produce standardized residuals