chkinputR

chkinputR makes some input parameters and user options checking in regression

Syntax

Description

example

y =chkinputR(y, X, nnargin, vvarargin)

example

[y, X] =chkinputR(___)

example

[y, X, n] =chkinputR(___)

example

[y, X, n, p] =chkinputR(___)

Input Arguments

expand all

y — Response variable Vector

A vector with n elements that contains the response variables, possibly with missing values (NaN's) and infinite values (Inf's).

Data Types: single| double

X — Predictor variables Matrix

Data matrix of explanatory variables (also called 'regressors') of dimension (n x p-1), possibly with missing values (NaN's) and infinite values (Inf's). Rows of X represent observations, and columns represent variables.

Data Types: single| double

nnargin — nargin Scalar

The number of input arguments specified for the caller function.

Data Types: single| double

vvarargin — nvarargin Scalar

The variable length input argument list specified for the caller function.

Data Types: single| double

Output Arguments

expand all

y —response without missing and infs. Vector

The new response variable, with observations (rows) with missing or infinite values excluded.

X —Predictor variables without infs and missings. Matrix

The new matrix of explanatory variables, with missing or infinite values excluded.

n —Number of rows of X (observations). Scalar

Number of rows after listwise exclusion.

p —Number of columns of X (variables). Scalar

Number of parameters to be estimated.

More About

expand all

Additional Details

This routines preforms the following operations:

1) If y is a row vector it is transformed in a column vector;

2) Checks that X is a 2-dimensional array;

3) Checks dimension consistency of X and y;

4) Removes observations with missing or infinite values from X or y (listwise exclusion);

5) Adds to matrix X a column of ones if option intercept is 1;

6) Checks if there are constant columns in matrix X. In other words, if Xj is a generic column of X (excluding the column which contains the intercept) it removes it if max(Xj)=min(Xj) and produces a warning.

7) Computes final values of n and p after previous operations;

8) Makes sure than n>=p;

9) Makes sure that new X is full rank

See Also

This page has been automatically generated by our routine publishFS