\magnification=\magstep1
\nopagenumbers
\def\volgende{\par\noindent}
\def\titel#1{{\bigskip\volgende{\titelfont #1}\bigskip\volgende}}
\def\subtitel#1{{\volgende{\subtitelfont #1}\bigskip\volgende}}
\font\titelfont=cmbx10 scaled\magstep1
\font\titelfontje=cmbx10 scaled\magstephalf
\font\subtitelfont=cmti10 scaled\magstephalf
\def\puntje{\bigskip\item{$*$}}
\def\leegpuntje{\bigskip\item{}}
\def\subpuntje{\medskip\itemitem{$*$}}
\def\leegsubpuntje{\medskip\itemitem{}}
\parindent=36pt
\def\put#1#2{\item{\hbox to 55 pt{{\phantom{inn}}\quad {\it#1}\hfill}} #2}
\def\proc#1#2#3#4#5#6#7#8{
\noindent\titelfont #1
\vskip1truecm \titelfontje\noindent Purpose\bigskip\rm\noindent #2
\bigskip\bigskip\titelfontje\noindent Format\bigskip\bf\noindent #3
\bigskip\bigskip\titelfontje\noindent Inputs\bigskip\rm #4
\bigskip\bigskip\titelfontje\noindent Outputs\bigskip\rm #5
\bigskip\bigskip\titelfontje\noindent Remarks\bigskip\rm\noindent #6
\bigskip\bigskip\titelfontje\noindent Globals\bigskip\it\noindent #7
\bigskip\bigskip\titelfontje\noindent Source\bigskip\rm\noindent #8
\vfill\eject}
\def\prockort#1#2#3#4#5#6#7#8#9{
\noindent\titelfont #1
\vskip1truecm \titelfontje\noindent Purpose\bigskip\rm\noindent #2
\bigskip\bigskip\titelfontje\noindent Format\bigskip\bf\noindent 
\it #3\rm=\bf #1(\it#4\bf)
\bigskip\bigskip\titelfontje\noindent Inputs\bigskip\rm #5
\bigskip\bigskip\titelfontje\noindent Outputs\bigskip\rm #6
\bigskip\bigskip\titelfontje\noindent Remarks\bigskip\rm\noindent #7
\bigskip\bigskip\titelfontje\noindent Globals\bigskip\it\noindent #8
\bigskip\bigskip\titelfontje\noindent Source\bigskip\rm\noindent #9
\vfill\eject}
\def\proclang#1#2#3#4#5#6#7#8#9{
\noindent\titelfont #1
\vskip1truecm \titelfontje\noindent Purpose\bigskip\rm\noindent #2
\bigskip\bigskip\titelfontje\noindent Format\bigskip\bf\noindent 
$\{$\it #3$\}=$\bf #1(\it#4\bf)
\bigskip\bigskip\titelfontje\noindent Inputs\bigskip\rm #5
\bigskip\bigskip\titelfontje\noindent Outputs\bigskip\rm #6
\bigskip\bigskip\titelfontje\noindent Remarks\bigskip\rm\noindent #7
\bigskip\bigskip\titelfontje\noindent Globals\bigskip\it\noindent #8
\bigskip\bigskip\titelfontje\noindent Source\bigskip\rm\noindent #9
\vfill\eject}

\proc
{EERSTEX, EERSTEY, EERSTER}
{Compute the first order derivatives of the bivariate standard normal
distribution.}
{\it v\rm =\bf EERSTE.(\it x,y,rho\bf )}
{
\put{x}{$N\times 1$ vector of values for first variable.}
\put{y}{$N\times 1$ vector of values for second variable.}
\put{rho}{Scalar or $N\times 1$ vector of correlation(s).}
}
{
\put{v}{$N\times 1$ vector, containing computed derivatives.}
}
{For internal use only.}
{\rm None.}
{BPM1.ARC}

\proc
{\hbox{TWEEDEXX, TWEEDEXY, TWEEDEYY,\hfill}\break
\vskip.2truemm\noindent
TWEEDEXR, TWEEDEYR, TWEEDERR}
{Compute the second order derivatives of the bivariate standard normal
distribution.}
{\it v\rm =\bf TWEEDE..(\it x,y,rho\bf )}
{
\put{x}{$N\times 1$ vector of values for first variable.}
\put{y}{$N\times 1$ vector of values for second variable.}
\put{rho}{Scalar or $N\times 1$ vector of correlation(s).}
}
{
\put{v}{$N\times 1$ vector, containing computed derivatives.}
}
{For internal use only.}
{\rm None.}
{BPM1.ARC}

\prockort
{PHI1}
{Computes the univariate standard normal density function.}
%{$t=$PHI1($x$)}
{t}{x}
{
\put{x}{$N\times 1$ vector of real numbers.}
}
{
\put{t}{$N\times 1$ vector of densities.}
}
{Auxiliary procedure.}
{\rm None.}
{BPM1.ARC}

\prockort
{PHI2}
{Computes the bivariate standard normal density function.}
{t}{x,y,rho}
{
\put{x}{$N\times 1$ vector of real numbers, first variable.}
\put{y}{$N\times 1$ vector of real numbers, second variable.}
\put{rho}{Scalar or $N\times 1$ vector of correlation(s).}
}
{
\put{t}{$N\times 1$ vector of densities.}
}
{Auxiliary procedure.}
{\rm None.}
{BPM1.ARC}

\prockort
{TRANSRM}
{Transforms correlation $\rho\in[-1,1]$ into a real variable $\mu$.}
{mu}{rho}
{
\put{rho}{Scalar or $N\times 1$ vector of correlations.}
}
{
\put{mu}{Scalar or $N\times 1$ vector of transformed correlations.}
}
{The transformation used is
$\mu=-{{\ln(1-\rho)}\over{\ln(1+\rho)}}.$
 Auxiliary procedure.}
{\rm None.}
{BPM1.ARC}

\prockort
{TRANSMR}
{Transforms the real
variable $\mu$ into a correlation $\rho\in[-1,1]$.}
{rho}{mu}
{
\put{mu}{Scalar or $N\times 1$ vector of transformed correlations.}
}
{
\put{rho}{Scalar or $N\times 1$ vector of correlations.}
}
{The transformation used is
$\rho={{1-\exp(-\mu)}\over {1+\exp(-\mu)}}.$
Auxiliary procedure.}
{\rm None.}
{BPM1.ARC}

\prockort
{TRANSLS}
{Shrinks a parameter or covariate matrix, according to a specified matrix of
restrictions.}
{teta0}{teta1,restric}
{
\put{teta1}{$N\times MK$ parameter matrix.}
\put{restric}{$M\times K$ restriction matrix.}
}
{
\put{teta0}{$N\times K'$ parameter matrix, with $K'$ the number of ones
in the restriction matrix.}
}
{For internal use only.}
{\rm None.}
{BPM1.ARC}

\prockort
{TRANSSL}
{Expands a parameter or covariate matrix, according to a specified matrix of
restrictions.}
{teta1}{teta0,restric}
{
\put{teta0}{$N\times K'$ parameter matrix, with $K'$ the number of ones
in the restriction matrix.}
\put{restric}{$M\times K$ restriction matrix.}
}
{
\put{teta1}{$N\times MK$ parameter matrix.}
}
{For internal use only.}
{\rm None.}
{BPM1.ARC}

