A blog for physicists or biologists. Mainly for experimentalists interested in Statistics. R scripts detailed and explained.
wilfried.grangeu-paris.fr
Associate Professor at Université Paris Cité
Change point detection. Part I : rolling t-test
In a time series, change point detection tries to identify abrupt changes. Different approaches have been proposed and here I show one of them based on a simple rolling t-test.
For this example, I use ggplot2 and so you need to enter:
rm(list = ls())
if (!require(ggplot2)) install.packages('ggplot2')
What is Statiscal Power? Why should I mention it when comparing means of 2 samples?
We have previously performed some 2-sample t-tests. When the p-value was smaller than 0.05, we have concluded that the 2 samples originate from 2 populations with equal means. Obviously the probability to conclude that 2 samples (originating from populations with different means) have equal means depends on the sample size, the actual difference in means and the type-I error. That is what we will investigate here.
Let us define some parameters:
rm(list = ls())
delta<-0.5 # difference in means
sd<-1.5 # standard deviation in populations
mu1<-20 # mean of 1st population
mu2<-mu1+delta # mean of 2nd population
n<-40 # number (n) of elements in each sample
Calculating 0.84 confidence intervals and performing a two-sample t-test
As usual, we check for some packages.
rm(list = ls())
if (!require(gridExtra)) install.packages('gridExtra')
P i m p my ANOVA Graph. Display FDR values for multiple comparisons
As usual, we check for some packages
rm(list = ls())
# Check for Packages
if (!require(ggsignif)) install.packages('ggsignif')