SHAZAM Questions and Answers (Q&A) - RSS feedhttp://community.econometrics.com/questions/SHAZAM Econometrics, Statistics and Analytics Communityen<font color="white">Copyright <b>SHAZAM Analytics, 2018</b></font>Wed, 30 Apr 2014 02:16:26 +0000How do I print the p-value?http://community.econometrics.com/question/505/how-do-i-print-the-p-value/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. Mon, 28 Apr 2014 22:45:10 +0000http://community.econometrics.com/question/505/how-do-i-print-the-p-value/Answer by SHAZAMHelp for <p>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. </p>
http://community.econometrics.com/question/505/how-do-i-print-the-p-value/?answer=509#post-id-509See 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
Wed, 30 Apr 2014 02:16:26 +0000http://community.econometrics.com/question/505/how-do-i-print-the-p-value/?answer=509#post-id-509