<p>There are two components to what you want to know.</p>
<ol>
<li>Which statistical test is appropriate for your specific problem?</li>
<li>How to write code to carry out the desired statistical test?</li>
</ol>
<p>Question (1) is on-topic here, because it is about statistics.</p>
<p>Question (2) is off-topic here, because it is solely about writing code. Depending on the nature of the programming problem you face, there are several sites that could be a good fit. You'll need to read the Help Center for each and make a choice about which site is best.</p>
