CDF Instruction |
CDF( options ) distribution statistic degree1 degree2
Computes the marginal significance level of a statistic from one of four distributions.
Parameters
distribution |
Choose from FTEST, TTEST, CHISQ, or NORMAL. Selects the distribution to use for the computation. The significance levels for TTEST and NORMAL are both for two-tailed tests. |
statistic |
the test statistic |
degree1 |
degrees of freedom (TTEST, CHISQ), numerator degrees of freedom (FTEST) |
degree2 |
denominator degrees of freedom (FTEST) |
Options
[PRINT]/NOPRINT
TITLE="title for output" [none]
Variables Defined
%CDSTAT |
the computed test statistic (REAL) |
%SIGNIF |
the marginal significance level (REAL) |
Notes
CDF is a convenient way to display the significance level, but all the four distributions have functions (shown below) which compute those as well, so you can display the result some other way, such as with a DISPLAY or REPORT.
FTEST |
|
TTEST |
|
NORMAL |
|
CHISQR |
Examples
These are from two of the standard examples. Note that the statistic parameter can be an expression rather than just a variable, although both of these compute and save that. For instance, the end of the second example could be written:
cdf(title="LR Test for Children in School Dummies") chisqr 2*(logunres-logres) 4
*
* CHOW1.RPF
* Chow test by subsample regressions
*
open data states.wks
data(org=col,format=wks) 1 50 expend pcaid pop pcinc
set pcexp = expend/pop
*
linreg(smpl=pop<5000) pcexp
# constant pcaid pcinc
compute rsssmall=%rss , ndfsmall=%ndf
*
linreg(smpl=pop>=5000) pcexp
# constant pcaid pcinc
compute rsslarge=%rss , ndflarge=%ndf
*
* Full sample regression
*
linreg pcexp
# constant pcaid pcinc
compute rsspool=%rss
*
compute rssunr=rsssmall+rsslarge , ndfunr=ndfsmall+ndflarge
compute fstat = ( (rsspool-rssunr)/3 ) / (rssunr/ndfunr)
cdf(title="Chow test for difference in large vs small") ftest fstat 3 ndfunr
*
* PROBIT.RPF
*
open data probit.dat
data(org=obs) 1 95 public1_2 public3_4 public5 private $
years teacher loginc logproptax yesvm
*
* Linear probability model
*
linreg yesvm
# constant public1_2 public3_4 public5 private years teacher loginc logproptax
*
ddv(dist=logit) yesvm
# constant public1_2 public3_4 public5 private years teacher loginc logproptax
ddv(dist=probit) yesvm
# constant public1_2 public3_4 public5 private years teacher loginc logproptax
*
* Test whether "Children in School" dummies are significant.
* Use "Wald" test first.
*
exclude(title="Wald Test of Children in School Dummies")
# public1_2 public3_4 public5 private
*
* Likelihood ratio test. We already have the unrestricted model.
*
compute logunres = %logl
*
ddv(dist=probit) yesvm
# constant years teacher loginc logproptax
compute logres=%logl
*
*
compute lratio=2*(logunres-logres)
cdf(title="LR Test for Children in School Dummies") chisqr lratio 4
Sample Output
LR Test for Children in School Dummies
Chi-Squared(4)= 6.051680 with Significance Level 0.19532186
Copyright © 2025 Thomas A. Doan