Skip to content
Snippets Groups Projects
Commit b1799375 authored by wactbprot's avatar wactbprot
Browse files

.

parent 6a1eaaf8
No related branches found
No related tags found
No related merge requests found
......@@ -43,7 +43,7 @@ d <- list(
d$m$rand <- rep(NA, d$N)
d$c$rand <- rep(NA, d$N)
d$p$rand <- rep(NA, d$N)
d$p$randMean <- rep(NA, d$N)
d$t$randMean <- rep(NA, d$N)
......@@ -59,8 +59,8 @@ d <- list(
d$p$lower[i],
length.out = d$M)
d$p$rand[i,] <- d$p.pure[i,] + rnorm(d$M, 0, d$p$randSd)
d$t$rand[i,] <- d$t.pure[i,] + rnorm(d$M, 0, d$t$randSd)
d$p$rand[i,] <- d$p$pure[i,] + rnorm(d$M, 0, d$p$randSd)
d$t$rand[i,] <- d$t$pure[i,] + rnorm(d$M, 0, d$t$randSd)
temp.lm <- lm( d$p$rand[i,] ~ d$t$rand[i,])
d$c$rand[i] <- coefficients(temp.lm)[1]
......@@ -78,14 +78,14 @@ d <- list(
### --- plot ---
pt.df <- data.frame(d$p$pure = as.vector(d$p$pure),
d$t$pure = as.vector(d$t$pure),
d$p$rand = as.vector(d$p$rand),
d$t$rand = as.vector(d$t$rand))
pt.df <- data.frame(d.p.pure = as.vector(d$p$pure),
d.t.pure = as.vector(d$t$pure),
d.p.rand = as.vector(d$p$rand),
d.t.rand = as.vector(d$t$rand))
ggplot(pt.df) +
geom_point(aes(x = d$t$pure, y = d$p$pure), color='black') +
geom_point(aes(x = d$t$rand, y = d$p$rand), color='red') +
geom_abline(aes(intercept = c.rand, slope = m.rand), color='red') +
geom_vline(xintercept = d$t$rand.0, linetype = "longdash") +
geom_point(aes(y = d$p$rand.mean, x = d$t$rand.mean), color="black", size=4) +
geom_point(aes(x = d.t.pure, y = d.p.pure), color='black') +
geom_point(aes(x = d.t.rand, y = d.p.rand), color='red') +
geom_abline(aes(intercept = d$c$rand, slope = d$m$rand), color='red') +
geom_vline(xintercept = d$t$rand0, linetype = "longdash") +
geom_point(aes(y = d$p$randMean, x = d$t$randMean), color="black", size=4) +
ggtitle("dp vs. dt")
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment