有没有一种方法可以从StudentT类中获取Ttest值和P值?我正在尝试从这个库中计算这些值:https://numerics.mathdotnet.com/api/MathNet.Numerics.Distributions/StudentT.htm
excel的等价函数是T检验。但我在math.net数值excel函数中没有这个方法。下面的链接显示了所有的excel方法:https://numerics.mathdotnet.com/api/MathNet.Numerics/ExcelFunctions.htm
从上面的库中获得完成此任务的任何指针都将是非常有帮助的。
谢谢..。
发布于 2017-05-17 04:48:37
我不知道如何在Math.Net中做到这一点,但我知道如何在Meta.Numerics中做到这一点:
Sample sample1 = new Sample(1.0, 2.0, 3.0, 4.0);
Sample sample2 = new Sample(3.0, 4.0, 5.0, 6.0);
TestResult tTest = Sample.StudentTTest(sample1, sample2);
Console.WriteLine("t = {0}", tTest.Statistic);
Console.WriteLine("P = {0} ({1})", tTest.Probability, tTest.Type);我理解如果您对更改数学库不感兴趣,但由于您的问题已经过去了一段时间,没有答案,我想我应该插话。
发布于 2021-06-23 14:41:10
下面是如何使用MathNet.Numerics库集执行左尾测试。
假设您在一个数组中有一些数据,并且已经计算了所有需要的初步统计数据,如下所示。
int n = 5; //size of sample
double hypotheziedMean = 50.0;
double sampleMean = 50.03;
double sampleSD = 1.5; //sample standard deviation (n-1)
double stdErr = sampleSD / Math.Sqrt(n); //standard error of the mean
double t = (sampleMean - hypotheziedMean) / stdErr; //convert to a standard mean of 0 and SD of 1
StudentT st = new StudentT(0, 1, n-1); //create a standard StudentT object with n-1 DOF
double pVal = st.CumulativeDistribution(t); //left tail pvalhttps://stackoverflow.com/questions/43939796
复制相似问题