# [Rd] Pl. provide and Input for var.test (PR#723)

**shalabhgandhi@usa.net
**
shalabhgandhi@usa.net

*Thu, 2 Nov 2000 06:41:51 +0100 (MET)*

I want to use var.test function of ctest library. I was able to generate the
output from R on the input given by rnorm. But when I store the same data set
provided by rnorm into a file, and then read a file into a dataframe, then on
using the dataframe as a parameter to var.test function - it gives an error
"not enough x observations".
I'll explain the above mentioned problem of mine for which I am mentioning 2
cases CaseA and CaseB. CaseA is working but CaseB is not.
(CaseA) Following are 4 commands I gave:
R
library(ctest)
x<-rnorm(50)
y<-rnorm(30)
var.test(x,y)
The output generated by R was:
F test to compare two variances
data: x and y
F = 0.9505, num df = 39, denom df = 29, p-value = 0.8707
alternative hypothesis: true ratio of variances is not equal to 1
95 percent confidence interval:
0.4675884 1.8646602
sample estimates:
ratio of variances
0.950451
(CaseB) Now I want R to give me the same output as above, when I read it from
a file. The commands I gave are:
R
library(ctest)
x<-read.table("input1.txt", header = FALSE)
y<-read.table("input2.txt", header = FALSE)
var.test(x,y)
The output generated by R is an error:
"not enough x observations"
I want to know why is this error coming, since I am creating the input1.txt
from rnorm(50) and input2.txt from rnorm(30),which should mean the same?
Pl. see if you can provide any help on this.
regards
shalabh gandhi
____________________________________________________________________
Get free email and a permanent address at http://www.netaddress.com/?N=1
____________________________________________________________________
Get free email and a permanent address at http://www.netaddress.com/?N=1
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._