t.test.data<-read.table("D:\\Rdownload\\lianxi\\first\\t.test.txt",
header=T)
attach(t.test.data)
ratio<-weight/height^2
t.test(ratio)
##
## One Sample t-test
##
## data: ratio
## t = 12.611, df = 5, p-value = 5.569e-05
## alternative hypothesis: true mean is not equal to 0
## 95 percent confidence interval:
## 18.41734 27.84791
## sample estimates:
## mean of x
## 23.13262
###统计量: t值: 12.611;自由度(df): 5;p值: 5.569e-05(即0.00005569);
###备择假设 : 真实均值不等于0
###置信区间 : 95% 置信区间为 [18.41734, 27.84791]
###样本估计 : x 的均值为 23.13262
###这个结果表示在自由度为5的情况下,计算得到的t值为12.611,对应的p值非常小(远小于通常的显著性水平如0.05),因此可以拒绝原假设(即认为样本均值与0没有显著差异)。这意味着样本数据的均值与0存在显著的统计学上的不同。95%的置信区间也表明了样本均值可能的范围。