title: How to perform a simple t-test in Spark?
body: <p>My goal is to perform a t-test in Spark Scala with the method documented on <a href="https://spark.apache.org/docs/2.0.2/api/java/org/apache/spark/mllib/stat/test/StudentTTest.html" rel="nofollow noreferrer">https://spark.apache.org/docs/2.0.2/api/java/org/apache/spark/mllib/stat/test/StudentTTest.html</a>. Let's assume my data is given in a data frame:</p>
  
  <pre><code>val df = Seq((1, 3), (-2, 5), (0, 4), (3, -1), (2, -1)).toDF("group1", "group2")
  </code></pre>
  
  <p>Now, I tried</p>
  
  <pre><code>import org.apache.spark.mllib.stat.test
  val ttestResult = test.StudentTTest(df)
  </code></pre>
  
  <p>but this got me an error: <code>&lt;console&gt;:29: error: object StudentTTest in package test cannot be accessed in package org.apache.spark.mllib.stat.test</code></p>
  
  <p>What am I doing wrong?</p>