david.firth@nuf.ox.ac.uk
2001-Oct-01 13:13 UTC
[Rd] lm documentation, "formula" component (PR#1105)
Full_Name: David Firth Version: 1.3.1 OS: linux and others Submission from: (NULL) (163.1.103.121) help(lm) says that An object of class `"lm"' is a list containing at least the following components: ... formula: the formula supplied. But is the "formula" component necessarily present? An example:> x<-rnorm(10) > y<-rnorm(10) > temp<-lm(y~x) > names(temp)[1] "coefficients" "residuals" "effects" "rank" [5] "fitted.values" "assign" "qr" "df.residual" [9] "xlevels" "call" "terms" "model"> temp$formulaNULL -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-devel-request@stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Peter Dalgaard BSA
2001-Oct-01 13:21 UTC
[Rd] lm documentation, "formula" component (PR#1105)
david.firth@nuf.ox.ac.uk writes:> Full_Name: David Firth > Version: 1.3.1 > OS: linux and others > Submission from: (NULL) (163.1.103.121) > > > help(lm) > > says that > > An object of class `"lm"' is a list containing at least the > following components: > > ... > > formula: the formula supplied. > > > But is the "formula" component necessarily present? > > An example: > > x<-rnorm(10) > > y<-rnorm(10) > > temp<-lm(y~x) > > names(temp) > [1] "coefficients" "residuals" "effects" "rank" > [5] "fitted.values" "assign" "qr" "df.residual" > [9] "xlevels" "call" "terms" "model" > > temp$formula > NULLNicely spotted. Yes, it's present:> formula(temp)y ~ x However, it is part of the terms (and model) component, not a component in itself (str(temp) to see it) so should probably not be documented as such. -- O__ ---- Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk) FAX: (+45) 35327907 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-devel-request@stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Seemingly Similar Threads
- extracting P values from lm model
- inconsistent handling of factor, character, and logical predictors in lm()
- regression parms var-cov matrix
- inconsistent handling of factor, character, and logical predictors in lm()
- Very simple question about list components