subsample

subsample

Synopsis

enum                SubsampleMode;
#define             RESAMPLED
DATASET *           fetch_full_dataset                  (void);
void                free_subsample_mask                 (char *s);
char *              copy_subsample_mask                 (const char *src,
                                                         int *err);
char *              copy_datainfo_submask               (const DATASET *dset,
                                                         int *err);
int                 write_datainfo_submask              (const DATASET *dset,
                                                         FILE *fp);
int                 write_model_submask                 (const MODEL *pmod,
                                                         FILE *fp);
int                 submask_cmp                         (const char *m1,
                                                         const char *m2);
int                 attach_subsample_to_model           (MODEL *pmod,
                                                         const DATASET *dset);
int                 add_dataset_to_model                (MODEL *pmod,
                                                         const DATASET *dset,
                                                         gretlopt opt);
int                 restrict_sample                     (const char *line,
                                                         const int *list,
                                                         DATASET *dset,
                                                         ExecState *state,
                                                         gretlopt opt,
                                                         PRN *prn);
int                 restrict_sample_from_mask           (char *mask,
                                                         DATASET *dset,
                                                         gretlopt opt);
int                 complex_subsampled                  (void);
int                 get_full_length_n                   (void);
void                set_dataset_resampled               (DATASET *dset);
int                 dataset_is_resampled                (const DATASET *dset);
int                 set_sample                          (const char *line,
                                                         DATASET *dset);
int                 restore_full_sample                 (DATASET *dset,
                                                         ExecState *state);
int                 backup_full_dataset                 (DATASET *dset);
int                 count_missing_values                (const DATASET *dset,
                                                         gretlopt opt,
                                                         PRN *prn,
                                                         int *err);
void                maybe_free_full_dataset             (const DATASET *dset);
int                 model_sample_problem                (MODEL *pmod,
                                                         const DATASET *dset);
void                print_sample_obs                    (const DATASET *dset,
                                                         PRN *prn);
void                print_sample_status                 (const DATASET *dset,
                                                         PRN *prn);
int                 data_report                         (const DATASET *dset,
                                                         const char *fname,
                                                         PRN *prn);

Description

Details

enum SubsampleMode

typedef enum {
    SUBSAMPLE_NONE,
    SUBSAMPLE_DROP_MISSING,
    SUBSAMPLE_USE_DUMMY,
    SUBSAMPLE_BOOLEAN,
    SUBSAMPLE_RANDOM,
    SUBSAMPLE_UNKNOWN
} SubsampleMode;

SUBSAMPLE_NONE

SUBSAMPLE_DROP_MISSING

SUBSAMPLE_USE_DUMMY

SUBSAMPLE_BOOLEAN

SUBSAMPLE_RANDOM

SUBSAMPLE_UNKNOWN


RESAMPLED

#define RESAMPLED ((char *) 0xdeadbeef)


fetch_full_dataset ()

DATASET *           fetch_full_dataset                  (void);


free_subsample_mask ()

void                free_subsample_mask                 (char *s);


copy_subsample_mask ()

char *              copy_subsample_mask                 (const char *src,
                                                         int *err);


copy_datainfo_submask ()

char *              copy_datainfo_submask               (const DATASET *dset,
                                                         int *err);


write_datainfo_submask ()

int                 write_datainfo_submask              (const DATASET *dset,
                                                         FILE *fp);


write_model_submask ()

int                 write_model_submask                 (const MODEL *pmod,
                                                         FILE *fp);


submask_cmp ()

int                 submask_cmp                         (const char *m1,
                                                         const char *m2);


attach_subsample_to_model ()

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


add_dataset_to_model ()

int                 add_dataset_to_model                (MODEL *pmod,
                                                         const DATASET *dset,
                                                         gretlopt opt);


restrict_sample ()

int                 restrict_sample                     (const char *line,
                                                         const int *list,
                                                         DATASET *dset,
                                                         ExecState *state,
                                                         gretlopt opt,
                                                         PRN *prn);


restrict_sample_from_mask ()

int                 restrict_sample_from_mask           (char *mask,
                                                         DATASET *dset,
                                                         gretlopt opt);


complex_subsampled ()

int                 complex_subsampled                  (void);


get_full_length_n ()

int                 get_full_length_n                   (void);


set_dataset_resampled ()

void                set_dataset_resampled               (DATASET *dset);


dataset_is_resampled ()

int                 dataset_is_resampled                (const DATASET *dset);


set_sample ()

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


restore_full_sample ()

int                 restore_full_sample                 (DATASET *dset,
                                                         ExecState *state);


backup_full_dataset ()

int                 backup_full_dataset                 (DATASET *dset);


count_missing_values ()

int                 count_missing_values                (const DATASET *dset,
                                                         gretlopt opt,
                                                         PRN *prn,
                                                         int *err);

Prints a count of missing values (if any) in the current dataset over the currently defined sample range (or the entire data range if OPT_A is given). If OPT_V is given this includes a count of missing values at each observation; otherwise it just includes global and per-variable counts.

dset :

dataset struct.

opt :

use OPT_V for verbose operation, OPT_A to examine all data.

prn :

printing struct.

err :

location to receive error code.

Returns :

0 if no missing values are found (or on error), otherwise the total number of missing values.

maybe_free_full_dataset ()

void                maybe_free_full_dataset             (const DATASET *dset);


model_sample_problem ()

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


print_sample_obs ()

void                print_sample_obs                    (const DATASET *dset,
                                                         PRN *prn);


print_sample_status ()

void                print_sample_status                 (const DATASET *dset,
                                                         PRN *prn);


data_report ()

int                 data_report                         (const DATASET *dset,
                                                         const char *fname,
                                                         PRN *prn);

Write out a summary of the content of the current data set.

dset :

data information struct.

fname :

filename for current datafile.

prn :

gretl printing struct.

Returns :

0 on successful completion, non-zero on error.