\prockort
{TRANSEO}
{Shrinks a bivariate
parameter matrix from an auxiliary shape into standard form.}
{teta0}{teta1,r,s,trans}
{
\put{teta1}{$M\times (L(r+s-2)+1)$ parameter matrix.}
\put{r}{Number of rows in contingency tables.}
\put{s}{Number of columns in contingency tables.}
\put{trans}{Indicates whether shrinking has to be done by deleting (0) or
summing (1).}
}
{
\put{teta0}{$M\times (r+s+2L-3)$ parameter matrix.}
}
{For internal use only.}
{\rm None.}
{BPM1.ARC}

\prockort
{TRANSOE}
{Expands a bivariate
parameter matrix from standard shape into an auxiliary shape.}
{teta1}{teta0,r,s}
{
\put{teta0}{$M\times (r+s+2L-3)$ parameter matrix.}
\put{r}{Number of rows in contingency tables.}
\put{s}{Number of columns in contingency tables.}
}
{
\put{teta1}{$M\times (L(r+s-2)+1)$ parameter matrix.}
}
{For internal use only.}
{\rm None.}
{BPM1.ARC}

\prockort
{TRANSEO1}
{Shrinks a univariate
parameter matrix from an auxiliary shape into standard shape.}
{teta0}{teta1,r,trans}
{
\put{teta1}{$M\times L(r-1)$ parameter matrix.}
\put{r}{Number of rows in contingency tables.}
\put{trans}{Indicates whether shrinking has to be done by deleting (0) or
summing (1).}
}
{
\put{teta0}{$M\times (r+L-2)$ parameter matrix.}
}
{For internal use only.}
{\rm None.}
{BPM1.ARC}

\prockort
{TRANSOE1}
{Expands a univariate
parameter matrix from standard shape into an auxiliary shape.}
{teta1}{teta0,r}
{
\put{teta0}{$M\times (r+L-2)$ parameter matrix.}
\put{r}{Number of rows in contingency tables.}
}
{
\put{teta1}{$M\times L(r-1)$ parameter matrix.}
}
{For internal use only.}
{\rm None.}
{BPM1.ARC}

\prockort
{CDFNINV}
{Computes the inverse  standard normal cumulative distribution function.}
{y}{x}
{
\put{x}{$N\times 1$ vector of probabilities.}
}
{
\put{y}{$N\times 1$ vector of probits.}
}
{Mainly for internal use; to be called by initial value procedures.}
{\rm None.}
{BPM1.ARC}

\prockort
{LOGLIKUP}
{Computes univariate log-likelihood.}
{ll}{teta,x,y}
{
\put{teta}{$L\times 1$ parameter vector.}
\put{x}{$N\times L$ matrix of which columns are independent variables.}
\put{y}{$N\times 2$ matrix of which every row is a contingency table.}
}
{
\put{ll}{Computed log-likelihood.}
}
{The first column of $x$ should consist completely out of ones.
This procedure is called by UNIPROB.}
{\rm None.}
{BPM2.ARC}

\prockort
{GRADUP}
{Computes univariate gradient.}
{grad}{teta,x,y}
{
\put{teta}{$L\times 1$ parameter vector.}
\put{x}{$N\times L$ matrix of which columns are independent variables.}
\put{y}{$N\times 2$ matrix of which every row is a contingency table.}
}
{
\put{grad}{$L\times 1$ gradient vector.}
}
{The first column of $x$ should consist completely out of ones. This
procedure is called by UNIPROB.}
{\rm None.}
{BPM2.ARC}

\prockort
{HESSUP}
{Computes univariate Hessian matrix.}
{hess}{teta,x,y}
{
\put{teta}{$L\times 1$ parameter vector.}
\put{x}{$N\times L$ matrix of which columns are independent variables.}
\put{y}{$N\times 2$ matrix of which every row is a contingency table.}
}
{
\put{hess}{$L\times L$ Hessian matrix.}
}
{The first column of $x$ should consist completely out of ones. This procedure
is called by UNIPROB.}
{\rm None.}
{BPM2.ARC}

\proclang
{UNIPROB}
{Fits univariate probit model.}
{teta,ll,grad,hess}{teta0,x,y}
{
\put{teta0}{$L\times 1$ parameter vector (initial estimates).}
\put{x}{$N\times L$ matrix of which columns are independent variables.}
\put{y}{$N\times 2$ matrix of which every row is a contingency table.}
}
{
\put{teta}{$L\times 1$ vector of parameter estimates.}
\put{ll}{Log-likelihood at estimates.}
\put{grad}{$L\times 1$ gradient vector.}
\put{hess}{$L\times L$ Hessian matrix.}
}
{The first column of $x$ should consist completely out of ones. This
procedure can be called separately. It is  called by the bivariate
probit procedures BIVPROB and BPROBIT and the multivariate probit procedure
MPROBIT.}
{{\it \_eps, \_maxit, \_itscrn}}
{BPM2.ARC}

\proclang
{INITVAL}
{Computes two sets of initial estimates for bivariate probit parameters.}
{teta1,ll1,teta2,ll2}{x,y}
{
\put{x}{$N\times L$ matrix of which columns are independent variables.}
\put{y}{$N\times 4$ matrix of which every row is a contingency table.}
}
{
\put{teta1}{$2L+1\times 1$ vector of initial estimates to start bivariate
probit estimation.}
\put{ll1}{Log-likelihood, corresponding to \it teta1\rm.}
\put{teta2}{Alternative vector of initial estimates.}
\put{ll2}{Log-likelihood, corresponding to \it teta2\rm.}
}
{The first column of $x$ should consist completely of ones. This procedure
is called by the bivariate probit procedure BIVPROB.}
{\rm None.}
{BPM3.ARC}

\prockort
{LOGLIK}
{Computes log-likelihood for bivariate probit model, for two dichotomous
outcome variables ($2\times 2$ tables), where the correlation is constant.}
{ll}{teta,x,y}
{
\put{teta}{$(2L+1)\times 1$ parameter vector.}
\put{x}{$N\times L$ matrix of which columns are independent variables.}
\put{y}{$N\times 4$ matrix of which every row is a contingency table.}
}
{
\put{ll}{Computed log-likelihood.}
}
{The first column of $x$ should consist completely of ones. Every row
of $y$ represents a contingency table, corresponding to the four possible
outcomes of two dichotomous variables.}
{\it\_rhonorm}
{BPM4.ARC}




\prockort
{GRADBP}
{Computes gradient of log-likelihood
 for bivariate probit model, for two dichotomous
outcome variables ($2\times 2$ tables), where the correlation is constant.}
{grad}{teta,x,y}
{
\put{teta}{$(2L+1)\times 1$ parameter vector.}
\put{x}{$N\times L$ matrix of which columns are independent variables.}
\put{y}{$N\times 4$ matrix of which every row is a contingency table.}
}
{
\put{grad}{$(2L+1)\times 1$ gradient vector.}
}
{The first column of $x$ should consist completely of ones. Every row
of $y$ represents a contingency table, corresponding to the four possible
outcomes of two dichotomous variables.}
{\_rhonorm}
{BPM4.ARC}



