I have two 4*4 matrices in JAVA, where one matrix holds observed counts and the other expected counts.
I need an automated way to calculate the p-value from the chi
Check this page JRI
Description form their site:
JRI is a Java/R Interface, which allows to run R inside Java applications as a single thread. Basically it loads R dynamic library into Java and provides a Java API to R functionality. It supports both simple calls to R functions and a full running REPL.