R:lm对象输出的标准错误 [英] R: standard error output from lm object

查看:49
本文介绍了R:lm对象输出的标准错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们从中获得了lm对象,并希望提取标准错误

We got a lm object from and want to extract the standard error

lm_aaa<- lm(aaa~x+y+z)

我知道函数摘要,名称和系数.但是,摘要似乎是手动访问标准错误的唯一方法.你知道我怎么能输出se吗?

I know the function summary, names and coefficients. However, summary seems to be the only way to manually access the standard error. Have you any idea how I can just output se?

谢谢!

推荐答案

summary 函数的输出只是R 列表.因此,您可以使用所有标准列表操作.例如:

The output of from the summary function is just an R list. So you can use all the standard list operations. For example:

#some data (taken from Roland's example)
x = c(1,2,3,4)
y = c(2.1,3.9,6.3,7.8)

#fitting a linear model
fit = lm(y~x)
m = summary(fit)

m 对象或列表具有许多属性.您可以使用方括号或命名方法来访问它们:

The m object or list has a number of attributes. You can access them using the bracket or named approach:

m$sigma
m[[6]]

一个方便的功能是 str .此功能提供了对象属性的摘要,即

A handy function to know about is, str. This function provides a summary of the objects attributes, i.e.

str(m)

这篇关于R:lm对象输出的标准错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