subsample

subsample

Functions

Types and Values

#define RESAMPLED

Description

Functions

fetch_full_dataset ()

DATASET *
fetch_full_dataset (void);

sync_dataset_shared_members ()

void
sync_dataset_shared_members (const DATASET *dset);

free_subsample_mask ()

void
free_subsample_mask (char *s);

copy_subsample_mask ()

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

copy_dataset_submask ()

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

write_dataset_submask ()

int
write_dataset_submask (const DATASET *dset,
                       PRN *prn);

write_model_submask ()

int
write_model_submask (const MODEL *pmod,
                     PRN *prn);

get_dataset_submask_size ()

int
get_dataset_submask_size (const DATASET *dset);

get_model_submask_size ()

int
get_model_submask_size (const MODEL *pmod);

subsample_check_model ()

int
subsample_check_model (MODEL *pmod,
                       char *mask);

remove_model_subsample_info ()

int
remove_model_subsample_info (MODEL *pmod);

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 *param,
                 const int *list,
                 DATASET *dset,
                 ExecState *state,
                 gretlopt opt,
                 PRN *prn,
                 int *n_dropped);

restrict_sample_from_mask ()

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

perma_sample ()

int
perma_sample (DATASET *dset,
              gretlopt opt,
              PRN *prn,
              int *n_dropped);

recode_strvals ()

int
recode_strvals (DATASET *dset,
                gretlopt opt);

complex_subsampled ()

int
complex_subsampled (void);

dataset_is_subsampled ()

int
dataset_is_subsampled (const DATASET *dset);

get_full_length_n ()

int
get_full_length_n (void);

set_dataset_resampled ()

void
set_dataset_resampled (DATASET *dset,
                       unsigned int seed);

dataset_is_resampled ()

int
dataset_is_resampled (const DATASET *dset);

set_sample ()

int
set_sample (const char *start,
            const char *stop,
            DATASET *dset,
            gretlopt opt);

Sets the current sample range for dset to that specified by start and stop , if possible.

If opt contains OPT_T, make the sub-sampling permanent, or in other words shrink the dataset to the selected range.

Parameters

start

start of sample range.

 

stop

end of sample range.

 

dset

pointer to dataset struct.

 

opt

options flag(s).

 

Returns

0 on successful completion, non-zero error code otherwise.


set_panel_sample ()

int
set_panel_sample (const char *start,
                  const char *stop,
                  gretlopt opt,
                  DATASET *dset,
                  ExecState *s,
                  PRN *prn);

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.

Parameters

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 (const MODEL *pmod,
                      const DATASET *dset);

fcast_not_feasible ()

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

same_dataset ()

int
same_dataset (const 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.

Parameters

dset

data information struct.

 

fname

filename for current datafile.

 

prn

gretl printing struct.

 

Returns

0 on successful completion, non-zero on error.

Types and Values

RESAMPLED

#define RESAMPLED ((char *) 0xdeadbeef)