data(simDat3)
## For cslse objects
mod <- cslseModel(Y ~ Z | ~ X1 + X2, data = simDat3)
fit <- causalSLSE(mod)
plot(fit, "X1")
## Let's change the type of points for the treated and lines for the
## nontreated
gpar <- list(treated = list(points = list(pch = 24, col = 5)),
nontreated = list(lines = list(lty = 5, col =
"darkgreen")), common = list(xlab = "New X", main =
"Plot with changed parameters"))
plot(fit, "X1", addPoints = TRUE, graphPar = gpar)
## For slseModel objects:
mod2 <- slseModel(Y ~ X1 + X2, data = simDat3)
fit2 <- estSLSE(mod2)
plot(fit2, "X1", interval = "confidence", addPoints = TRUE)
## The same graph produced manually
p2 <- plot(fit2, "X1", interval = "confidence", plot = FALSE)
plot(p2$X1, p2$Y, pch = 21, main = "Y against X1", xlab = "X1", ylab =
"Y")
lines(p2$X1, p2$fit, lwd = 2)
lines(p2$X1, p2$lower, lty = 3, lwd = 2)
lines(p2$X1, p2$upper, lty = 3, lwd = 2)
Run the code above in your browser using DataLab