Difficulty extracting p-values from PySDTest objects via EViews xrun
Posted: Mon Apr 13, 2026 8:55 am
I am working on a research project involving Stochastic Dominance tests using EViews 13 (64-bit) integrated with Python 3.9.
I have successfully set up the Python environment and installed the PySDTest package (by Kyung-ho Lee and Yoon-Jae Whang). My goal is to extract the p-values from the test objects generated by pysdtest.test_sd() and store them in EViews scalars/tables for further analysis.
My workflow is as follows:
I use xput to send my series (a_vals, b_vals) to Python.
I execute the test:
xrun my_test_ssd = pysdtest.test_sd(a_vals, b_vals, s=2, resampling='paired_bootstrap', nboot=1000, quiet=False)
I run the testing procedure:
xrun res_ssd = my_test_ssd.testing()
The issue:
While the testing() method correctly prints the results to the EViews Python Output log, I am unable to programmatically access the p-value result to bring it back to EViews. When I attempt to access the attribute via xrun my_pval = my_test_ssd.pvalue or res_ssd.pvalue, I receive an AttributeError or NoneType error, despite the output being clearly visible in the Python console log.
My questions:
Is there a documented way to access the p-value attribute from the test_sd object directly through xrun?
What is the recommended best practice for capturing and importing Python output (log) back into an EViews table when the standard xget fails to resolve the specific object attributes?
Best Regards,
Timotheos
I have successfully set up the Python environment and installed the PySDTest package (by Kyung-ho Lee and Yoon-Jae Whang). My goal is to extract the p-values from the test objects generated by pysdtest.test_sd() and store them in EViews scalars/tables for further analysis.
My workflow is as follows:
I use xput to send my series (a_vals, b_vals) to Python.
I execute the test:
xrun my_test_ssd = pysdtest.test_sd(a_vals, b_vals, s=2, resampling='paired_bootstrap', nboot=1000, quiet=False)
I run the testing procedure:
xrun res_ssd = my_test_ssd.testing()
The issue:
While the testing() method correctly prints the results to the EViews Python Output log, I am unable to programmatically access the p-value result to bring it back to EViews. When I attempt to access the attribute via xrun my_pval = my_test_ssd.pvalue or res_ssd.pvalue, I receive an AttributeError or NoneType error, despite the output being clearly visible in the Python console log.
My questions:
Is there a documented way to access the p-value attribute from the test_sd object directly through xrun?
What is the recommended best practice for capturing and importing Python output (log) back into an EViews table when the standard xget fails to resolve the specific object attributes?
Best Regards,
Timotheos