Spreadsheet addiction [Software]
❝ ❝ [...] which led regulators to conclude they were the only ones who could be trusted to make proper use of such pernicious creations.
❝
❝ Maybe their coding skills are not any better than mine*, and they consider that they will always trust whatever they do with a spreadsheet more than anything they might obtain with R ?
There is a series of papers about indirect adjusted comparisons in BE published by regulators. All done in Excel.
❝ * […] I spent a few more hours trying to have the colour of the plot change based on simple conditions (red if under a threshold value, green above it). I was even waking up at night with ideas on new ways to test. I never succeeded.
I believe it. is a nasty beast like SAS (© Detlew). Waking up in the middle of the night or – worse – not being able to fall asleep at all is a common side-effect. Since you will never use again, skip this code:
op <- par(no.readonly = TRUE) # Safe original graphics parameters
par(pty = "s") # I want a square plotting region
x <- runif(n=50, min=1, max=20) # Sample from the uniform distribution
a <- 0.5 # Intercept
b <- 2 # Slope
y <- a + b * x + rnorm(n=length(x), mean=0, sd=2) # Response + random error
th <- 10 # Threshold
plot(x, y, type = "n", las = 1) # Important: type="n", will add points later
grid() # Nice to have one
abline(h = th, col = "red") # Line for threshold
abline(lm(y ~ x), lwd = 2, col = "blue") # Linear regression
points(x[y < th], y[y < th], pch = 21, cex = 1.5,
col = "red", bg = "#FFD700AA") # Below threshold
points(x[y >= th], y[y >= th], pch = 21, cex = 1.5,
col = "darkgreen", bg = "#32CD32AA") # At least threshold
par(op) # Restore original graphics parameters
More fancy stuff wanted?
library(shape)
op <- par(no.readonly = TRUE)
par(pty = "s")
x <- runif(n = 50, min = 1, max = 20)
a <- 0.5
b <- 2
y <- a + b * x + rnorm(n=length(x), mean=0, sd=2)
th <- 10
xlim <- c(0, 21)
ylim <- c(0, 42)
plot(x, y, type = "n", las = 1, xlim = xlim, ylim = ylim)
below <- y[y < th]
above <- y[y >= th]
clr.below <- colorRampPalette(c("#880000", "red"))(length(below))
clr.below <- paste0(clr.below, "80")
clr.above <- colorRampPalette(c("#004000", "#00BB00"))(length(above))
clr.above <- paste0(clr.above, "80")
df.below <- data.frame(x=x[y < th], y = below, orig = 1:length(below))
df.below <- df.below[order(df.below$y, decreasing = TRUE), ]
df.below$rank <- length(below):1
df.below$clr <- clr.below[df.below$rank]
df.above <- data.frame(x=x[y >= th], y=above, orig=1:length(above))
df.above <- df.above[order(df.above$y, decreasing = TRUE), ]
df.above$rank <- length(above):1
df.above$clr <- clr.above[df.above$rank]
filledrectangle(wx=30, wy = th, mid = c(10, th/2),
col = colorRampPalette(c("#FFCCCC", "#FFEEEE"))(256))
grid()
abline(lm(y ~ x), lwd = 2, col = "blue")
abline(h = th, col = "red")
box()
for (j in 1:nrow(df.below)) {
points(x = df.below[df.below$rank == j, ]$x,
y = df.below[df.below$rank == j, ]$y,
pch = 21, cex = 1.5,
col = df.below[df.below$rank == j, ]$clr,
bg = df.below[df.below$rank == j, ]$clr)
}
for (j in 1:nrow(df.above)) {
points(x = df.above[df.above$rank == j, ]$x,
y = df.above[df.above$rank == j, ]$y,
pch = 21, cex = 1.5,
col = df.above[df.above$rank == j, ]$clr,
bg = df.above[df.above$rank == j, ]$clr)
}
par(op)
Semitransparent colors in Excel? I don’t think that’s possible.
Dif-tor heh smusma 🖖🏼 Довге життя Україна!
Helmut Schütz
The quality of responses received is directly proportional to the quality of the question asked. 🚮
Science Quotes
Complete thread:
- Spreadsheet failures, any recent examples? ElMaestro 2019-07-18 13:43 [Software]
- Spreadsheet failures, any recent examples? Ohlbe 2019-07-18 14:32
- Spreadsheet addictionHelmut 2019-07-18 16:12
- Nasty beast Ohlbe 2019-07-18 17:30
- Nasty beast Helmut 2019-07-18 20:26
- Nasty beast Ohlbe 2019-07-19 11:32
- Nasty beast ElMaestro 2019-07-19 12:32
- Decidedly off topic Ohlbe 2019-07-19 13:38
- OT: R limbo 101 Helmut 2019-07-19 13:00
- Nasty beast ElMaestro 2019-07-19 12:32
- Nasty beast Ohlbe 2019-07-19 11:32
- Nasty beast Helmut 2019-07-18 20:26
- Spreadsheet addiction Shuanghe 2019-07-18 18:59
- Spreadsheet addiction Helmut 2019-07-18 20:04
- OT: Spreadsheet addiction Shuanghe 2019-07-19 12:41
- OT: Spreadsheet addiction Helmut 2019-07-19 14:29
- OT: Spreadsheet addiction nobody 2019-07-19 15:53
- OT: Spreadsheet addiction Helmut 2019-07-19 19:32
- OT: Spreadsheet addiction nobody 2019-07-19 15:53
- OT: Spreadsheet addiction Helmut 2019-07-19 14:29
- OT: Spreadsheet addiction Shuanghe 2019-07-19 12:41
- Spreadsheet addiction Helmut 2019-07-18 20:04
- Nasty beast Ohlbe 2019-07-18 17:30
- Spreadsheet etc. failures zizou 2019-07-20 00:18
- As designed ☺ Helmut 2019-07-20 02:12
- As designed ☺ ElMaestro 2019-07-20 09:08
- To round or not to round… Helmut 2019-07-20 12:53
- To round or not to round… ElMaestro 2019-07-20 19:59
- floating-point math is always more complex than you think it is mittyri 2019-07-20 22:43
- To round or not to round… ElMaestro 2019-07-20 19:59
- To round or not to round… Helmut 2019-07-20 12:53
- As designed ☺ ElMaestro 2019-07-20 09:08
- As designed ☺ Helmut 2019-07-20 02:12
- Spreadsheet addictionHelmut 2019-07-18 16:12
- Spreadsheet failures, any recent examples? Ohlbe 2020-12-10 18:43
- Floating point arithmetic, again Helmut 2020-12-10 19:12
- Floating point arithmetic, again ElMaestro 2020-12-10 19:40
- Floating point arithmetic, again Ohlbe 2020-12-10 20:18
- Floating point arithmetic, again ElMaestro 2020-12-10 21:38
- Floating point arithmetic, again Ohlbe 2020-12-10 21:46
- Floating point arithmetic, again ElMaestro 2020-12-10 22:05
- Floating point arithmetic, again Ohlbe 2020-12-10 21:46
- Floating point arithmetic, again ElMaestro 2020-12-10 21:38
- Floating point arithmetic, again Ohlbe 2020-12-10 20:18
- Floating point arithmetic, again Ohlbe 2020-12-10 20:13
- Floating point arithmetic, again ElMaestro 2020-12-10 19:40
- From bad to worse Ohlbe 2020-12-10 22:11
- From bad to worse mittyri 2020-12-11 00:22
- All is good Helmut 2020-12-11 00:36
- Float is float PharmCat 2020-12-18 20:53
- Float is float! Helmut 2020-12-20 23:27
- rational solution in R mittyri 2020-12-21 13:49
- related stuff Helmut 2021-01-14 12:53
- related stuff SDavis 2021-02-09 12:02
- related stuff ElMaestro 2021-02-09 19:55
- related stuff SDavis 2021-02-09 12:02
- related stuff Helmut 2021-01-14 12:53
- rational solution in R mittyri 2020-12-21 13:49
- Float is float! Helmut 2020-12-20 23:27
- Float is float PharmCat 2020-12-18 20:53
- Floating point arithmetic, again Helmut 2020-12-10 19:12
- Spreadsheet failures, any recent examples? Ohlbe 2019-07-18 14:32