gday gurus, could someone please help me with this one? Can't find it in the doco. summary of my lm object gives "Pr(>|t|)" but coef doesn't. How do I get hold of these probabilities within an object? There doesn't seem to be an appropriate attribute within the object - I was hoping for something like "my.lm$probabilies". I was hoping to grab the best t scores at run-time. thanks, John Strumila -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help 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-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
On Mon, 4 Sep 2000, Strumila, John wrote:> gday gurus, > > could someone please help me with this one? Can't find it in the doco. > > summary of my lm object gives "Pr(>|t|)" but coef doesn't. How do I get > hold of these probabilities within an object? There doesn't seem to be an > appropriate attribute within the object - I was hoping for something like > "my.lm$probabilies".They are not in the object, but in the result of summary applied to the object. So:> example(lm) > slm.D9 <- summary(lm.D9) > names(slm.D9)[1] "call" "terms" "residuals" "coefficients" [5] "sigma" "df" "r.squared" "adj.r.squared" [9] "fstatistic" "cov.unscaled"> slm.D9$coefficientsEstimate Std. Error t value Pr(>|t|) (Intercept) 5.032 0.2202177 22.850117 9.547918e-15 groupTrt -0.371 0.3114349 -1.191260 2.490232e-01> slm.D9$coefficients[,4](Intercept) groupTrt 9.547918e-15 2.490232e-01 In general, summary.foo computes summaries, and print.summary.foo prints it. Sometimes there is more in the summary object than printed (e.g. intermediate results like the unscaled covariance matrix in summary.lm). In this case ?summary.lm will help, but R is not very complete at documenting summary methods. -- 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 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help 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-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
At 14:30 04/09/00 +1100, you wrote:>gday gurus, > >could someone please help me with this one? Can't find it in the doco. > >summary of my lm object gives "Pr(>|t|)" but coef doesn't. How do I get >hold of these probabilities within an object? There doesn't seem to be an >appropriate attribute within the object - I was hoping for something like >"my.lm$probabilies". > >I was hoping to grab the best t scores at run-time. > >thanks, >John StrumilaHi, Is it what you need?> mod <- lm(y ~ x) > coef(mod) # does not give all the information on coeffs(Intercept) x 2.5 1.5> coef(summary(mod))Estimate Std. Error t value Pr(>|t|) (Intercept) 2.5 0.7371569 3.391408 0.003471731 x 1.5 0.8296427 1.808007 0.088330784> coef(summary(mod))[2,4][1] 0.08833078 Best, Emmanuel Paradis -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help 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-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
thanks R friends especially Emmanuel Paradis and Brian Ripley. What an idiot - it's so obvious now! John Strumila -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help 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-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._