\prockort
{HESSBP}
{Computes Hessian of
log-likelihood for bivariate probit model, for two dichotomous
outcome variables ($2\times 2$ tables), where the correlation is constant.}
{hess}{teta,x,y}
{
\put{teta}{$(2L+1)\times 1$ parameter vector.}
\put{x}{$N\times L$ matrix of which columns are independent variables.}
\put{y}{$N\times 4$ matrix of which every row is a contingency table.}
}
{
\put{hess}{$(2L+1)\times (2L+1)$ Hessian matrix.}
}
{The first column of $x$ should consist completely of ones. Every row
of $y$ represents a contingency table, corresponding to the four possible
outcomes of two dichotomous variables.}
{\_rhonorm}
{BPM4.ARC}


\prockort
{LOGLIKR}
{Computes log-likelihood for bivariate probit model, for two dichotomous
outcome variables ($2\times 2$ tables), where the correlation depends on the
covariates.}
{ll}{teta,x,y}
{
\put{teta}{$3L\times 1$ parameter vector.}
\put{x}{$N\times L$ matrix of which columns are independent variables.}
\put{y}{$N\times 4$ matrix of which every row is a contingency table.}
}
{
\put{ll}{Computed log-likelihood.}
}
{The first column of $x$ should consist completely of ones. Every row
of $y$ represents a contingency table, corresponding to the four possible
outcomes of two dichotomous variables.}
{\_rhonorm}
{BPM4.ARC}




\prockort
{GRADBPR}
{Computes gradient of log-likelihood
 for bivariate probit model, for two dichotomous
outcome variables ($2\times 2$ tables), where the correlation depends on the
covariates.}
{grad}{teta,x,y}
{
\put{teta}{$3L\times 1$ parameter vector.}
\put{x}{$N\times L$ matrix of which columns are independent variables.}
\put{y}{$N\times 4$ matrix of which every row is a contingency table.}
}
{
\put{grad}{$3L\times 1$ gradient vector.}
}
{The first column of $x$ should consist completely of ones. Every row
of $y$ represents a contingency table, corresponding to the four possible
outcomes of two dichotomous variables.}
{\_rhonorm}
{BPM4.ARC}



\prockort
{HESSBPR}
{Computes Hessian of
log-likelihood for bivariate probit model, for two dichotomous
outcome variables ($2\times 2$ tables), where the correlation depends on
the covariates.}
{hess}{teta,x,y}
{
\put{teta}{$3L\times 1$ parameter vector.}
\put{x}{$N\times L$ matrix of which columns are independent variables.}
\put{y}{$N\times 4$ matrix of which every row is a contingency table.}
}
{
\put{hess}{$3L\times 3L$ Hessian matrix.}
}
{The first column of $x$ should consist completely of ones. Every row
of $y$ represents a contingency table, corresponding to the four possible
outcomes of two dichotomous variables.}
{\_rhonorm}
{BPM4.ARC}

\proclang
{BIVPROB}
{Performs estimation of parameters for bivariate probit model, given the
data as $2\times 2$ contingency tables.}
{teta,ll,tetra,llt,teta1,ll1,teta2,ll2}{x,y,indvar,depvar}
{
\put{x}{$N\times L$ or $N\times (L-1)$
matrix of which columns are independent variables.}
\put{y}{$N\times 4$ matrix of which every row is a contingency table.}
\put{indvar}{$L\times 1$ or $(L-1)\times 1$ character vector, containing
names of the independent variables.}
\put{depvar}{$2\times 1$ character vector, containing
names of the dependent variables.}
}
{
\put{teta}{$(2L+1)\times 4$ or $3L\times 4$ matrix. The columns contain
estimates for the parameters of the bivariate probit model,
their standard errors, and the corresponding
$t$-values and $P$-values.}
\put{ll}{Corresponding log-likelihood}
\put{tetra}{$3\times 4$ matrix, meaning of the columns the same as for
\it teta\rm,
 but \it tetra \rm gives the parameters of the bivariate probit model, where
the effect of the covariates is not taken into account.}
\put{llt}{Corresponding log-likelihood.}
\put{teta1}{$L\times 4$ matrix of parameters, standard errors, $t$-values and
$P$-values for the univariate probit model for the first dependent variable.}
\put{ll1}{Corresponding log-likelihood.}
\put{teta2}{Analogous for second dependent variable.}
\put{ll2}{Corresponding log-likelihood.}
}
{One can fit a model with the correlation coefficient constant or depending
on the covariates. In the first case there are $2L+1$ parameters, in the
second case, there are $3L$ parameters. See the description of the
globals \it \_rpar  \rm and
\it \_rhonorm  \rm for further details. There are also globals controlling
the output routines, the convergence of the Newton-Raphson iterations,
restrictions (to deal with different sets of covariates for first, second
variable and correlation), significance tests and Tsiatis' goodness-of-fit
tests. The dependent variable should be a contingency table, corresponding
to a specific set of covariates. It is possible to call the procedure
directly or indirectly via BPROBIT, which allows dataset to be inputted.
The output file, corresponding
 to this procedure is BPROBIT.OUT.
The difference in input format for $x$ and \it indvar \rm depends on 
whether a column of ones is added by the user or not. }
{\_initval, \_itscrn, \_itfile, \_rhonorm, \_file, \_eps,
\_maxit,
\_rpar, \_restric, \_tsiatis, \_signif, \_imat}
{BPM5.ARC}

\proc
{BPROBIT}
{Performs estimation of parameters for bivariate probit model, given the
data as 2 vectors of dichotomous variables, directly or on a dataset.}
{\noindent\hbox{
$\{\hbox{\it teta,ll,tetra,llt,teta1,ll1,teta2,ll2}\}
=$BPROBIT(\it dset,indvar,depvar\bf)}\break
\medskip
\noindent\hbox{
$\{\hbox{\it rho,par,pl,tvec,pvec,step,min,max}\}
=$BPROBIT(\it dset,indvar,depvar\bf)}
}
{
\put{dset}{Either a string, containing the name of a GAUSS data set or the
null string.}
\put{indvar}{Either an $L\times 1$ or $(L-1)\times 1$ character vector,
containing the names of the independent variables, or an $N\times L$ or
$N\times (L-1)$ matrix of independent variables.}
\put{depvar}{Either a $2\times 1$  character vector,
containing the names of the dependent variables, or an $N\times 2$
matrix of dependent variables.}
}
{
\noindent \rm If $\_rpar=0,1$~(parameter estimation)~:\medskip
\put{teta}{$(2L+1)\times 4$ or $3L\times 4$ matrix. The columns contain
estimates for the parameters of the bivariate probit model,
their standard errors, and the corresponding
$t$-values and $P$-values.}
\put{ll}{Corresponding log-likelihood.}
\put{tetra}{$3\times 4$ matrix. The meaning of the columns is the same as for
\it teta\rm, but \it tetra \rm
gives the parameters of the bivariate probit model, where
the effect of the covariates is not taken into account.}
\put{llt}{Corresponding log-likelihood.}
\put{teta1}{$L\times 4$ matrix of parameters, standard errors, $t$-values and
$P$-values for the univariate probit model for the first dependent variable.}
\put{ll1}{Corresponding log-likelihood.}
\put{teta2}{Analogous for second dependent variable.}
\put{ll2}{Corresponding log-likelihood.}
\vfill\eject 
\rm If $\_rpar=2$~(profile likelihood)~:\medskip
\put{rho}{$K\times 1$ vector of correlation values used.}
\put{par}{$4L\times K$ vector of parameters and standard errors.}
\put{pl}{$K\times 1$ vector of log-likelihoods.}
\put{tvec}{$K\times 1$ vector of $t$-values.}
\put{pvec}{$K\times 1$ vector of $P$-values.}
\put{step}{Interval between rho values.}
\put{min}{Minimum rho value.}
\put{max}{Maximum rho value.}
}
{In case of parameter estimation,
one can fit a model with the correlation coefficient constant or depending
on the covariates. In the first case there are $2L+1$ parameters, in the
second case, there are $3L$ parameters. See the description of the
globals \it \_rpar  \rm and
\it \_rhonorm  \rm for further details. There are also globals controlling
the output routines, the convergence of the Newton-Raphson iterations,
restrictions (to deal with different sets of covariates for first, second
variable and correlation), significance tests and Tsiatis' goodness-of-fit
tests. The dependent variables should be in the form of two columns
of zeros and ones, the independent variables may be either continuous
or discrete.
If the input is to be given by means of contingency tables, use
BIVPROB. If profile likelihood is to be performed starting from contingency
tables, use PROFLIK or PRBLIK.
The output file, corresponding to this procedure is BPROBIT.OUT}
{\_initval, \_itscrn, \_itfile, \_rhonorm, \_file, \_eps, \_maxit,
\_rpar, \_restric, \_tsiatis, \_signif, \_imat}
{BPM6.ARC}

