SHAZAM Community
Ask Your Question

How do I print the p-value?

asked 2014-04-28 22:45:10 +0000

stiang gravatar image

Is there an easy way of printing the p-value of a variable in an OLS-regression? I am doing a do-loop and need just the variables coefficient (got that with the option coef=) and its associated p-value.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2014-04-30 02:16:26 +0000

updated 2014-05-02 03:16:54 +0000

See page 432 of the SHAZAM 11 manual.

This can be done by looking up the p-value from the Student's t-distribution using the DISTRIB command.

* Store the t-ratios from the regression
ols consume income  / tratio=tr

* Set the sample to the number of regressors using the temporary variable $k
sample 1 $k

* Seek value from distribution
genr tr=abs(tr)
distrib tr / type=t df=$df cdf=cdf

* Now get the p-value for a 2-sided test.
genr p_val=2*(1-cdf)
print tr p_val
edit flag offensive delete link more
Login/Signup to Answer

Question Tools


Asked: 2014-04-28 22:45:10 +0000

Seen: 179 times

Last updated: May 02 '14