p60 grunest1.ox

来自「时间序列分析中著名的OxMetrics软件包」· OX 代码 · 共 34 行

OX
34
字号
#include <oxstd.h>
#import <packages/dpd/dpd>

main()
{
    decl dpd = new DPD();  // declare and create DPD object
                                               
    dpd.Load("grunfeld.xls");				   // load data
    //print( dpd.GetAll() );  // would print whole database
    dpd.Info();        // print database summary statistics
    dpd.SetYear("Year");      // specify columns with years

    dpd.Select(Y_VAR, {"I", 0, 0});      // formulate model
    dpd.Select(X_VAR, {"F_1", 0, 0, "C_1", 0, 0});

    //------------------- OLS -----------------------------
	dpd.SetOptions(FALSE);		   // no robust std.errors
    dpd.SetTransform(T_NONE);         // estimate in levels
    print("\n\n***** Baltagi (1995), Table 2.1: OLS");
    dpd.Estimate();                    // 1-step estimation

    //------------------- between -------------------------
    dpd.SetTransform(T_BETWEEN); // estimate between groups
    print("\n\n***** Baltagi (1995), Table 2.1: Between");
    dpd.Estimate();                    // 1-step estimation

    //------------------- within --------------------------
    dpd.SetTransform(T_WITHIN);   // estimate within groups
    print("\n\n***** Baltagi (1995), Table 2.1: Within");
    dpd.Estimate();                    // 1-step estimation

    delete dpd;                     // finished with object
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?