instrumental variables method for a model equation
[model2,rivmod]=ivmod(model,tsmat,indeq,endo,ivar,arg1,...,argn)
* model = a model tlist
* tsmat = a tsmat containing all data needed for estimating the equation (should be the tsmat associated to the model, created by function create_dbmod)
* indeq =
- a string, the name of the equation to estimate
- or an integer, the # of the equation in the model
* endo =
- a string vector, the names of the variables that will be instrumented
- or a list of variables, each entered between quotes
* ivar =
- a string vector, the names of the instruments
- a list, each element in the list conating the list of instruments for the variable at the same rank in the list of endogenous variables given in the previous input
* arg1,...,argn = optional arguments
- 'noprint' if the user does not want to print the result (default: results are displayed on screen)
- 'save=%t' if the user wants to save the estimated coefficients in the model tlist
* model2 = the model tlist, with the estimated coefficients if the option save has been swtiched to %t
* rivmod = a results tlist, with:
- rivmod('meth') = 'ivmod'
- rivmod('y') = y data vector
- rivmod('x') = x data matrix
- rivmod('nobs') = # observations
- rivmod('nvar') = # variables
- rivmod('beta') = bhat
- rivmod('yhat') = yhat
- rivmod('resid') = residuals
- rivmod('vcovar') = estimated variance-covariance matrix of
- rivmod('sige') = estimated variance of the residuals
- rivmod('sigu') = sum of squared residuals
- rivmod('ser') = standard error of the regression
- rivmod('tstat') = t-stats
- rivmod('pvalue') = pvalue of the betas
- rivmod('dw') = Durbin-Watson Statistic
- rivmod('condindex') = multicolinearity cond index
- rivmod('prescte') = boolean indicating the presence or
- rivmod('llike') = the log-likelihood
- rivmod('aic')= the Akaike information criterion
- rivmod('bic')= the Schwarz information criterion
- rivmod('hq')= the Hannan-Quinn information criterion
- rivmod('rsqr') = rsquared
- rivmod('rbar') = rbar-squared
- rivmod('f') = F-stat for the nullity of coefficients
- rivmod('pvaluef') = its significance level
- rivmod('grsqr') = generalized R-squared (the one where
- rivmod('grbar') = rbar-squared
- rivmod('fg') = F-stat for the nullity of coefficients other than the constant
- rivmod('pvaluefg') = its significance level
- rivmod('like') = log-likelihood of the regression
- rivmod('prests') = boolean indicating the presence or
- rivmod('namey') = name of the y variable
- rivmod('namey') = name of the y variable
- rivmod('namex') = name of the coefficients
- rivmod('dropna') = boolean indicating if NAs have been dropped
- rivmod('bounds') = if there is a timeseries in the regression, the bounds of the regression
- rivmod('nonna') = vector indicating position of non-NAs
- rivmod('saturation significance level') = significance level used to keep the dummies
- rivmod('significant dummies') = the remaining dummies after testing
global GROCERDIR // load the model small: load(GROCERDIR+'data\small.dat') // load the database small_db: load(GROCERDIR+'data\small_db.dat') // set the bounds: bounds('1981q1','2005q4'); // estimate the equation ' [small,riv]=ivmod(small,small_db,'td_p523_d1','delts(1,td_dint_dhs1)',['delts(demmon)','const'],'save=%t') | ![]() | ![]() |