Re: [R] t.test() with missing values

From: Birgit Lemcke <birgit.lemcke_at_systbot.uzh.ch>
Date: Fri, 14 Sep 2007 15:47:29 +0200

Am 14.09.2007 um 14:27 schrieb Peter Dalgaard:

> Petr PIKAL wrote:

>> Hi
>>
>> r-help-bounces@r-project.org napsal dne 14.09.2007 13:50:58:
>>
>>
>>> Birgit Lemcke wrote:
>>>
>>>> Am 14.09.2007 um 12:05 schrieb Peter Dalgaard:
>>>>
>>>>
>>>>> S Ellison wrote:
>>>>>
>>>>>>>>> Peter Dalgaard <P.Dalgaard_at_biostat.ku.dk> 14/09/2007
>>>>>>>>> 09:26:16 >>>
>>>>>>>>>
>>>>>>>>>
>>
>>
>> <snip>
>>
>>
>>
>>>>> Yes, but....
>>>>>
>>>>> I don't think lme() will do better than what you can do by
>>>>> hand: Get
>>>>>
>> two
>>

>>>>> independent estimates of mu1-mu2 (one estimate from the pairs
>>>>> and one
>>>>> from the singlets), compute a weighted average using the s.e.'s
>>>>> and

>>>>>
>> test
>>
>>>>> that against zero (possibly after testing them for equality for
>>>>> good
>>>>> measure). This is easy if you use a plug-in approach: first assume
>>>>>

>> that
>>
>>>>> the s.e. are known, then plug in their empirical value. The tricky
>>>>>
>> bit
>>
>>>>> is to calculate the DF in the style of Welch's test.
>>>>>
>>>> I apologise but I really can not follow your
>>>> explanations.
>>>> I am R and Stastistics Beginner.
>>>>
>>>> What do you mean with mu1-mu2 and what are s.e.´s?
>>>>
>>>>
>>> That was a reply to S. Ellison. If you don't understand it, don't
>>> worry;
>>> you'll probably need to read a book chapter or more about weighted
>>> analyses to get up to speed for that.
>>>
>>> mu1, mu2 : (theoretical) mean for group 1, 2
>>> s.e.: standard error
>>>
>>
>> But as Birgit actually does not have any paired values, according
>> to the
>> data she had sent, she can not do paired t.test at all. The only
>> way is to
>> compare averages from each vector by non paired t.test or to get
>> some new
>> values for which she have counterparts.
>>
> True, for that particular set of data. I did make that point in my  
> first
> reply (tried to, anyways), but I didn't repeat it the second time.
>
> If you look back, you'll see that Birgit was also doing
>
> TTest75<-t.test(Fem75, Mal75, alternative= "two.sided", paired= TRUE)
>
> and presumably there are several similar sets of data. This "works"  
> in the sense that it produces a test, but one could get the  
> suspicion that it is only using a small subset of available data if  
> the dropout rate is approaching that of Fem66/Mal66. Hence the  
> discussion of the general case.

In my case the other vectors contain about 10 or 15 missing values. So as I understand this will only a little reduce the accuracy of my tests. But for the future and for people like me that are not yet so familiar with R, it would be fine to have a function for example for a T-Test, that is able to use all the data inspite of missing values in pairs. If there is already a function that is doing that, I apologise, but I haven´t found one.

But now as we would say in Germany: I will be quiet when adults are talking.

Kind regards

Birgit

>

>> Regards
>> Petr
>>
>>
>>
>>
>>>> Once again thank you for your help.
>>>>
>>>> Birgit
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>> -- O__ ---- Peter Dalgaard Øster Farimagsgade 5,
>>>>>
>> Entr.B
>>
>>>>> c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K
>>>>> (*) \(*) -- University of Copenhagen Denmark Ph:
>>>>> (+45)
>>>>> 35327918
>>>>> ~~~~~~~~~~ - (p.dalgaard_at_biostat.ku.dk) FAX:
>>>>> (+45)
>>>>> 35327907
>>>>>
>>>>>
>>>>>
>>>> Birgit Lemcke
>>>> Institut für Systematische Botanik
>>>> Zollikerstrasse 107
>>>> CH-8008 Zürich
>>>> Switzerland
>>>> Ph: +41 (0)44 634 8351
>>>> birgit.lemcke_at_systbot.uzh.ch
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>> --
>>> O__ ---- Peter Dalgaard Øster Farimagsgade 5, Entr.B
>>> c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K
>>> (*) \(*) -- University of Copenhagen Denmark Ph: (+45)
>>>
>> 35327918
>>
>>> ~~~~~~~~~~ - (p.dalgaard_at_biostat.ku.dk) FAX: (+45)
>>>
>> 35327907
>>
>>> ______________________________________________
>>> R-help_at_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.
>>>
>>
>> ______________________________________________
>> R-help_at_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.
>>
>
>
> -- 
>    O__  ---- Peter Dalgaard             Øster Farimagsgade 5, Entr.B
>   c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
>  (*) \(*) -- University of Copenhagen   Denmark          Ph:  (+45)  
> 35327918
> ~~~~~~~~~~ - (p.dalgaard_at_biostat.ku.dk)                  FAX: (+45)  
> 35327907
>
> ______________________________________________
> R-help_at_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.

Birgit Lemcke
Institut für Systematische Botanik
Zollikerstrasse 107
CH-8008 Zürich
Switzerland
Ph: +41 (0)44 634 8351
birgit.lemcke_at_systbot.uzh.ch

        [[alternative HTML version deleted]]



R-help_at_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. Received on Fri 14 Sep 2007 - 13:53:17 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 14 Sep 2007 - 14:35:06 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.