t.test() with missing values

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
15 messages Options
Reply | Threaded
Open this post in threaded view
|

t.test() with missing values

Birgitle
Hello!

I am using R 2.5.1 on a Apple Power Book G4 with Mac OS X 10.4.10 and  
I am still R beginner.

I try to calculate a t.test() using this code:

        TTest75<-t.test(Fem75, Mal75, alternative= "two.sided", paired= TRUE)

This works properly, but I have two variables with a lot of missing  
data and therefore get the error message:

        TTest66<-t.test(Fem66, Mal66, alternative= "two.sided", paired= TRUE)
        Fehler in var(x) : 'x' ist leer

One of the two vectors looks like this:

[1] 5.0  NA 4.5 6.0 0.8  NA 7.0 4.5  NA  NA  NA  NA 5.0  NA 6.0  NA  
5.0  NA 5.0 8.0  NA  NA  NA 8.0  NA 8.0 5.0  NA  NA  NA  NA 8.0  NA 1.0
[35]  NA  NA  NA  NA  NA  NA 5.0  NA 4.0 8.0  NA 6.0 6.0 4.5 3.5  NA  
NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA
[69]  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  
NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA
[103]  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  
NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  
NA  NA
[137]  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  
NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  
NA  NA
[171]  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  
NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  
NA  NA
[205]  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  
NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  
NA  NA
[239]  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  
NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  
NA  NA
[273]  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  
NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  
NA  NA
[307]  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  
NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  
NA  NA
[341]  NA  NA  NA  NA  NA  NA  NA  NA

Is it possible to run a TTest inspite of all the missing data?
I really need two know if may two vectors are significantly  
different. (If this results are then reliable is an other question)

By the way is there a better possibility (and I guess there is) to  
save or export the t.test() results as textfile?

Thanks in advance for your help.

Greetings

Birgit

Birgit Lemcke
Institut für Systematische Botanik
Zollikerstrasse 107
CH-8008 Zürich
Switzerland
Ph: +41 (0)44 634 8351
[hidden email]






        [[alternative HTML version deleted]]


______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: t.test() with missing values

Peter Dalgaard
Birgit Lemcke wrote:

> Hello!
>
> I am using R 2.5.1 on a Apple Power Book G4 with Mac OS X 10.4.10 and  
> I am still R beginner.
>
> I try to calculate a t.test() using this code:
>
> TTest75<-t.test(Fem75, Mal75, alternative= "two.sided", paired= TRUE)
>
> This works properly, but I have two variables with a lot of missing  
> data and therefore get the error message:
>
> TTest66<-t.test(Fem66, Mal66, alternative= "two.sided", paired= TRUE)
> Fehler in var(x) : 'x' ist leer
>
> One of the two vectors looks like this:
>
> [1] 5.0  NA 4.5 6.0 0.8  NA 7.0 4.5  NA  NA  NA  NA 5.0  NA 6.0  NA  
> 5.0  NA 5.0 8.0  NA  NA  NA 8.0  NA 8.0 5.0  NA  NA  NA  NA 8.0  NA 1.0
> [35]  NA  NA  NA  NA  NA  NA 5.0  NA 4.0 8.0  NA 6.0 6.0 4.5 3.5  NA  
> NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA
> [69]  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA ....
>  

> Is it possible to run a TTest inspite of all the missing data?
> I really need two know if may two vectors are significantly  
> different. (If this results are then reliable is an other question)
>  
Well, you're not showing the other one, but I have a hunch that
any(complete.cases(Fem66, Mal66)) will come out false,  in which case
you don't have paired data and might get rid of paired=TRUE and have an
ordinary two sample test. (BTW paired data for females and males? Couples?)


> By the way is there a better possibility (and I guess there is) to  
> save or export the t.test() results as textfile?
>
> Thanks in advance for your help.
>
> Greetings
>
> Birgit
>
> Birgit Lemcke
> Institut für Systematische Botanik
> Zollikerstrasse 107
> CH-8008 Zürich
> Switzerland
> Ph: +41 (0)44 634 8351
> [hidden email]
>
>
>
>
>
>
> [[alternative HTML version deleted]]
>
>  
> ------------------------------------------------------------------------
>
> ______________________________________________
> [hidden email] 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
~~~~~~~~~~ - ([hidden email])                  FAX: (+45) 35327907

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: t.test() with missing values

Birgitle
Thanks for your answer.

First I will show you both vectors:

Mal66
   [1]   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA    