\prockort
{GRADPL}
{Computes gradient of log-likelihood
for bivariate probit model, for two dichotomous
outcome variables ($2\times 2$ tables), where the correlation is fixed a priori.}
{grad}{teta,rho,x,y}
{
\put{teta}{$(2L+1)\times 1$ parameter vector.}
\put{rho}{Correlation coefficient.}
\put{x}{$N\times L$ matrix of which columns are independent variables.}
\put{y}{$N\times 4$ matrix of which every row is a contingency table.}
}
{
\put{grad}{$(2L+1)\times 1$ gradient vector.}
}
{The first column of $x$ should consist completely of ones. Every row
of $y$ represents a contingency table, corresponding to the four possible
outcomes of two dichotomous variables. The procedure is called by the
profile likelihood procedures.}
{\rm None.}
{BPM7.ARC}

\prockort
{HESSPL}
{Computes Hessian of
log-likelihood for bivariate probit model, for two dichotomous
outcome variables ($2\times 2$ tables), where the correlation is fixed a priori.}
{hess}{teta,rho,x,y}
{
\put{teta}{$(2L+1)\times 1$ parameter vector.}
\put{rho}{Correlation coefficient.}
\put{x}{$N\times L$ matrix of which columns are independent variables.}
\put{y}{$N\times 4$ matrix of which every row is a contingency table.}
}
{
\put{hess}{$(2L+1)\times (2L+1)$ Hessian matrix.}
}
{The first column of $x$ should consist completely of ones. Every row
of $y$ represents a contingency table, corresponding to the four possible
outcomes of two dichotomous variables. The procedure is called by the
profile likelihood procedures.}
{\rm None.}
{BPM7.ARC}

\proclang 
{PROFLIK}
{Procedure to perform profile likelihood.}
{rho,par,pl,tvec,pvec}{x,y,indvar,depvar,step,min,max}
{
\put{x}{$N\times L$ or $N\times (L-1)$
matrix of which columns are independent variables.}
\put{y}{$N\times 4$ matrix of which every row is a contingency table.}
\put{indvar}{$L\times 1$ or $(L-1)\times 1$ character vector, containing
names of the independent variables.}
\put{depvar}{$2\times 1$ character vector, containing
names of the dependent variables.}
\put{step}{Stepsize for rho.}
\put{min}{Minimum value for rho.}
\put{max}{Maximum value for rho.}
}
{
\put{rho}{$K\times 1$ vector of rho values.}
\put{par}{$K\times 4L$ matrix of parameters and standard errors.}
\put{pl}{$K\times 1$ vector of log-likelihoods.}
\put{tvec}{$K\times 2L$ matrix of $t$-values.}
\put{pvec}{$K\times 2L$ matrix of $P$-values.}
}
{The first column of $x$ should consist completely of ones. Every row
of $y$ represents a contingency table, corresponding to the four possible
outcomes of two dichotomous variables. \it indvar \rm has $L$ elements
if a column  of ones is already added to $x$.}
{\_draw, \_eps, \_maxit}
{BPM7.ARC}

\proclang
{BPROBSEL}
{Performs selection of covariates for the bivariate probit model, based
on the likelihood ratio test.}
{indv,teta,ll,tetra,llt,teta1,ll1,teta2,ll2}{dset,indvar,depvar,sig}
{
\put{dset}{String, containing the name of a Gauss dataset.}
\put{indvar}{$L\times 1$ character vector of candidate independent
variables}
\put{depvar}{$2\times 1$ character vector, names of dependent variables.}
\put{sig}{Significance level for $\chi^2$ test.}
}
{
\put{indv}{Vector of names of selected independent variables.}
\put{teta}{$(2L+1)\times 4$ or $3L\times 4$ matrix. The columns contain
estimates for the parameters of the bivariate probit model,
their standard errors, and the corresponding
$t$-values and $P$-values.}
\put{ll}{Corresponding log-likelihood.}
\put{tetra}{$3\times 4$ matrix, meaning of the columns the same as for
\it teta\rm, but \it tetra \rm
 gives the parameters of the bivariate probit model, where
the effect of the covariates is not taken into account.}
\put{llt}{Corresponding log-likelihood.}
\put{teta1}{$L\times 4$ matrix of parameters, standard errors, $t$-values and
$P$-values for the univariate probit model for the first dependent variable.}
\put{ll1}{Corresponding log-likelihood.}
\put{teta2}{Analogous for second dependent variable.}
\put{ll2}{Corresponding log-likelihood.}
}
{It is possible to perform parameter estimation, in addition to selection, by
setting the global \it\_final \rm equal to 1.
 One can also control the output of
the selection procedures by the global \it\_sfile\rm,
 see the description of these
globals.
The output of the selection procedures is written to BPROBSEL.OUT,
that of the estimation procedures to BPROBIT.OUT.
}
{\_sfile, \_final, \_eps, \_maxit}
{BPM8.ARC}


