HI,
According to ?t.test() documentation
If ‘paired’ is ‘TRUE’ then both ‘x’ and ‘y’ must be specified and
they must be the same length. Missing values are silently removed
(in pairs if ‘paired’ is ‘TRUE’)
#Example with missing values
set.seed(24)
dat1<- as.data.frame(matrix(sample(c(NA
Hi,
I used as.data.frame(matrix(...)) just to create an example dataset. In your
case, you don't need to do that. Using the same example:
set.seed(24)
dat1<- as.data.frame(matrix(sample(20:40,40,replace=TRUE),ncol=4))
set.seed(285)
dat2<- as.data.frame(matrix(sample(35:60,40,replace=TRUE),ncol=
Hi,
May be this helps:
#You can use ?read.csv() to read the two files.
set.seed(24)
dat1<- as.data.frame(matrix(sample(20:40,40,replace=TRUE),ncol=4))
set.seed(285)
dat2<- as.data.frame(matrix(sample(35:60,40,replace=TRUE),ncol=4))
sapply(colnames(dat1),function(i) t.test(dat1[,i],dat2[,i],paired=
3 matches
Mail list logo