NA   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA
[28]   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA    
NA   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA
[55]   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA  
6.0   NA  4.0  6.0  9.0  0.5  6.0  6.0   NA   NA   NA   NA  5.0   NA  
3.0
[82] 10.0  6.0   NA  5.0  7.0   NA   NA   NA  6.0  4.0  8.0  5.0    
NA   NA   NA   NA  3.0  2.0  0.8   NA  7.0   NA  6.0   NA   NA  5.0   NA
[109]  2.0  3.5   NA  7.0  6.0  5.0  4.0   NA   NA   NA   NA   NA    
NA   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA
[136]   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA    
NA   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA
[163]   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA    
NA   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA
[190]   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA    
NA   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA
[217]   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA    
NA   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA
[244]   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA    
NA   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA
[271]   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA    
NA   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA
[298]   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA    
NA   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA
[325]   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA    
NA   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA
 > Fem66
   [1] 5.0  NA 4.5 6.0 0.8  NA 7.0 4.5  NA  NA  NA  NA 5.0  NA 6.0  
NA 5.0  NA 5.0 8.0  NA  NA  NA 8.0  NA 8.0 5.0  NA  NA  NA  NA 8.0  
NA 1.0
[35]  NA  NA  NA  NA  NA  NA 5.0  NA 4.0 8.0  NA 6.0 6.0 4.5 3.5  NA  
NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA
[69]  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  
NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA
[103]  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  
NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  
NA  NA
[137]  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  
NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  
NA  NA
[171]  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  
NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  
NA  NA
[205]  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  
NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  
NA  NA
[239]  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  
NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  
NA  NA
[273]  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  
NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  
NA  NA
[307]  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  
NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  
NA  NA
[341]  NA  NA  NA  NA  NA  NA  NA  NA

I tried this (complete.cases(Fem66, Mal66)) and you are right, it  
gives me back:

(complete.cases(Fem66, Mal66))
   [1] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE  
FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
[23] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE  
FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
[45] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE  
FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
[67] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE  
FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
[89] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE  
FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
[111] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE  
FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
[133] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE  
FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
[155] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE  
FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
[177] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE  
FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
[199] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE  
FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
[221] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE  
FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
[243] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE  
FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
[265] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE  
FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
[287] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE  
FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
[309] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE  
FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
[331] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE  
FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE

I thought the t.test is a comparison of means and why can I not use  
it if I have a lot of missing values. Is the reason that I use the  
paired option?
What is different in the calculation using paired?

Ah ja this seems to be the case:

T66<-t.test(Mal66, Fem66, alternative= "two.sided")
 > T66


Welch Two Sample t-test

data:  Mal66 and Fem66
t = -0.4881, df = 49.229, p-value = 0.6277
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
-1.4637045  0.8915906
sample estimates:
mean of x mean of y
5.096552  5.382609

I use the paired option because may plants (male and female) belong  
to the same species (and because may boss said that I have to use  
paired in this case)

So what can I do now to solve my problem?

Do you think I should not use paired=TRUE?

Thanks in advance.

Birgit





Am 13.09.2007 um 18:50 schrieb Peter Dalgaard:

> Birgit Lemcke wrote:
>> Hello!
>>
>> I am using R 2.5.1 on a Apple Power Book G4 with Mac OS X 10.4.10  
>> and  I am still R beginner.
>>
>> I try to calculate a t.test() using this code:
>>
>> TTest75<-t.test(Fem75, Mal75, alternative= "two.sided", paired=  
>> TRUE)
>>
>> This works properly, but I have two variables with a lot of  
>> missing  data and therefore get the error message:
>>
>> TTest66<-t.test(Fem66, Mal66, alternative= "two.sided", paired=  
>> TRUE)
>> Fehler in var(x) : 'x' ist leer
>>
>> One of the two vectors looks like this:
>>
>> [1] 5.0  NA 4.5 6.0 0.8  NA 7.0 4.5  NA  NA  NA  NA 5.0  NA 6.0  
>> NA  5.0  NA 5.0 8.0  NA  NA  NA 8.0  NA 8.0 5.0  NA  NA  NA  NA  
>> 8.0  NA 1.0
>> [35]  NA  NA  NA  NA  NA  NA 5.0  NA 4.0 8.0  NA 6.0 6.0 4.5 3.5  
>> NA   NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  
>> NA  NA  NA
>> [69]  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  
>> NA ....
>>
>
>> Is it possible to run a TTest inspite of all the missing data?
>> I really need two know if may two vectors are significantly  
>> different. (If this results are then reliable is an other question)
>>
> Well, you're not showing the other one, but I have a hunch that any
> (complete.cases(Fem66, Mal66)) will come out false,  in which case  
> you don't have paired data and might get rid of paired=TRUE and  
> have an ordinary two sample test. (BTW paired data for females and  
> males? Couples?)
>
>
>> By the way is there a better possibility (and I guess there is)  
>> to  save or export the t.test() results as textfile?
>>
>> Thanks in advance for your help.
>>
>> Greetings
>>
>> Birgit
>>
>> Birgit Lemcke
>> Institut für Systematische Botanik
>> Zollikerstrasse 107
>> CH-8008 Zürich
>> Switzerland
>> Ph: +41 (0)44 634 8351
>> [hidden email]
>>
>>
>>
>>
>>
>>
>> [[alternative HTML version deleted]]
>>
>>    
>> ---------------------------------------------------------------------
>> ---
>>
>> ______________________________________________
>> [hidden email] 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
> ~~~~~~~~~~ - ([hidden email])                  FAX: (+45)  
> 35327907
>
>
Birgit Lemcke
Institut für Systematische Botanik
Zollikerstrasse 107
CH-8008 Zürich
Switzerland
Ph: +41 (0)44 634 8351
[hidden email]






        [[alternative HTML version deleted]]


