Skip to content
Snippets Groups Projects
Commit a546907b authored by Martin Renoult's avatar Martin Renoult
Browse files

Add new file

parent 5468e12a
No related branches found
No related tags found
No related merge requests found
OLS.R 0 → 100644
## R code for OLS
## Author: Martin Renoult
## correspondence: martin.renoult@misu.su.se
## Created: 27 April 2020
## PMIP2 ensemble
y <- c(4,4.4,2.7,3.4,2.3,3.3,1.8)
x <- c(-2.74899797,-2.82983243,-2.11649457,-3.15521371,-2.35793821,-2.77644642,-1.33816631)
## PMIP2 + 3 ensemble
y <- c(4,4.4,2.7,3.4,2.3,3.3,1.8,
3.2,4.13,4.67,3.45,3.25,2.6,3.37)
x <- c(-2.74899797,-2.82983243,-2.11649457,-3.15521371,-2.35793821,-2.77644642,-1.33816631,
-2.5957031, -3.3755188, -2.5169983, -2.5567322, -1.6669922, -2.81839, -3.1465664)
## PMIP3 ensemble
y <- c(3.2,4.13,4.67,3.45,3.25,2.6,3.37)
x <- c(-2.5957031, -3.3755188, -2.5169983, -2.5567322, -1.6669922, -2.81839, -3.1465664)
## Temperature reconstruction
temp <- rnorm(20000,mean=-2.2,sd=0.4)
## OLS
fit <- lm(y~x)
fit$coefficients
## Prediction intervals and median
obj <- predict(fit, newdata=data.frame(x=temp), interval="prediction",level=0.95)
stat_sum <- colMeans(obj)
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment