2
It is possible to play this Regression graph in R or Python?
Obs. This graph was produced using the Acquire 4 QAQC object. Link
And this is the model I’ve created so far.
dados = read.csv("C:\\Users\\....\\Desktop\\data3.csv", header = T)
# 0. Build linear model
model <- lm(CK ~ OR, data = dados)
summary(model)
# 1. Add predictions
pred.int <- predict(model, interval = "prediction")
mydata <- cbind(dados, pred.int)
# 2. Regression line
library("ggplot2")
p <- ggplot(mydata, aes(OR, CK)) +
geom_point() +
stat_smooth(method = lm)
# 3. Add prediction intervals
p + geom_line(aes(y = lwr), color = "red", linetype = "dashed")+
geom_line(aes(y = upr), color = "red", linetype = "dashed")
My database: Link
I managed to settle otherwise, anyway thanks for the support.
– Thiago Fernandes