[R] t.test() with missing values

Peter Dalgaard P.Dalgaard at biostat.ku.dk
Fri Sep 14 13:50:58 CEST 2007


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 >>>
>>>>>>
>>>>> So what can I do now to solve my problem?
>>>>>
>>>>> Do you think I should not use paired=TRUE?
>>>>>
>>>> You *can* only use it when you have pairs, and you must do it then, to
>>>> correct for intra-pair correlation. The drawback is that it looks only
>>>> at complete pairs, throwing away all the singlets. It is possible to
>>>> recover the information from the singlets , basically by combining a
>>>> paired test for the pairs and an unpaired one for the singlets.
>>>> (Someone
>>>> must have written this down, but I'm afraid I don't have a nice
>>>> reference).
>>>>
>>>
>>> Question: Could you achieve this kind of outcome with lme? stack the
>>> two groups, mark the observations y by subject (ie the pair ID) and
>>> group (treatment, presumably), and do something like
>>>
>>> anova(lme(y~group, data=d, random=~1|subj, na.action=na.omit))
>>>
>>> Or is that just disguising one of those nasty unbalanced 2-way anova
>>> problems?
>>>
>> 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
>             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



More information about the R-help mailing list