\proclang
{PRBLIK}
{Procedure to perform profile likelihood, in an interval around the
maximum likelihood estimates.}
{t,rho,par,pl,tvec,pvec}{dset,indvar,depvar,sig}
{
\put{dset}{Either a string, containing the name of a GAUSS data set or the
null string}
\put{indvar}{Either a $L\times 1$ or $(L-1)\times 1$ character vector,
containing the names of the independent variables, or an $N\times L$ or
$N\times (L-1)$ matrix of independent variables.}
\put{depvar}{Either a $2\times 1$  character vector,
containing the names of the dependent variables, or an $N\times 2$
matrix of dependent variables.}
\put{sig}{Significance level for the likelihood ratio, to construct a
confidence interval around the maximum likelihood estimate.}
}
{
\put{t}{$3\times 3$ vector of rho values at level \it sig \rm around the
maximum, together with likelihood bounds.}
\put{rho}{$K\times 1$ vector of rho values.}
\put{par}{$K\times 4L$ matrix of parameters and standard errors.}
\put{pl}{$K\times 1$ vector of log-likelihoods.}
\put{tvec}{$K\times 2L$ matrix of $t$-values.}
\put{pvec}{$K\times 2L$ matrix of $P$-values.}
}
{\it indvar \rm is an 
$L\times 1$ vector if a column of ones is added already and an
 $(L-1)\times 1$
vector if a column of ones is to be added by the program.}
{\_draw}
{BPM9.ARC}

\proclang
{BPMONCAR}
{Performs maximum likelihood estimation for the bivariate probit model,
with random searches in the parameter space, as an alternative for
the Newton-Raphson iterations method.}
{teta,ll,grad,hess}{x,y}
{
\put{x}{$N\times L$ matrix of which columns represent covariates.}
\put{y}{$N\times 4$ matrix of which every row represents a contingency
table.}
}
{
\put{teta}{$(2L+1)\times 1$ vector of parameter estimates.}
\put{ll}{Log-likelihood at parameter estimates.}
\put{grad}{$(2L+1)\times 1$ gradient vector.}
\put{hess}{$(2L+1)\times (2L+1)$ Hessian matrix.}
}
{BPMONCAR is intended to be used when Newton-Raphson fails. It is
automatically called by BIVPROB when every set of initial values, used
by the program, leads
to divergence. It can be used separately also, but note that it is
considerably slower than Newton-Raphson.}
{\rm None.}
{BPM10.ARC}


\prockort
{RT}
{To determine tetrachoric correlation.}
{rho}{tetra,y}
{
\put{tetra}{$3\times 1$ vector, containing 2 cutpoins (assumed to be correct)
and a
correlation coefficient (to be optimised).}
\put{y}{$4\times 1$ vector, representing a contingency table.}
}
{
\put{rho}{Scalair, optimisation for correlation.}
}
{For internal use only.}
{\rm None.}
{BPM11.ARC}


\proclang
{UPROBSEL}
{Performs selection of covariates for the univariate probit model, based
on the likelihood ratio test.}
{indv,info}{dset,indvar,depvar,sig)}
{
\put{dset}{String, containing the name of a Gauss dataset.}
\put{indvar}{$L\times 1$ character vector of candidate independent
variables.}
\put{depvar}{$1\times 1$ character vector, name of dependent variables.}
\put{sig}{Significance level for $\chi^2$ test.}
}
{
\put{indv}{Vector of names of selected independent variables.}
\put{info}{\it info$[j,1]$ \rm
 contains the loglikelihood for the model with variables
\it indv$[1:j]$ \rm included. \it info$[j,2\ 3]$ \rm
 contains $\chi^2$ and $P$-value for
comparing \it indv$[1:j-1]$  \rm to \it indv$[1:j]$\rm.}
}
{The dependent variable is assumed to be discrete with $r$ levels, there
is a special version for 2 levels: UPROBS2.
The output of the selection procedures is written to BPROBSEL.OUT,
that of the estimation procedure to BPROBIT.OUT.
}
{\_sfile, \_final, \_eps, \_maxit}
{BPM13.ARC}

\proclang
{UPROBS2}
{Performs selection of covariates for the univariate probit model, based
on the likelihood ratio test.}
{indv,info}{dset,indvar,depvar,sig}
{
\put{dset}{String, containing the name of a Gauss dataset.}
\put{indvar}{$L\times 1$ character vector of candidate independent
variables.}
\put{depvar}{$1\times 1$ character vector, name of dependent variables.}
\put{sig}{Significance level for $\chi^2$ test.}
}
{
\put{indv}{Vector of names of selected independent variables.}
\put{info}{\it info$[j,1]$ \rm
 contains the loglikelihood for the model with variables
\it indv$[1:j]$ \rm included. \it info$[j,2\ 3]$ \rm
 contains $\chi^2$ and $P$-value for
comparing \it indv$[1:j-1]$  \rm to \it indv$[1:j]$\rm.}
}
{The dependent variable is assumed to be discrete with $2$ levels,
the $r$ level case is dealt with by UPROBSEL.
The output of the selection procedures is written to BPROBSEL.OUT,
that of the estimation procedure to BPROBIT.OUT.
}
{\_sfile, \_final, \_eps, \_maxit}
{BPM13.ARC}


\proclang
{BPROBSC}
{Performs selection of covariates for the bivariate probit model, based
on the score test.}
{indv,info}{dset,indvar,depvar,sig}
{
\put{dset}{String, containing the name of a Gauss dataset.}
\put{indvar}{$L\times 1$ character vector of candidate independent
variables.}
\put{depvar}{$2\times 1$ character vector, name of dependent variables.}
\put{sig}{Significance level for $\chi^2$ test.}
}
{
\put{indv}{Vector of names of selected independent variables.}
\put{info}{\it info$[j,1]$ \rm
 contains the loglikelihood for the model with variables
\it indv$[1:j]$ \rm included. \it info$[j,2\ 3]$ \rm
 contains $\chi^2$ and $P$-value for
comparing \it indv$[1:j-1]$  \rm to \it indv$[1:j]$\rm.}}
{The dependent variables are assumed to be discrete with $r$ and $s$
levels, there
is a special version for 2 levels: BPROBSC2.
The output of the selection procedures is written to BPROBSEL.OUT,
that of the estimation procedure to BPROBIT.OUT.
}
{\_sfile, \_final, \_eps, \_maxit}
{BPM14.ARC}

\proclang
{BPROBSC2}
{Performs selection of covariates for the bivariate probit model, based
on the score test.}
{indv,info}{dset,indvar,depvar,sig}
{
\put{dset}{String, containing the name of a Gauss dataset.}
\put{indvar}{$L\times 1$ character vector of candidate independent
variables.}
\put{depvar}{$2\times 1$ character vector, name of dependent variables.}
\put{sig}{Significance level for $\chi^2$ test.}
}
{
\put{indv}{Vector of names of selected independent variables.}
\put{info}{\it info$[j,1]$ \rm
 contains the loglikelihood for the model with variables
\it indv$[1:j]$ \rm included. \it info$[j,2\ 3]$ \rm
 contains $\chi^2$ and $P$-value for
comparing \it indv$[1:j-1]$  \rm to \it indv$[1:j]$\rm.}
}
{The dependent variables are assumed to be discrete with $2$ levels,
the $r$ and $s$ level case is dealt with by BPROBSC.
The output of the selection procedures is written to BPROBSEL.OUT,
that of the estimation procedure to BPROBIT.OUT.
}
{\_sfile, \_final, \_eps, \_maxit}
{BPM14.ARC}

