Panel data

Panel data — estimation of panel data models

Functions

Object Hierarchy


Includes

#include <libgretl.h>

Description

Provides support for estimating panel data models such as fixed and random effects.

Functions

panel_diagnostics ()

int
panel_diagnostics (MODEL *pmod,
                   DATASET *dset,
                   gretlopt opt,
                   PRN *prn);

Returns


real_panel_model ()

MODEL
real_panel_model (const int *list,
                  DATASET *dset,
                  gretlopt opt,
                  PRN *prn);

Returns


panel_wls_by_unit ()

MODEL
panel_wls_by_unit (const int *list,
                   DATASET *dset,
                   gretlopt opt,
                   PRN *prn);

Performs weighted least squares (possibly iterated) on a panel model, allowing for groupwise heteroskedasticity.

Parameters

list

regression list.

 

dset

dataset struct.

 

opt

may include OPT_I (iterate to ML solution), OPT_V for verbose operation.

 

prn

for printing details of iterations (or NULL).

 

Returns

the estimates, in a MODEL.


panel_autocorr_test ()

int
panel_autocorr_test (MODEL *pmod,
                     int order,
                     DATASET *dset,
                     gretlopt opt,
                     PRN *prn);

Returns


groupwise_hetero_test ()

int
groupwise_hetero_test (MODEL *pmod,
                       DATASET *dset,
                       gretlopt opt,
                       PRN *prn);

Performs a Wald test for the null hypothesis that the error variance is uniform across the units.

Parameters

pmod

panel model to be tested.

 

dset

information on the (panel) data set.

 

opt

may contain OPT_S to attach the test result to pmod .

 

prn

for printing details of iterations (or NULL).

 

Returns

0 on success, non-zero error code on failure.


panel_tsls_robust_vcv ()

int
panel_tsls_robust_vcv (MODEL *pmod,
                       const DATASET *dset);

Returns


set_panel_structure_from_vars ()

int
set_panel_structure_from_vars (int uv,
                               int tv,
                               DATASET *dset);

Sets the panel structure of dset based on the information in the series with indices uv and tv , if possible.

Parameters

uv

index of series uniquely identifying units/groups.

 

tv

index of series uniquely identifying time periods.

 

dset

pointer to dataset.

 

Returns

0 on success, non-zero code on error.


set_panel_structure_from_line ()

int
set_panel_structure_from_line (const char *line,
                               DATASET *dset);

Returns


set_panel_group_strings ()

int
set_panel_group_strings (const char *line,
                         DATASET *dset);

Returns


switch_panel_orientation ()

int
switch_panel_orientation (DATASET *dset);

Reorganizes dset , transforming from stacked cross sections to stacked time series or vice versa. If the transformation is from stacked time series to stacked cross section, the dataset will no longer be acceptable as a panel for gretl's purposes; it may be useful for export purposes, though.

Parameters

dset

pointer to dataset struct.

 

Returns

0 on successful completion, non-zero on error.


balanced_panel ()

int
balanced_panel (const DATASET *dset);

Returns


undo_panel_padding ()

int
undo_panel_padding (DATASET *dset);

Returns


panel_list_omit ()

int *
panel_list_omit (const MODEL *orig,
                 const int *drop,
                 int *err);

Creates a new panel regression list, by first reconstructing the regression specification from orig then deleting from the reconstruction the variables found in drop .

Parameters

orig

list specifying original panel model.

 

drop

list of variables to be omitted.

 

err

pointer to receive error code.

 

Returns

the new, reduced list or NULL on error.


panel_list_add ()

int *
panel_list_add (const MODEL *orig,
                const int *add,
                int *err);

Creates a new panel regression list, by first reconstructing the regression specification from orig then adding to the reconstruction the variables found in add .

Parameters

orig

list specifying original panel model.

 

add

list of variables to be added.

 

err

pointer to receive error code.

 

Returns

the new, augmented list or NULL on error.


panel_variance_info ()

int
panel_variance_info (const double *x,
                     const DATASET *dset,
                     double xbar,
                     double *psw,
                     double *psb);

Returns


plausible_panel_time_var ()

int
plausible_panel_time_var (const DATASET *dset);

Returns


panel_isconst ()

int
panel_isconst (int t1,
               int t2,
               int pd,
               const double *x,
               int bygroup);

Check whether series x is constant (either over time or across groups) in a panel dataset. Missing values are ignored.

Parameters

t1

starting observation.

 

t2

ending observation.

 

pd

panel time-series length.

 

x

data series to examine.

 

bygroup

use 1 to check for constancy across groups, 0 for constancy across time.

 

Returns

1 if the variable is constant, otherwise 0.


series_is_group_invariant ()

int
series_is_group_invariant (const DATASET *dset,
                           int v);

Returns


panel_padding_rows ()

int
panel_padding_rows (const DATASET *dset);

Returns

Types and Values