Re: [R] how to rectify t.test( ) error

From: Peter Dalgaard <p.dalgaard_at_biostat.ku.dk>
Date: Fri 03 Jun 2005 - 08:55:30 EST

"Jagarlamudi, Choudary" <choudary.jagar@swosu.edu> writes:

> Hi All,
>
> I get the following error when i perform a t.test.
>
> studentt<-apply(tlr, 1, function(x) t.test(x[2:6], x[7:11],var.equal=TRUE)$p.value)
>
> # tlr is a table of 11 columns and 22500 rows. I am not able to post tlr due to its size.
>
> Error in if (stderr < 10 * .Machine$double.eps * max(abs(mx), abs(my))) stop("data are essentially constant") :
> missing value where TRUE/FALSE needed
> In addition: Warning messages:
> 1: argument is not numeric or logical: returning NA in: mean.default(x)
> 2: argument is not numeric or logical: returning NA in: mean.default(y)
>
> Could someone kindly give me pointers regarding the error. This worked fine with 2 other data sets.

I would conjecture that your table is nonnumeric. What is mode(tlr)? (-- or mode(as.matrix(tlr)) if tlr is a data frame).

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk)             FAX: (+45) 35327907

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Received on Fri Jun 03 09:05:22 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:32:22 EST