______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: t.test() with missing values

Peter Dalgaard
Birgit Lemcke wrote:

> Thanks for your answer.
>
> First I will show you both vectors:
>   [...]
>
> I tried this (complete.cases(Fem66, Mal66)) and you are right, it
> gives me back:
>
> (complete.cases(Fem66, Mal66))
>   [1] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
> FALSE FALSE FALSE
[....]

> I thought the t.test is a comparison of means and why can I not use it
> if I have a lot of missing values. Is the reason that I use the paired
> option?
> What is different in the calculation using paired?
>
> Ah ja this seems to be the case:
>
> T66<-t.test(Mal66, Fem66, alternative= "two.sided")
> > T66
>
>
> Welch Two Sample t-test
>
> data:  Mal66 and Fem66
> t = -0.4881, df = 49.229, p-value = 0.6277
> alternative hypothesis: true difference in means is not equal to 0
> 95 percent confidence interval:
> -1.4637045  0.8915906
> sample estimates:
> mean of x mean of y
> 5.096552  5.382609
>
> I use the paired option because may plants (male and female) belong to
> the same species (and because may boss said that I have to use paired
> in this case)
Don't do what your boss says, do what is right! (It might of course be
the same thing). So pair #1 is one species, pair #2 another species, up
to 331 different species?

> 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).

--
   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
~~~~~~~~~~ - ([hidden email])                  FAX: (+45) 35327907

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: t.test() with missing values

Birgitle

Am 14.09.2007 um 10:26 schrieb Peter Dalgaard:

> Birgit Lemcke wrote:
>> Thanks for your answer.
>>
>> First I will show you both vectors:
>>   [...]
>>
>> I tried this (complete.cases(Fem66, Mal66)) and you are right, it
>> gives me back:
>>
>> (complete.cases(Fem66, Mal66))
>>   [1] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
>> FALSE FALSE FALSE
> [....]
>> I thought the t.test is a comparison of means and why can I not  
>> use it
>> if I have a lot of missing values. Is the reason that I use the  
>> paired
>> option?
>> What is different in the calculation using paired?
>>
>> Ah ja this seems to be the case:
>>
>> T66<-t.test(Mal66, Fem66, alternative= "two.sided")
>>> T66
>>
>>
>> Welch Two Sample t-test
>>
>> data:  Mal66 and Fem66
>> t = -0.4881, df = 49.229, p-value = 0.6277
>> alternative hypothesis: true difference in means is not equal to 0
>> 95 percent confidence interval:
>> -1.4637045  0.8915906
>> sample estimates:
>> mean of x mean of y
>> 5.096552  5.382609
>>
>> I use the paired option because may plants (male and female)  
>> belong to
>> the same species (and because may boss said that I have to use paired
>> in this case)
> Don't do what your boss says, do what is right! (It might of course be
> the same thing). So pair #1 is one species, pair #2 another  
> species, up
> to 331 different species?
>
        348 species. The rest is correct.

>> 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).
        Anyway, thanks a lot and I will try to find it or perhaps somebody  
else in the mailing list knows anything about it.

>
> --
>    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
> ~~~~~~~~~~ - ([hidden email])                  FAX: (+45)  
> 35327907
>
>
Birgit Lemcke
Institut für Systematische Botanik
Zollikerstrasse 107
CH-8008 Zürich
Switzerland
Ph: +41 (0)44 634 8351
[hidden email]






        [[alternative HTML version deleted]]


