使用BIC准则运行逐步线性模型 [英] Running a stepwise linear model with BIC criterion

查看:244
本文介绍了使用BIC准则运行逐步线性模型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以设置逐步线性模型以使用BIC标准而不是AIC?

Is it possible to set a stepwise linear model to use the BIC criteria rather than AIC?

我一直在尝试,但是它仍然使用AIC值而不是BIC来计算每个步骤

I've been trying this but it still calculates each step using AIC values rather than BIC

null = lm(data[,1] ~ 1)
full = lm(data[,1] ~ age + bmi + gender + group)
step(null, scope = list(lower=null,upper=full),
     direction="both", criterion = "BIC")

推荐答案

将参数k=log(n)添加到step函数(模型矩阵中n个样本的数量)

Add the argument k=log(n) to the step function (n number of samples in the model matrix)

来自?step:

参数:
...

Arguments:
...

k 用于惩罚的自由度数的倍数. 只有k = 2才是真正的AIC; k = log(n)有时被称为 作为BIC或SBC.

k the multiple of the number of degrees of freedom used for the penalty. Only k = 2 gives the genuine AIC; k = log(n) is sometimes referred to as BIC or SBC.

这篇关于使用BIC准则运行逐步线性模型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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