[R] Should help of estimate in t.test be corrected?
Ebert,Timothy Aaron
tebert @end|ng |rom u||@edu
Mon Apr 3 21:14:58 CEST 2023
IMHO The difference makes sense for paired samples. For unpaired samples it is just the difference in means. I think presenting the means (and assuming the audience can perform subtraction) conveys more information. The interpretation of a difference of 5 might be influenced if I have means of -3, 2, or 4, 9, or 2000, 2005.
Tim
-----Original Message-----
From: R-help <r-help-bounces using r-project.org> On Behalf Of Samuel Granjeaud IR/Inserm
Sent: Monday, April 3, 2023 7:25 AM
To: PIKAL Petr <petr.pikal using precheza.cz>; r-help using r-project.org
Subject: Re: [R] Should help of estimate in t.test be corrected?
[External Email]
Hi
Thanks for your feedback. I didn't think about that.
Still, the mean difference is computed for paired, not because there are two samples. IMHO, the help should be updated.
Best,
Samuel
Le 2023-04-03 à 12:10, PIKAL Petr a écrit :
> Hi
>
> You need to use paired option
>
>> t.test(x=0:4, y=sample(5:9), paired=TRUE)$estimate
> mean difference
> -5
>
> Cheers
> Petr
>
>> -----Original Message-----
>> From: R-help <r-help-bounces using r-project.org> On Behalf Of Samuel
>> Granjeaud IR/Inserm
>> Sent: Sunday, April 2, 2023 11:39 PM
>> To: r-help using r-project.org
>> Subject: [R] Should help of estimate in t.test be corrected?
>>
>> Hi,
>>
>> Not important, but IMHO the estimate component of the t.test holds an
>> estimate of mean of each group, never a difference. The doc says
>> "estimate the estimated mean or difference in means depending on whether
>> it
>> was a one-sample test or a two-sample test."
>>
>> > t.test(0:4)$estimate
>> mean of x
>> 2
>> > t.test(0:4, 5:9)$estimate
>> mean of x mean of y
>> 2 7
>>
>> Best,
>> Samuel
>>
>> ______________________________________________
>> R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
>> https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fsta
>> t.ethz.ch%2Fmailman%2Flistinfo%2Fr-help&data=05%7C01%7Ctebert%40ufl.e
>> du%7Cdd06e263220c464ea0c908db3475a677%7C0d4da0f84a314d76ace60a62331e1
>> b84%7C0%7C0%7C638161452151623376%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4w
>> LjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7
>> C&sdata=a7zlFppg4iG2uyMH7mpgyoLTIxXG8F3dx3FPt6YfLdc%3D&reserved=0
>> PLEASE do read the posting guide
>> https://nam10.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.
>> r-project.org%2Fposting-guide.html&data=05%7C01%7Ctebert%40ufl.edu%7C
>> dd06e263220c464ea0c908db3475a677%7C0d4da0f84a314d76ace60a62331e1b84%7
>> C0%7C0%7C638161452151623376%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwM
>> DAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sda
>> ta=e%2B0jDRNJRJJ%2BE%2F091LZxD5%2BUhJAz%2FzSjJ7YZhYdFhDk%3D&reserved=
>> 0 and provide commented, minimal, self-contained, reproducible code.
______________________________________________
R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fstat.ethz.ch%2Fmailman%2Flistinfo%2Fr-help&data=05%7C01%7Ctebert%40ufl.edu%7Cdd06e263220c464ea0c908db3475a677%7C0d4da0f84a314d76ace60a62331e1b84%7C0%7C0%7C638161452151623376%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=a7zlFppg4iG2uyMH7mpgyoLTIxXG8F3dx3FPt6YfLdc%3D&reserved=0
PLEASE do read the posting guide https://nam10.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.r-project.org%2Fposting-guide.html&data=05%7C01%7Ctebert%40ufl.edu%7Cdd06e263220c464ea0c908db3475a677%7C0d4da0f84a314d76ace60a62331e1b84%7C0%7C0%7C638161452151623376%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=e%2B0jDRNJRJJ%2BE%2F091LZxD5%2BUhJAz%2FzSjJ7YZhYdFhDk%3D&reserved=0
and provide commented, minimal, self-contained, reproducible code.
More information about the R-help
mailing list