______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: t.test() with missing values

slre
In reply to this post by Birgitle


>>> Peter Dalgaard <[hidden email]> 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?

*******************************************************************
This email and any attachments are confidential. Any use, co...{{dropped}}

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: t.test() with missing values

Peter Dalgaard
In reply to this post by Birgitle
S Ellison wrote:

>  
>>>> Peter Dalgaard <[hidden email]> 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.

--
   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
~~~~~~~~~~ - ([hidden email])                  FAX: (+45) 35327907

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: t.test() with missing values

Birgitle

Am 14.09.2007 um 12:05 schrieb Peter Dalgaard:

> S Ellison wrote:
>>
>>>>> Peter Dalgaard <[hidden email]> 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?

                        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
> ~~~~~~~~~~ - ([hidden email])                  FAX: (+45)  
> 35327907
>
>
Birgit Lemcke
Institut für Systematische Botanik
Zollikerstrasse 107
CH-8008 Zürich
Switzerland
Ph: +41 (0)44 634 8351
[hidden email]






        [[alternative HTML version deleted]]


______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: t.test() with missing values

Peter Dalgaard
Birgit Lemcke wrote:

>
> Am 14.09.2007 um 12:05 schrieb Peter Dalgaard:
>
>> S Ellison wrote:
>>>
>>>>>> Peter Dalgaard <[hidden email]> 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
>> ~~~~~~~~~~ - ([hidden email])                  FAX: (+45)
>> 35327907
>>
>>
>
> Birgit Lemcke
> Institut für Systematische Botanik
> Zollikerstrasse 107
> CH-8008 Zürich
> Switzerland
> Ph: +41 (0)44 634 8351
> [hidden email]
>
>
>
>
>
>


--
   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
~~~~~~~~~~ - ([hidden email])                  FAX: (+45) 35327907

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: t.test() with missing values

PIKAL Petr
Hi

[hidden email] 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 <[hidden email]> 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.

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
> >> ~~~~~~~~~~ - ([hidden email])                  FAX: (+45)
> >> 35327907
> >>
> >>
> >
> > Birgit Lemcke
> > Institut für Systematische Botanik
> > Zollikerstrasse 107
> > CH-8008 Zürich
> > Switzerland
> > Ph: +41 (0)44 634 8351
> > [hidden email]
> >
> >
> >
> >
> >
> >
>
>
> --
>    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
> ~~~~~~~~~~ - ([hidden email])                  FAX: (+45)
35327907
>
> ______________________________________________
> [hidden email] 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.

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: t.test() with missing values

Peter Dalgaard
Petr PIKAL wrote:

> Hi
>
> [hidden email] 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 <[hidden email]> 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.

> 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
>>>> ~~~~~~~~~~ - ([hidden email])                  FAX: (+45)
>>>> 35327907
>>>>
>>>>
>>>>        
>>> Birgit Lemcke
>>> Institut für Systematische Botanik
>>> Zollikerstrasse 107
>>> CH-8008 Zürich
>>> Switzerland
>>> Ph: +41 (0)44 634 8351
>>> [hidden email]
>>>
>>>
>>>
>>>
>>>
>>>
>>>      
>> --
>>    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
>  
>> ~~~~~~~~~~ - ([hidden email])                  FAX: (+45)
>>    
> 35327907
>  
>> ______________________________________________
>> [hidden email] 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.
>>    
>
> ______________________________________________
> [hidden email] 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
~~~~~~~~~~ - ([hidden email])                  FAX: (+45) 35327907

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: t.test() with missing values

Birgitle
In reply to this post by PIKAL Petr

Am 14.09.2007 um 14:12 schrieb Petr PIKAL:

> Hi
>
> [hidden email] 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 <[hidden email]> 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.
>
> Regards
> Petr
>
That is what I found out some hours ago. I thought about this problem  
and in my opinion it makes no sense to test the both vectors for  
significant differences, because I can not use another method for  
this vectors than for the other 24 vectors to test. To get new values  
is also not possible. And so I decided  that I will not test this two  
vectors for significance because of too many missing values.

But I thank you all
for your efforts to help me.

Greetings

Birgit

