Hi, I would like to know if anyone has any idea of how to extract Std.Error from the regression output. I know how to extract coefficients, but I could not figure out how to retrieve std. error... Thank you for your help. soyoko ______________________________________ Ms. Soyoko Umeno Graduate Research Assitant for the Illinois-Missouri Biotechnology Alliance (IMBA) at http://www.imba.missouri.edu/ Ph.D. Student at the Department of Agricultural and Consumer Economics at the University of Illinois at Urbana-Champaign Office Phone: 217-333-3417 or 217-333-0364 Fax: 217-244-4817 Mailing Address: 1301 W. Gregory Dr. MC710, Urbana, IL 61801
umeno wrote:> I would like to know if anyone has any idea of how to extract Std.Error from > the regression output. I know how to extract coefficients, but I could not > figure out how to retrieve std. error...Given a model like this model <- lm(y~x) first analyse the data structure of the summary() with str(summary(model)) looking into this, the following (or something similar for the other values) should work: summary(reg)$coefficients[,2] Thomas P. -- Thomas Petzoldt Dresden University of Technology Institute of Hydrobiology petzoldt at rcs.urz.tu-dresden.de 01062 Dresden http://www.tu-dresden.de/fghhihb/
Or use the generic function vcov. On Thu, 30 Oct 2003, Thomas Petzoldt wrote:> umeno wrote: > > > I would like to know if anyone has any idea of how to extract Std.Error from > > the regression output. I know how to extract coefficients, but I could not > > figure out how to retrieve std. error... > > Given a model like this > > model <- lm(y~x) > > first analyse the data structure of the summary() with > > str(summary(model)) > > looking into this, the following (or something similar for the other > values) should work: > > summary(reg)$coefficients[,2]-- 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 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
Thomas Petzoldt <petzoldt at rcs.urz.tu-dresden.de> writes:> umeno wrote: > > > I would like to know if anyone has any idea of how to extract > > Std.Error from the regression output. I know how to extract > > coefficients, but I could not figure out how to retrieve > > std. error... > > > Given a model like this > > model <- lm(y~x) > > first analyse the data structure of the summary() with > > str(summary(model)) > > looking into this, the following (or something similar for the other > values) should work: > > summary(reg)$coefficients[,2]It would be better form to use coef(summary(reg))[, 2] or even coef(summary(reg))[, "Std. Error"] It is safer to use extractor functions like coef() than to rely on the object returned by summary having components with particular names.