From ef2174aa186b072ad17f18e1ab87bf912bde2a6d Mon Sep 17 00:00:00 2001 From: Federico Marini Date: Wed, 24 Feb 2021 12:52:03 +0100 Subject: [PATCH] esTimate --- 03-StatsForGenomics.Rmd | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/03-StatsForGenomics.Rmd b/03-StatsForGenomics.Rmd index a7bfad2..6a64a1a 100644 --- a/03-StatsForGenomics.Rmd +++ b/03-StatsForGenomics.Rmd @@ -761,20 +761,20 @@ dx=rowMeans(data[,group1])-rowMeans(data[,group2]) require(matrixStats) -# get the esimate of pooled variance +# get the estimate of pooled variance stderr = sqrt( (rowVars(data[,group1])*(n1-1) + rowVars(data[,group2])*(n2-1)) / (n1+n2-2) * ( 1/n1 + 1/n2 )) # do the shrinking towards median mod.stderr = (stderr + median(stderr)) / 2 # moderation in variation -# esimate t statistic with moderated variance +# estimate t statistic with moderated variance t.mod <- dx / mod.stderr # calculate P-value of rejecting null p.mod = 2*pt( -abs(t.mod), n1+n2-2 ) -# esimate t statistic without moderated variance +# estimate t statistic without moderated variance t = dx / stderr # calculate P-value of rejecting null