问题描述
首先,我知道可以使用var.test(x,y)来推断两个总体方差的比率,但是我的问题是关于一个总体方差的推断。
根据此source,我应该使用varTest()函数对总体方差进行一样本测试。但是,每次尝试此操作时都会收到错误代码,因为R找不到此功能:
x <- rnorm(50,mean = 4,sd = 1)
varTest(x,sigma.squared = 1) # sigma.squared is our null hypothesis for population variance
Error in varTest(x,sigma.squared = 1) :
could not find function "varTest"
如果我尝试使用var.test()对总体方差进行一个样本测试,则会发生以下情况:
x <- rnorm(50,sd = 1)
var.test(x,sigma.squared = 1)
Error in var.test.default(x,sigma.squared = 1) :
argument "y" is missing,with no default
第二个错误不足为奇,因为我认为var.test()仅保留用于推断两个总体方差的比率。
是否应该使用varTest函数,但是我根本没有安装包含该函数的软件包?
背景信息: 我在macOS Catalina版本10.15.6上运行RStudio版本1.3.959 这是我要在R中进行的统计测试的video。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)