#include <oxstd.h>
#include <database.h>
#pragma link("database.oxo")

main()
{   decl dbase, y, dy, names;

    dbase = new Database();
    dbase->LoadIn7("data/data.in7");

    dbase->Info();

    dbase->Select(0, { "CONS", 0, 0, "INC", 0, 0 } );
    dbase->Select(1, { "CONS", 1, 1, "INC", 1, 1 } );
    dbase->SetSample(1953, 1, 1992, 3);

    y = dbase->GetGroup(0);
    dy  = y - dbase->GetGroup(1);

    names = {"CONS", "INC", "DCONS", "DINC"};
    print("\nsample variance over ",
          dbase->GetSelSample(),
          "%r", names, "%c", names, variance(y ~ dy) );

    delete dbase;
}