\proclang
{SHRINK}
{Shrinks two matrices of independent and dependent variables into its
shortest  form.}
{xx,yy}{x,y}
{
\put{x}{$N\times L$ matrix of covariates.}
\put{y}{$N\times T$ matrix representing contingency tables.}
}
{
\put{xx}{$N'\times L$ matrix of covariates.}
\put{yy}{$N'\times T$ matrix representing contingency tables.}
}
{For internal use only.}
{\rm None.}
{BPM14.ARC}

\proclang
{UPROBSC}
{Performs selection of covariates for the univariate probit model, based
on the score test.}
{indv,info}{dset,indvar,depvar,sig}
{
\put{dset}{String, containing the name of a Gauss dataset.}
\put{indvar}{$L\times 1$ character vector of candidate independent
variables.}
\put{depvar}{$1\times 1$ character vector, name of dependent variables.}
\put{sig}{Significance level for $\chi^2$ test.}
}
{
\put{indv}{Vector of names of selected independent variables.}
\put{info}{\it info$[j,1]$ \rm
 contains the loglikelihood for the model with variables
\it indv$[1:j]$ \rm included. \it info$[j,2\ 3]$ \rm
 contains $\chi^2$ and $P$-value for
comparing \it indv$[1:j-1]$  \rm to \it indv$[1:j]$\rm.}
}
{The dependent variable is assumed to be discrete with $r$ levels, there
is a special version for 2 levels: UPROBSC2.
The output of the selection procedures is written to BPROBSEL.OUT,
that of the estimation procedure to BPROBIT.OUT.
}
{\_sfile, \_final, \_eps, \_maxit}
{BPM15.ARC}

\proclang
{UPROBSC2}
{Performs selection of covariates for the univariate probit model, based
on the score test.}
{indv,info}{dset,indvar,depvar,sig}
{
\put{dset}{String, containing the name of a Gauss dataset.}
\put{indvar}{$L\times 1$ character vector of candidate independent
variables.}
\put{depvar}{$1\times 1$ character vector, name of dependent variables.}
\put{sig}{Significance level for $\chi^2$ test.}
}
{
\put{indv}{Vector of names of selected independent variables.}
\put{info}{\it info$[j,1]$ \rm
 contains the loglikelihood for the model with variables
\it indv$[1:j]$ \rm included. \it info$[j,2\ 3]$ \rm
 contains $\chi^2$ and $P$-value for
comparing \it indv$[1:j-1]$  \rm to \it indv$[1:j]$\rm.}
}
{The dependent variable is assumed to be discrete with $2$ levels,
the $r$ level case is dealt with by UPROBSC.
The output of the selection procedures is written to BPROBSEL.OUT,
that of the estimation procedure to BPROBIT.OUT.
}
{\_sfile, \_final, \_eps, \_maxit}
{BPM15.ARC}


\proclang
{MCORR}
{Determines correlations for a set of $2$ dichotomous outcomes, given the
values for the marginal parameters.}
{rho,grad,hess}{teta,x,y}
{
\put{teta}{$2L\times 1$ vector of parameters for first and second variables.}
\put{x}{$N\times L$ matrix of covariates.}
\put{y}{$N\times 4$ matrix of contingecies.}
}
{
\put{rho}{Scalar, optimisation for correlation.}
\put{grad}{Corresponding gradient vector.}
\put{hess}{Corresponding Hessian matrix.}
}
{MCORR is designed to be called by MPROBIT.}
{\rm None.}
{BPM16.ARC}


\proclang
{MPROBIT}
{Performs estimation of parameters for the multivariate probit model, by
a suboptimal method.}
{teta0,corr}{dset,indvar,depvar}
{
\put{dset}{Either a string, containing the name of a GAUSS data set or the
null string}
\put{indvar}{Either a $L\times 1$ or $(L-1)\times 1$ character vector,
containing the names of the independent variables, or an $N\times L$ or
$N\times (L-1)$ matrix of independent variables.}
\put{depvar}{Either a $M\times 1$  character vector,
containing the names of the dependent variables, or an $N\times M$
matrix of dependent variables.}
}
{
\put{teta0}{$ML\times 4$ matrix of estimates, standard errors, $t$-values and
$P$-values for the parameters of the $M$ variables.}
\put{corr}{${1\over 2}M(M-1)\times 4$ matrix of estimates, standard errors,
$t$-values and $P$-values for the parameters of the correlations.}
}
{A full maximum likelihood implementation for the multivariate probit
model is not available, as GAUSS386 has only built in procedures for
univariate and bivariate standard normal cumulative distribution
functions. There exist implementations for the multivariate normal
integral, but their speed is to low to justify their use over the
suboptimal approach. The output file, corresponding to MPROBIT is
MPROBIT.OUT.}
{\rm None.}
{BPM16.ARC}

\prockort
{IMATMK}
{To construct a partitioning matrix, needed to perform Tsiatis' test.}
{imat}{x,y,restric}
{
\put{x}{$N\times L$ matrix of covariates.}
\put{y}{$N\times 2$ matrix of contingecies.}
\put{restric}{Matrix of restrictions on the independent variable.}
}
{
\put{imat}{Matrix indicating in which part of the partitioned covariate
space a particular vector of covariates lies.}
}
{For internal use only (called by TSIATIS, TSIATIS2 and TSIATIS3).}
{\rm None.}
{BPM17.ARC}

\prockort
{TSIATIS}
{Performs Tsiatis' Goodness-of-fit test to the univariate probit model.}
{test}{teta,x,y,imat}
{
\put{teta}{$L\times 1$ parameter vector.}
\put{x}{$N\times L$ matrix of covariates.}
\put{y}{$N\times 2$ matrix of contingecies.}
\put{imat}{$N\times K$ partitioning matrix.}
}
{
\put{test}{$1\times 3$ vector of $\chi^2$ value, degrees of freedom and
$P$-value.}
}
{This procedure can be called from the bivariate probit procedures BPROBIT and
BIV\-PROB, according to the global \it\_tsiatis \rm and \it\_imat\rm.
For bivariate
versions see TSIATIS2 and TSIATIS3.}
{\rm None.}
{BPM17.ARC}


\prockort
{TSIATIS2}
{Performs Tsiatis' Goodness-of-fit test to the bivariate probit model.
The test includes both marginal and correlation parameters.}
{test}{teta,x,y,imat}
{
\put{teta}{$L\times 1$ parameter vector.}
\put{x}{$N\times L$ matrix of covariates.}
\put{y}{$N\times 4$ matrix of contingecies.}
\put{imat}{$N\times K$ partitioning matrix.}
}
{
\put{test}{$1\times 3$ vector of $\chi^2$ value, degrees of freedom and
$P$-value.}
}
{This procedure can be called from the bivariate probit procedures BPROBIT and
BIV\-PROB, according to the global \it\_tsiatis \rm and \it\_imat\rm.
For a univariate
version see TSIATIS. TSIATIS3 gives another bivariate version, excluding
the correlation parameters.}
{\rm None.}
{BPM17.ARC}


\prockort
{TSIATIS3}
{Performs Tsiatis' Goodness-of-fit test to the bivariate probit model.
The test includes only marginal parameters.}
{test}{teta,x,y,imat}
{
\put{teta}{$L\times 1$ parameter vector.}
\put{x}{$N\times L$ matrix of covariates.}
\put{y}{$N\times 4$ matrix of contingecies.}
\put{imat}{$N\times K$ partitioning matrix.}
}
{
\put{test}{$1\times 3$ vector of $\chi^2$ value, degrees of freedom and
$P$-value.}
}
{This procedure can be called from the bivariate probit procedures BPROBIT and
BIV\-PROB, according to the global \it\_tsiatis \rm and \it\_imat\rm.
For a univariate
version see TSIATIS. TSIATIS2 gives another bivariate version, also including
the correlation parameters.}
{\rm None.}
{BPM17.ARC}

\proc
{INFL}
{Graphical assessment of case influence.}
{INFL(\it dset,indvar,depvar\bf)}
{
\put{dset}{Either a string, containing the name of a GAUSS data set or the
null string}
\put{indvar}{Either a $L\times 1$ or $(L-1)\times 1$ character vector,
containing the names of the independent variables, or an $N\times L$ or
$N\times (L-1)$ matrix of independent variables.}
\put{depvar}{Either a $2\times 1$  character vector,
containing the names of the dependent variables, or an $N\times 2$
matrix of dependent variables.}
}
{\noindent \rm None.}
{Gives a brief idea about case influence by graphically depiction Cook
distances, for covariates separately and jointly for all covariates
according to one dependent variable. This procedure needs GAUSS
graphical procedures. You can direct the output to the screen or to
an output device by calling HARDCOPY.}
{\rm None.}
{BPM19.ARC}


\proc
{BPMSET}
{Resets global variables to their default values.}
{BPMSET}
{\noindent\rm
None.
}
{\noindent \rm None.}
{This procedure resets all global values to their default values, not only
the ones meant for use by the user, but also the ``internal'' ones. It is
a good idea to call this procedure whenever an abnormal procedure termination
has occurred (error, CTRL-BREAK,$\ldots)$}
{\rm All.}
{BPM20.ARC}



\prockort
{LOGLUPRS}
{Computes log-likelihood for the univariate probit model, where the
dependent variable has $r$ ordered categories.}
{ll}{teta,x,y}
{
\put{teta}{$L(r-1)\times 1$ parameter vector.}
\put{x}{$N\times L$ matrix of which columns are independent variables.}
\put{y}{$N\times r$ matrix of which every row is a contingency table.}
}
{
\put{ll}{Computed log-likelihood.}
}
{The first column of $x$ should consist completely out of ones.
This procedure is called by UPROBRS.}
{\rm None.}
{BPMRS2.ARC}

\prockort
{GRADUPRS}
{Computes gradient of the log-likelihood for the univariate probit
model, where the dependent variable has $r$ ordered categories.}
{grad}{teta,x,y}
{
\put{teta}{$L(r-1)\times 1$ parameter vector.}
\put{x}{$N\times L$ matrix of which columns are independent variables.}
\put{y}{$N\times r$ matrix of which every row is a contingency table.}
}
{
\put{grad}{$L(r-1)\times 1$ gradient vector.}
}
{The first column of $x$ should consist completely out of ones. This
procedure is called by UPROBRS.}
{\rm None.}
{BPMRS2.ARC}

\prockort
{HESSUPRS}
{Computes  Hessian matrix of the log-likelihood for the univariate
probit model, where the dependent variable has $r$ ordered categories.}
{hess}{teta,x,y}
{
\put{teta}{$L(r-1)\times 1$ parameter vector.}
\put{x}{$N\times L$ matrix of which columns are independent variables.}
\put{y}{$N\times r$ matrix of which every row is a contingency table.}
}
{
\put{hess}{$L(r-1)\times L(r-1)$ Hessian matrix.}
}
{The first column of $x$ should consist completely out of ones. This procedure
is called by UPROBRS.}
{\rm None.}
{BPMRS2.ARC}

\proclang
{UPROBRS}
{Fits univariate probit model, where the dependent variable has $r$
ordered categories.}
{teta,ll,grad,hess}{teta0,x,y}
{
\put{teta0}{$L(r-1)\times 1$ parameter vector (initial estimates).}
\put{x}{$N\times L$ matrix of which columns are independent variables.}
\put{y}{$N\times r$ matrix of which every row is a contingency table.}
}
{
\put{teta}{$L(r-1)\times 1$ vector of parameter estimates.}
\put{ll}{Log-likelihood at estimates.}
\put{grad}{$L(r-1)\times 1$ gradient vector.}
\put{hess}{$L(r-1)\times L(r-1)$ Hessian matrix.}
}
{The first column of $x$ should consist completely out of ones. This
procedure can be called separately. It is  called by the bivariate
probit procedures BPROBRS and BPRS. Note that UNIPROB is a special
version for the case the dependent variable is dichotomous.}
{{\it \_eps, \_maxit, \_itscrn}}
{BPMRS2.ARC}


\prockort
{INITRS}
{Computes a sets of initial estimates for bivariate probit parameters,
in case the dependent variables have $r$ and $s$ ordered outcome
categories respectively.}
{teta}{x,y,r,s}
{
\put{x}{$N\times L$ matrix of which columns are independent variables.}
\put{y}{$N\times rs$ matrix of which every row is a contingency table.}
\put{r}{Number of rows in every contingency table.}
\put{s}{Number of columns in every contingency table.}
}
{
\put{teta}{$L\times (r+s-2)$ matrix  of initial estimates to start bivariate
probit estimation.}
}
{The first column of $x$ should consist completely of ones. This procedure
is called by the bivariate probit procedure BPROBRS.}
{\rm None.}
{BPMRS3.ARC}


\prockort
{LOGLIKRS}
{Computes log-likelihood for bivariate probit model, for two ordered discrete
outcome variables ($r\times s$ tables).}
{ll}{teta,x,y,r,s}
{
\put{teta}{$L(r+s-2)+1\times 1$  or $L(r+s-1)\times 1$ parameter vector.}
\put{x}{$N\times L$ matrix of which columns are independent variables.}
\put{y}{$N\times rs$ matrix of which every row is a contingency table.}
\put{r}{Number of rows in every contingency table.}
\put{s}{Number of columns in every contingency table.}
}
{
\put{ll}{Computed log-likelihood.}
}
{The first column of $x$ should consist completely of ones. Every row
of $y$ represents a contingency table, corresponding to the $r\times s$ 
 possible
outcomes of the two outcome variables.}
{\it\_rpar}
{BPMRS4.ARC}




\prockort
{GRADBPRS}
{Computes gradient of
log-likelihood for bivariate probit model, for two ordered discrete
outcome variables ($r\times s$ tables).}
{grad}{teta,x,y,r,s}
{
\put{teta}{$L(r+s-2)+1\times 1$  or $L(r+s-1)\times 1$ parameter vector.}
\put{x}{$N\times L$ matrix of which columns are independent variables.}
\put{y}{$N\times rs$ matrix of which every row is a contingency table.}
\put{r}{Number of rows in every contingency table.}
\put{s}{Number of columns in every contingency table.}
}
{
\put{grad}{$L(r+s-2)+1\times 1$ or $L(r+s-1)\times 1$ gradient vector.}
}
{The first column of $x$ should consist completely of ones. Every row
of $y$ represents a contingency table, corresponding to the $r\times s$ 
 possible
outcomes of the two outcome variables.}
{\_rpar}
{BPMRS4.ARC}



\prockort
{HESSBPRS}
{Computes Hessian matrix of 
log-likelihood for bivariate probit model, for two ordered discrete
outcome variables ($r\times s$ tables).}
{hess}{teta,x,y,r,s}
{
\put{teta}{$L(r+s-2)+1\times 1$  or $L(r+s-1)\times 1$ parameter vector.}
\put{x}{$N\times L$ matrix of which columns are independent variables.}
\put{y}{$N\times rs$ matrix of which every row is a contingency table.}
\put{r}{Number of rows in every contingency table.}
\put{s}{Number of columns in every contingency table.}
}
{
\put{hess}{$K\times K$ Hessian matrix, with $K$ either $L(r+s-2)+1$ or
$L(r+s-1)$.}
}
{The first column of $x$ should consist completely of ones. Every row
of $y$ represents a contingency table, corresponding to the $r\times s$ 
 possible
outcomes of the two outcome variables.}
{\_rpar}
{BPMRS4.ARC}



\proclang
{BPROBRS}
{Performs estimation of parameters for bivariate probit model, given the
data as $r\times s$ contingency tables.}
{teta,ll,tetra,llt,teta1,ll1,teta2,ll2}{x,y,r,s,indvar,depvar}
{
\put{x}{$N\times L$ or $N\times (L-1)$
matrix of which columns are independent variables.}
\put{y}{$N\times rs$ matrix of which every row is a contingency table.}
\put{r}{Number of rows in every contingency table.}
\put{s}{Number of columns in every contingency table.}
\put{indvar}{$L\times 1$ or $(L-1)\times 1$ character vector, containing
names of the independent variables.}
\put{depvar}{$2\times 1$ character vector, containing
names of the dependent variables.}
}
{
\put{teta}{$L(r+s-2)+1\times 4$ or $L(r+s-1)\times 4$ matrix.
 The columns contain
estimates for the parameters of the bivariate probit model,
their standard errors, and the corresponding
$t$-values and $P$-values.}
\put{ll}{Corresponding log-likelihood}
\put{tetra}{$3\times 4$ matrix, meaning of the columns the same as for
\it teta\rm,
 but \it tetra \rm gives the parameters of the bivariate probit model, where
the effect of the covariates is not taken into account.}
\put{llt}{Corresponding log-likelihood.}
\put{teta1}{$L(r-1)\times 4$ 
matrix of parameters, standard errors, $t$-values and
$P$-values for the univariate probit model for the first dependent variable.}
\put{ll1}{Corresponding log-likelihood.}
\put{teta2}{$L(s-1)\times 1$ parameter vector, analogous
 for second dependent variable.}
\put{ll2}{Corresponding log-likelihood.}
}
{One can fit a model with the correlation coefficient constant or depending
on the covariates (see description of global \it\_rpar\rm). 
In the first case there are $L(r+s-2)+1$ parameters, in the
second case, there are $L(r+s-1)$ parameters.
There are also globals controlling
the output routines, the convergence of the Newton-Raphson iterations,
restrictions (to deal with different sets of covariates for first, second
variable and correlation) and significance tests.  
 The dependent variable should be a contingency table, corresponding
to a specific set of covariates. It is possible to call the procedure
directly or indirectly via BPRS, which allows dataset to be inputted.
The output file, corresponding
to this procedure is BPROBIT.OUT.
The difference in input format for $x$ and \it indvar \rm depends on 
whether a column of ones is added by the user or not. }
{\_initval, \_itscrn, \_itfile,  \_file, \_eps,
\_maxit,
\_rpar, \_restric,  \_signif }
{BPMRS5.ARC}

\proc
{BPRS}
{Performs estimation of parameters for bivariate probit model, given the
data as 2 vectors, representing ordered categorical outcomes with $r$,
respectively $s$ outcome categories. Input can be done either via global 
matrices  or via a GAUSS dataset.}
{\noindent\hbox{
$\{\hbox{\it teta,ll,tetra,llt,teta1,ll1,teta2,ll2}\}
=$BPRS(\it dset,indvar,depvar\bf)}\break
\medskip
\noindent\hbox{
$\{\hbox{\it rho,par,pl,tvec,pvec,step,min,max}\}
=$BPRS(\it dset,indvar,depvar\bf)}
}
{
\put{dset}{Either a string, containing the name of a GAUSS data set or the
null string.}
\put{indvar}{Either an $L\times 1$ or $(L-1)\times 1$ character vector,
containing the names of the independent variables, or an $N\times L$ or
$N\times (L-1)$ matrix of independent variables.}
\put{depvar}{Either a $2\times 1$  character vector,
containing the names of the dependent variables, or an $N\times 2$
matrix of dependent variables.}
}
{
\noindent \rm If $\_rpar=0,1$~(parameter estimation)~:\medskip
\put{teta}{$L(r+s-2)+1\times 4$ or $L(r+s-1)\times 4$ matrix.
 The columns contain
estimates for the parameters of the bivariate probit model,
their standard errors, and the corresponding
$t$-values and $P$-values.}
\put{ll}{Corresponding log-likelihood}
\put{tetra}{$3\times 4$ matrix, meaning of the columns the same as for
\it teta\rm,
 but \it tetra \rm gives the parameters of the bivariate probit model, where
the effect of the covariates is not taken into account.}
\put{llt}{Corresponding log-likelihood.}
\put{teta1}{$L(r-1)\times 4$ 
matrix of parameters, standard errors, $t$-values and
$P$-values for the univariate probit model for the first dependent variable.}
\put{ll1}{Corresponding log-likelihood.}
\put{teta2}{$L(s-1)\times 1$ parameter vector, analogous
 for second dependent variable.}
\put{ll2}{Corresponding log-likelihood.}
\vfill\eject\noindent 
\rm If $\_rpar=2$~(profile likelihood)~:\medskip
\put{rho}{$K\times 1$ vector of correlation values used.}
\put{par}{$4L\times K$ vector of parameters and standard errors.}
\put{pl}{$K\times 1$ vector of log-likelihoods.}
\put{tvec}{$K\times 1$ vector of $t$-values.}
\put{pvec}{$K\times 1$ vector of $P$-values.}
\put{step}{Interval between rho values.}
\put{min}{Minimum rho value.}
\put{max}{Maximum rho value.}
}
{In case of parameter estimation,
one can fit a model with the correlation coefficient constant or depending
on the covariates. In the first case there are $L(r+s-2)+1$ parameters, in the
second case, there are $L(r+s-1)$ parameters. 
There are also globals controlling
the output routines, the convergence of the Newton-Raphson iterations,
restrictions (to deal with different sets of covariates for first, second
variable and correlation) and significance tests.
The dependent variables should be in the form of two columns ordered 
categorical outcomes.
The independent variables may be either continuous
or discrete.
If the input is to be given by means of contingency tables, use
BPROBRS. If profile likelihood is to be performed starting from contingency
tables, use PROFLIK or PRBLIK. Note that for profile likelihood, the
outcome variables should be dichotomous.
The output file, corresponding to this procedure is BPROBIT.OUT}
{\_initval, \_itscrn, \_itfile,  \_file, \_eps, \_maxit,
\_rpar, \_restric,  \_signif}
{BPMRS6.ARC}






\end

