首页 > 解决方案 > 为什么数据构造函数不在此范围内

问题描述

我正在尝试按照此处提供的方式进行学生 T 检验:

import Data.Vector as V
import Statistics.Test.StudentT
sampleA = V.fromList [1.0,2.0,3.0,4.0,1.0,2.0,3.0,4]
sampleB = V.fromList [2.0,4.0,5.0,5.0,3.0,4.0,5.0,6]
main = print $ StudentT sampleA sampleB SamplesDiffer

但是,我收到以下错误:

rnunttest.hs:8:16: error:
    Data constructor not in scope:
      StudentT :: Vector Double -> Vector Double -> PositionTest -> a0

问题出在哪里,如何解决?谢谢你的帮助。

标签: haskellstatisticst-test

解决方案


我认为您必须将构造函数更改为studentTTest

main = print $ studentTTest sampleA sampleB SamplesDiffer

推荐阅读