Apologies for this simple question - Given the number of comparisons I need to do it has become somewhat laborious to compute the SSE manually. I first have to extract the coefficients, build the model and run the model on the data. So far I haven't found any method in R that will do this for me. Is there a method that I haven't seen, or is there a small function I could write that would do this, and how might I go about that? Thanks, Brian [[alternative HTML version deleted]]
It is not clear what you are doing or why you are doing it. If you tell us your ultimate goal we may be able to help you find a way that does not require all the computing that you are doing. How do you get your coefficients? Are you using lm? Have you looked at the resid function? -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.snow at imail.org 801.408.8111> -----Original Message----- > From: r-help-bounces at r-project.org [mailto:r-help-bounces at r- > project.org] On Behalf Of Brian J Mingus > Sent: Tuesday, January 25, 2011 9:08 AM > To: R-help at r-project.org > Subject: [R] Extracting SSE from lm > > Apologies for this simple question - > > Given the number of comparisons I need to do it has become somewhat > laborious to compute the SSE manually. I first have to extract the > coefficients, build the model and run the model on the data. So far I > haven't found any method in R that will do this for me. Is there a > method > that I haven't seen, or is there a small function I could write that > would > do this, and how might I go about that? > > Thanks, > > Brian > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at 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.
On 2011-01-25 08:08, Brian J Mingus wrote:> Apologies for this simple question - > > Given the number of comparisons I need to do it has become somewhat > laborious to compute the SSE manually. I first have to extract the > coefficients, build the model and run the model on the data. So far I > haven't found any method in R that will do this for me. Is there a method > that I haven't seen, or is there a small function I could write that would > do this, and how might I go about that?You can always write a function to automate whatever you're doing now. But if I understand what you need, try: tail( anova( yourModel )[, 2], 1) Peter Ehlers> > Thanks, > > Brian > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at 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.