>
>
>>>             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
>>>> ~~~~~~~~~~ - ([hidden email])                  FAX: (+45)
>>>> 35327907
>>>>
>>>>
>>>
>>> Birgit Lemcke
>>> Institut für Systematische Botanik
>>> Zollikerstrasse 107
>>> CH-8008 Zürich
>>> Switzerland
>>> Ph: +41 (0)44 634 8351
>>> [hidden email]
>>>
>>>
>>>
>>>
>>>
>>>
>>
>>
>> --
>>    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
>> ~~~~~~~~~~ - ([hidden email])                  FAX: (+45)
> 35327907
>>
>> ______________________________________________
>> [hidden email] 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
[hidden email]






        [[alternative HTML version deleted]]


______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: t.test() with missing values

Birgitle
In reply to this post by Peter Dalgaard

Am 14.09.2007 um 14:27 schrieb Peter Dalgaard:

> Petr PIKAL wrote:
>> Hi
>>
>> [hidden email] 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 <[hidden email]> 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
>>>>> ~~~~~~~~~~ - ([hidden email])                  FAX:  
>>>>> (+45)
>>>>> 35327907
>>>>>
>>>>>
>>>>>
>>>> Birgit Lemcke
>>>> Institut für Systematische Botanik
>>>> Zollikerstrasse 107
>>>> CH-8008 Zürich
>>>> Switzerland
>>>> Ph: +41 (0)44 634 8351
>>>> [hidden email]
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>> --
>>>    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
>>
>>> ~~~~~~~~~~ - ([hidden email])                  FAX: (+45)
>>>
>> 35327907
>>
>>> ______________________________________________
>>> [hidden email] 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.
>>>
>>
>> ______________________________________________
>> [hidden email] 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
> ~~~~~~~~~~ - ([hidden email])                  FAX: (+45)  
> 35327907
>
> ______________________________________________
> [hidden email] 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
[hidden email]






        [[alternative HTML version deleted]]


______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: t.test() with missing values

PIKAL Petr
In reply to this post by Peter Dalgaard
> Petr PIKAL wrote:
> > Hi
> >
> > [hidden email] 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 <[hidden email]> 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.

I see, sorry I did not noticed before. But everything depends on which
hypotheses she wants to test. She told us about 334 different plant
species (male and female) and if she wants to test if male and female is
different she does not have many other options.

Petr

>
> > 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
> >>>> ~~~~~~~~~~ - ([hidden email])                  FAX: (+45)
> >>>> 35327907
> >>>>
> >>>>
> >>>>
> >>> Birgit Lemcke
> >>> Institut für Systematische Botanik
> >>> Zollikerstrasse 107
> >>> CH-8008 Zürich
> >>> Switzerland
> >>> Ph: +41 (0)44 634 8351
> >>> [hidden email]
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >> --
> >>    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
> >
> >> ~~~~~~~~~~ - ([hidden email])                  FAX: (+45)
> >>
> > 35327907
> >
> >> ______________________________________________
> >> [hidden email] 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.
> >>
> >
> > ______________________________________________
> > [hidden email] 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
> ~~~~~~~~~~ - ([hidden email])                  FAX: (+45)
35327907
>
> ______________________________________________
> [hidden email] 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.

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: t.test() with missing values

Birgitle

Am 14.09.2007 um 15:54 schrieb Petr PIKAL:

>> Petr PIKAL wrote:
>>> Hi
>>>
>>> [hidden email] 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 <[hidden email]> 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.
>
> I see, sorry I did not noticed before. But everything depends on which
> hypotheses she wants to test. She told us about 334 different plant
348

> species (male and female) and if she wants to test if male and  
> female is
> different

yes

> she does not have many other options.
>
> Petr
>
>>
>>> 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
>>>>>> ~~~~~~~~~~ - ([hidden email])                  FAX:  
>>>>>> (+45)
>>>>>> 35327907
>>>>>>
>>>>>>
>>>>>>
>>>>> Birgit Lemcke
>>>>> Institut für Systematische Botanik
>>>>> Zollikerstrasse 107
>>>>> CH-8008 Zürich
>>>>> Switzerland
>>>>> Ph: +41 (0)44 634 8351
>>>>> [hidden email]
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>> --
>>>>    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
>>>
>>>> ~~~~~~~~~~ - ([hidden email])                  FAX: (+45)
>>>>
>>> 35327907
>>>
>>>> ______________________________________________
>>>> [hidden email] 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.
>>>>
>>>
>>> ______________________________________________
>>> [hidden email] 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
>> ~~~~~~~~~~ - ([hidden email])                  FAX: (+45)
> 35327907
>>
>> ______________________________________________
>> [hidden email] 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.
>
> ______________________________________________
> [hidden email] 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
[hidden email]






        [[alternative HTML version deleted]]


______________________________________________
[hidden email] 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.