BIOphysics & SOFT Matter Department of Ultrafast Optics and Nanophotonics

Institut de Physique et Chimie des Matériaux de Strasbourg

[ -- Internship Proposals -- ]
ABOUT

A blog for physicists or biologists. Mainly for experimentalists interested in Statistics. R scripts detailed and explained.


CONTACT

wilfried.grangeu-paris.fr

Associate Professor at Université Paris Cité

Home Page


TAGS (on this page)


ANOVA (ANalysis Of VAriance) Part I

Posted 2020-10-13 by Wilfried. Post 5 of 13.
ANOVAgraphs Hypothesis_Testing

A step by step guide to perform a single-factor ANOVA


Family-Wise Error Rate (FWER)

Let's first have a look at the code below:

rm(list = ls()) 
n<-2:20
m<-factorial(n)/(factorial(n-2)*factorial(2))
p<- 1- (1-0.05)^m
plot(n,p, main='Probability to observe at least 1 false discovery', xlab='Number of samples')
grid()

Read More [...]

Fitting multiple data at once

Posted 2020-10-08 by Wilfried. Post 3 of 13.
BeginnerFitting graphs

Here, I demonstrate how to fit multiple data at once using an easy script


For this example, I use ggplot2 and so you need to enter:

rm(list = ls()) 
if (!require(ggplot2)) install.packages('ggplot2')

Read More [...]

Non-Linear Fitting

Posted 2020-10-07 by Wilfried. Post 2 of 13.
FittingΧ2 graphs

Non-linear fitting with R (few points, with error bars). I also discuss how some parameters can give statistical information regarding the quality of the fit


As an example of non-linear fitting, I will perform a Michaelis Menten fit on some synthetic data. I am using 3 vectors, which represent the Substrate concentration (S), the rate of product formation (v) as well as the error on v (dv).

rm(list = ls()) 
# data (use c to create a vector and combine elements of identical types)
v<-c(0.004507692,0.004192308,0.00355384,0.002576923,0.001661538,0.001064286)
S<-c(3.6000,1.8000,0.9000,0.4800,0.2250,0.1125)
dv<-c(0.00012, 0.00008,  0.00012, 0.00010, 0.00007, 0.00005)

Read More [...]

Simple Linear Regression

Posted 2020-10-06 by Wilfried. Post 1 of 13.
BeginnerFitting graphs

How to make a very simple linear fit with R (few points, no error bars)


rm(list = ls()) #remove ~ everything in the working environment
myX<-1:10 
myY<-jitter(1:10) 
adjust<-lm(myY ~ myX)  # Use adjust<-lm(myY ~ 0 + myX) to force the intercept at 0
plot(myX,myY,abline(adjust))

Read More [...]