I have a small problem. I am running glm() in R-0.61.0 on Redhat 4.2. I want to get the standard errors from the output. If I do out <- glm(....) summary(out) I get the coefficients printed as well as their correlation matrix. If I do out$coefficients I get the coefficients out$fitted gives me the fitted values I can then assign the fitted values or the value of the estimated coefficients to a variable. How do I get the covariance matrix of the estimates? I have tried out$R but that gives me a matrix with numbers I don't understand. Sorry to bug you with such a simple problem. Helgi Tomasson -- Helgi Tomasson FAX: 354-552-6806 University of Iceland PHONE:354-525-4571 Faculty of Economics and Business Administration email:helgito at hag.hi.is Oddi v/ Sturlugotu IS-101 Reykjavik ICELAND -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 Sat, 4 Apr 1998, Helgi Tomasson wrote:> I have a small problem. I am running glm() in R-0.61.0 on Redhat 4.2. > I want to get the standard errors from the output. If I doUse summary(mymodel)$coefficients[,2] This returns the second column of the table of coefficients, standard errors, and t values that is produced by summary.glm Thomas Lumley ------------------------------------------------------+------ Biostatistics : "Never attribute to malice what : Uni of Washington : can be adequately explained by : Box 357232 : incompetence" - Hanlon's Razor : Seattle WA 98195-7232 : : ------------------------------------------------------------ -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._

Helgi Tomasson writes: > out <- glm(....) > summary(out) > I want to get the standard errors from the output.> SE <- summary(out)$coef[, 2]> How do I get the covariance matrix of the estimates?> summary(out)$covmatIf you want several things from the summary it is less computation to create the object once and then extract them.> out <- glm(...) > sout <- summary(out) > sout. . .> SE <- sout$coef[, 2] > Vm <- sout$covmatAlso> names(sout)gives a good idea what else is buried in the summary object. Remember that when you print an object you don't necessarily see everything that is there. (This is a feature, not a bug!) -- Bill Venables, Head, Dept of Statistics, Tel.: +61 8 8303 5418 University of Adelaide, Fax.: +61 8 8303 3696 South AUSTRALIA. 5005. Email: Bill.Venables at adelaide.edu.au -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._