* * VARCAUSE.RPF * Example of block exogeneity test * * RATS User's Guide, Example from Section 7.4 * open data haversample.rat calendar(q) 1959 data(format=rats) 1959:1 2006:4 dgnp fm2 gdph ih lr * set loggdp = log(gdph) set logm2 = log(fm2) set logp = log(dgnp) set logi = log(ih) set unemp = lr * system(model=unrestricted) variables loggdp unemp logi lags 1 to 4 det constant logp{1 to 4} logm2{1 to 4} end(system) estimate(resids=unresids) compute ntotal=%nregsystem,mcorr=%nreg,loglunr=%logl compute logdetunr=%logdet * system(model=restricted) variables loggdp unemp logi lags 1 to 4 det constant end(system) estimate(resids=resresids) compute loglres=%logl compute logdetres=%logdet * * Using RATIO * ratio(degrees=ntotal-%nregsystem,mcorr=mcorr,\$ title="Exogeneity of Real Variables") # unresids # resresids * * Using %LOGDET statistics: * compute teststat=(%nobs-mcorr)*(logdetres-logdetunr) cdf(title="Exogeneity of Real Variables") chisqr \$ teststat ntotal-%nregsystem * * Using %LOGL statistics. The standard LR test of -2*(L(R)-L(U)) is * adjusted by multiplying by (T-c)/T to implement the multiplier * correction. * compute teststat=-2.0*(%nobs-mcorr)/%nobs*(loglres-loglunr) cdf(title="Exogeneity of Real Variables") chisqr \$ teststat ntotal-%nregsystem