【问题标题】:Gretl - test alpha and betaGretl - 测试 alpha 和 beta
【发布时间】:2013-04-14 09:16:34
【问题描述】:

我用一个excel数据集做了一个普通的最小二乘。现在我想使用 0.05% 的错误概率来测试 α 与 0 的值和 β 与 1 的值。

如何在 gretl 中做到这一点?

感谢你的回答!!!

【问题讨论】:

    标签: statistics regression-testing gretl


    【解决方案1】:

    我编辑您的帖子以添加一个 gretl 标志,希望我们在 SO 中也有更多的 gretl 用户。

    现在要回答您的问题,您需要处理模型中的一般线性限制并计算相关的 F 检验。

    所以要使用 gretl,您可以使用 gretl 脚本语言 hansl 执行类似的操作:

    open murder_rates
    ols executions const income lfp southern --quiet
    
    restrict
    b[income]=0
    b[lfp]=1
    end restrict
    

    我们有以下结果

    ## Restriction set
    ##  1: b[income] = 0
    ##  2: b[lfp] = 1
    
    ## Test statistic: F(2, 41) = 29633.7, with p-value = 1.6337e-65
    
    ## Restricted estimates:
    
    ##              coefficient   std. error   t-ratio    p-value 
    ##   ---------------------------------------------------------
    ##   const       -53.0056      0.370949    -142.9     3.29e-59 ***
    ##   income        0.00000     0.00000       NA      NA       
    ##   lfp           1.00000     0.00000       NA      NA       
    
    ##   Standard error of the regression = 2.4606
    

    如果您想使用 R 轻松完成此操作,请检查 car 包(linearHypothesis 函数)

    【讨论】:

    • 非常感谢您的回答!!!是否还有可以使用 gretl IDE 的解决方案?你的模型中的b[income]=0 是什么?它看起来像b=1 对于 \beta = 1 和 a=1 对于 \alpha = 0?如何直接取系数名称?非常感谢你的回答!!!
    • 如果你的 coef 被命名为 beta 和 alpha,它将是 b[beta]=1b[alpha]=0。您也可以使用数字下标。所以b 不是用于变量b,而是用于访问模型中的所有系数。
    猜你喜欢
    • 1970-01-01
    • 2014-07-15
    • 1970-01-01
    • 2014-06-07
    • 2018-12-07
    • 2013-05-13
    • 1970-01-01
    • 1970-01-01
    • 2014-12-27
    相关资源
    最近更新 更多