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 DATASET *dset,
                                                         int *nmiss);
int                 set_miss                            (const int *list,
                                                         const char *param,
                                                         DATASET *dset,
                                                         PRN *prn);
double              missing_obs_fraction                (const DATASET *dset);
int                 any_missing_user_values             (const DATASET *dset);

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 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.

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.

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.

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 :

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

missing_obs_fraction ()

double              missing_obs_fraction                (const DATASET *dset);

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

dset :

dataset struct.

Returns :

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