missing

missing

Functions

Types and Values

#define NADBL

Description

Functions

isfinite()

# define isfinite(x) (!isnan(x) && !isinf(x))

na()

#define na(x) (isnan(x) || isinf(x))

model_missing ()

int
model_missing (const MODEL *pmod,
               int t);

model_has_missing_obs ()

int
model_has_missing_obs (const MODEL *pmod);

Parameters

pmod

pointer to model.

 

Returns

1 if there are missing observations in the model's sample range, otherwise 0.


first_missing_index ()

int
first_missing_index (const double *x,
                     int t1,
                     int t2);

Parameters

x

array to be checked for missing values.

 

t1

start of range to check.

 

t2

end of range to check.

 

Returns

the index of the first missing observation in x over the sample range t1 to t2 , or -1 if there is no such observation.


series_adjust_sample ()

int
series_adjust_sample (const double *x,
                      int *t1,
                      int *t2);

Adjusts t1 and t2 so as to drop any leading or trailing missing observations.

Parameters

x

series to be checked for missing values.

 

t1

on entry, initial start of sample range; on exit, start of sample range adjusted for missing values.

 

t2

on entry, initial end of sample range; on exit, end of sample range adjusted for missing values.

 

Returns

E_MISSDATA if interior missing values were found within the (possibly adjusted) sample range, otherwise 0.


list_adjust_sample ()

int
list_adjust_sample (const int *list,
                    int *t1,
                    int *t2,
                    const DATASET *dset,
                    int *nmiss);

Drops leading or trailing observations from the sample range initially given by the values in t1 and t2 if missing values are found for any of the variables given in list .

If nmiss is non-NULL it receives the number of missing values inside the (possibly reduced) sample range, otherwise it is considered an error if there are any such missing values.

Parameters

list

list of variables to be tested for missing values, or NULL to test all series.

 

t1

on entry, initial start of sample range; on exit, start of sample range adjusted for missing values.

 

t2

on entry, initial end of sample range; on exit, end of sample range adjusted for missing values.

 

dset

dataset struct.

 

nmiss

location to receive number of missing values within (possibly adjusted) sample range.

 

Returns

0 on success or E_MISSDATA or error.


set_miss ()

int
set_miss (const int *list,
          const char *param,
          DATASET *dset,
          PRN *prn);

Set to "missing" each observation of each series in list that has the value represented by param .

Parameters

list

list of variables to process, or an empty list or NULL to process all variables.

 

param

string representation of the numerical value to treat as missing.

 

dset

dataset struct.

 

prn

pointer to printing struct.

 

Returns

0 on success, non-zero code on failure.


missing_obs_fraction ()

double
missing_obs_fraction (const DATASET *dset);

Parameters

dset

dataset struct.

 

Returns

the fraction of the observations in Z for which all variables have missing values (empty rows).


any_missing_user_values ()

int
any_missing_user_values (const DATASET *dset);

Parameters

dset

dataset struct.

 

Returns

1 if there are missing values for any non-hidden variables within the current sample range, otherwise 0.


model_add_missmask ()

int
model_add_missmask (MODEL *pmod,
                    int n);

Allocates a missing obs mask of length n and attaches it to pmod . All elements are initialized to '0' (non-missing).

Parameters

pmod

pointer to gretl MODEL.

 

n

length of mask.

 

Returns

0 on success, non-zero if allocation fails.

Types and Values

NADBL

# define NADBL NAN