missing

missing

Synopsis

#define             NEW_NA
#define             NADBL
#define             na                                  (x)
#define             isfinite                            (x)
#define             xna                                 (x)
#define             model_missing                       (m,
                                                         t)
int                 model_has_missing_obs               (const MODEL *pmod);
int                 first_missing_index                 (const double *x,
                                                         int t1,
                                                         int t2);
int                 series_adjust_sample                (const double *x,
                                                         int *t1,
                                                         int *t2);
int                 list_adjust_sample                  (const int *list,
                                                         int *t1,
                                                         int *t2,
                                                         const double **Z);
int                 set_miss                            (const int *list,
                                                         const char *param,
                                                         double **Z,
                                                         DATAINFO *pdinfo,
                                                         PRN *prn);
double              missing_obs_fraction                (const double **Z,
                                                         const DATAINFO *pdinfo);
int                 any_missing_user_values             (const double **Z,
                                                         const DATAINFO *pdinfo);

Description

Details

NEW_NA

#define NEW_NA 0


NADBL

#define NADBL DBL_MAX


na()

#define na(x) ((x) == NADBL)


isfinite()

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


xna()

# define xna(x) ((x) == NADBL || isnan(x) || isinf(x))


model_missing()

#define model_missing(m,t) ((m)->missmask != NULL && (m)->missmask[t] == '1')


model_has_missing_obs ()

int                 model_has_missing_obs               (const MODEL *pmod);

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);

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.

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 double **Z);

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.

list :

list of variables to be tested 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.

Z :

data array.

Returns :

E_MISSDATA if missing values are found within the (possibly adjusted) sample range, else 0.

set_miss ()

int                 set_miss                            (const int *list,
                                                         const char *param,
                                                         double **Z,
                                                         DATAINFO *pdinfo,
                                                         PRN *prn);

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

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.

Z :

data matrix.

pdinfo :

pointer to data information struct.

prn :

pointer to printing struct.

Returns :

1 if at least one observation was set as missing, otherwise 0.

missing_obs_fraction ()

double              missing_obs_fraction                (const double **Z,
                                                         const DATAINFO *pdinfo);

Z :

data array.

pdinfo :

pointer to data information 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 double **Z,
                                                         const DATAINFO *pdinfo);

Z :

data array.

pdinfo :

pointer to data information struct.

Returns :

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