[R] How to make t.test handle "NA" and "essentially constantvalues" ?
ONKELINX, Thierry
Thierry.ONKELINX at inbo.be
Tue Feb 12 12:13:59 CET 2008
Have a look at ?try
try(t.test(x))
HTH,
Thierry
------------------------------------------------------------------------
----
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature
and Forest
Cel biometrie, methodologie en kwaliteitszorg / Section biometrics,
methodology and quality assurance
Gaverstraat 4
9500 Geraardsbergen
Belgium
tel. + 32 54/436 185
Thierry.Onkelinx op inbo.be
www.inbo.be
Do not put your faith in what statistics say until you have carefully
considered what they do not say. ~William W. Watt
A statistical analysis, properly conducted, is a delicate dissection of
uncertainties, a surgery of suppositions. ~M.J.Moroney
-----Oorspronkelijk bericht-----
Van: r-help-bounces op r-project.org [mailto:r-help-bounces op r-project.org]
Namens Ng Stanley
Verzonden: dinsdag 12 februari 2008 11:56
Aan: r-help
Onderwerp: Re: [R] How to make t.test handle "NA" and "essentially
constantvalues" ?
Thanks. Someone please help to make t.test go through all the data and
not
to be disrupted by the two problems.
On 2/12/08, Petr PIKAL <petr.pikal op precheza.cz> wrote:
>
> Hi
>
> r-help-bounces op r-project.org napsal dne 12.02.2008 09:09:23:
>
> > Hi,
> >
> > First problem:
> > > test <- matrix(c(1,1,2,1), 2,2)
> > > apply(test, 1, function(x) { t.test(x) $p.value })
> > Error in t.test.default(x) : data are essentially constant
>
> make your data not constant
>
> >
> > Second problem:
> > > test <- matrix(c(1,0,NA,1), 2,2)
> > > apply(test, 1, function(x) { t.test(x) $p.value })
> > Error in t.test.default(x) : not enough 'x' observations
>
> increase number of observations
>
>
> >
> > How to make t-test ignores this errors ?
>
> Well, the procedure is complaining that you do not give it correct
data.
> You shall be gratefull for a great software which prevent you from
making
> silly things as try to compute t.test when data have zero variantion
or
> number of observations is 1.
>
> Regards
> Petr
>
> >
> > [[alternative HTML version deleted]]
> >
> > ______________________________________________
> > R-help op r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> > and provide commented, minimal, self-contained, reproducible code.
>
>
[[alternative HTML version deleted]]
______________________________________________
R-help op r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
More information about the R-help
mailing list