文档

Vartest

卡方差异测试

句法

H=Vartest((X,,,,v)
H=Vartest((X,,,,v,,,,名称,价值)
[h,p] = vartest(___
[h,p,ci,stats] = vartest(___

Description

例子

H=Vartest((X,,,,vreturns a test decision for the null hypothesis that the data in vectorX来自正态分布的差异v, 使用卡方差异测试。另一种假设是Xcomes from a normal distribution with a different variance. The resultH1如果该测试在5%的显着性水平上拒绝零假设,并且0除此以外。

例子

H=Vartest((X,,,,v,,,,名称,价值执行卡方差测试,并使用一个或多个名称值对参数指定的其他选项。例如,您可以更改显着性水平或进行单方面测试。

例子

[[H,,,,p] = vartest(___also returns thep- 测试值,p,,,,using any of the input arguments in the previous syntaxes.

例子

[[H,,,,p,,,,CI,,,,统计] = vartest(___also returns the confidence interval for the true variance,CI和结构统计containing information about the test statistic.

Examples

collapse all

Load the sample data. Create a vector containing the first column of the students' exam grades matrix.

加载examgradesx =级别(:,1);

测试数据的零假设,即数据来自差异为25的分布。

[H,P,CI,Stats] = Vartest(x,25)
h = 1p= 0CI=59.8936 99.7688 stats = struct with fields: chisqstat: 361.9597 df: 119

返回的值h = 1indicates thatVartest在默认的5%显着性水平上拒绝零假设。CIsHows the lower and upper boundaries of the 95% confidence interval for the true variance, and suggests that the true variance is greater than 25.

Load the sample data. Create a vector containing the first column of the students' exam grades matrix.

加载examgradesx =级别(:,1);

test the null hypothesis that the data comes from a distribution with a variance of 25, against the alternative hypothesis that the variance is greater than 25.

[h,p] = vartest(X,,,,25,'尾巴',,,,'right'
h = 1 p = 2.4269e-26

返回的值h = 1indicates thatVartest拒绝默认的5%显着性水平的无效假设,有利于选择方差大于25的替代假设。

输入参数

collapse all

示例数据,指定为矢量,矩阵或多维数组。对于矩阵,Vartestperforms separate tests along each column ofX,并返回结果的行矢量。为了多维阵列s,,,,Vartest沿着first nonsingleton dimensionofX

数据类型:单身的|双倍的

Hypothesized variance, specified as a nonnegative scalar value.

数据类型:单身的|双倍的

姓名-Value Pair Arguments

指定可选的逗号分隔对名称,价值arguments.姓名是参数名称和Value是the corresponding value.姓名must appear inside single quotes ('')。您可以按任何顺序指定几个名称和值对参数姓名1,,,,Value1,...,NameN,ValueN

Example:“尾巴”,“正确”,,,,'Alpha',0.01指定在1%显着性水平的右尾假设检验。

collapse all

Significance level of the hypothesis test, specified as the comma-separated pair consisting of'Alpha'以及范围内的标量值(0,1)。

Example:'Alpha',0.01

数据类型:单身的|双倍的

Dimension of the input matrix to test along, specified as the comma-separated pair consisting of'暗淡'和积极的整数价值。例如,指定“昏暗”,1tests the data in each column for equality to the hypothesized variance, while“昏暗”,2tests the data in each row.

Example:“昏暗”,2

数据类型:单身的|双倍的

评估的替代假设类型,指定为逗号分隔对'尾巴'以及以下内容之一。

'两个都' 测试种群差异不是的替代假设v
'right' 检验替代假设,即种群差异大于v
'left' 检验替代假设,即种群差异小于v

Example:“尾巴”,“正确”

输出参数

collapse all

Hypothesis test result, returned as a logical value.

  • IfH= 1,这表明拒绝零假设Α显着性水平。

  • IfH= 0,这表明未能拒绝在Α显着性水平。

p- 测试值,returned as a scalar value in the range [0,1].p观察测试统计量的概率比原假设下观察到的值更为极端或更极端。小值p怀疑零假设的有效性。

Confidence interval for the true variance, returned as a two-element vector containing the lower and upper boundaries of the 100 × (1 –Α)% confidence interval.

卡方差异测试的测试统计量,返回为包含的结构:

  • chisqstat-Value of the test statistic.

  • DF-Degrees of freedom of the test.

更多关于

collapse all

Chi-Square Variance Test

tHe chi-square variance test is used to test whether the variance of a population is equal to a hypothesized value.

测试统计量是

t = (( n - 1 (( s σ 0 2 ,,,,

在哪里n是样本量,s是the sample standard deviation, andσ0是the hypothesized standard deviation. The denominator is the ratio of the sample standard deviation to the hypothesized standard deviation. The further this ratio deviates from 1, the more likely you are to reject the null hypothesis. The test statistictHas a chi-square distribution withn- 1零假设下的自由度。

多维阵列

A multidimensional array has more than two dimensions. For example, ifX是一个1 x-3 x-4阵列,然后X是a three-dimensional array.

第一个nonsingleton维度

tHe first nonsingleton dimension is the first dimension of an array whose size is not equal to 1. For example, ifX是一个1 x-2-by-3-by-4阵列,那么第二维是第一个非元素维度。X

tips

  • Usesampsizepwr计算:

    • 对应于指定的功率和参数值的样本大小;

    • 给定真实参数值,对于特定样本量获得的功率;

    • 参数值可通过指定的样本量和功率检测到。

也可以看看

||

Introduced before R2006a

Was this topic helpful?