[R] t-test calculation correct?

Bert Gunter gunter.berton at gene.com
Mon Jan 17 17:04:18 CET 2011


As this is apparently a post hoc test, this is wrong. The results are
biased. You have provided a nice example of how to do irreproducible
science.

Consult a local statistician for what this means if you do not know.

-- Bert Gunter

On Mon, Jan 17, 2011 at 4:35 AM, Sascha Vieweg <saschaview at gmail.com> wrote:
> A multinomial logit model (N=192) revealed (besides others) the following
> statistics for the outcome, y, and one predictor, x:
>
> - y = A (baseline, n=34)
> - y = B (n=26), B(x)=0.7323 (SE=0.2384)
> - y = C (n=132), B(x)=0.6535 (SE=0.2041)
>
> With a t-test I want to explore whether the two predictors differ
> significantly, and I use the following calculation (according to Bortz,
> 2005, p.140):
>
> ##########
> dm <- 0.7323 - 0.6535
> se.dm <- sqrt( (0.2384 / (34 + 26)) + (0.2041 / (34 + 132)) )
> t.val <- dm / se.dm
> pval <- (1 - pt(t.val, df=(34+26+132) )) * 2
> ##########
>
> My question is where this calculation is wrong and why.
>
> Ref.: Bortz, J. (2005). Statistik für Human- und Sozialwissenschaftler (6.
> Aufl). Berlin: Springer.
>
>
> --
> Sascha Vieweg, saschaview at gmail.com
>
> ______________________________________________
> 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.
>



-- 
Bert Gunter
Genentech Nonclinical Biostatistics
467-7374
http://devo.gene.com/groups/devo/depts/ncb/home.shtml



More information about the R-help mailing list