# --------------------------------------------------
# plotting estimates of linear models as forest plot
# --------------------------------------------------
# fit linear model
fit <- lm(airquality$Ozone ~ airquality$Wind + airquality$Temp + airquality$Solar.R)
# plot estimates with CI
sjp.lm(fit, gridBreaksAt = 2)
# plot estimates with CI without standardized beta-values
# and with narrower tick marks (because "gridBreaksAt" was not specified)
sjp.lm(fit)
# ---------------------------------------------------
# plotting regression line of linear model (done
# automatically if fitted model has only 1 predictor)
# ---------------------------------------------------
data(efc)
# fit model
fit <- lm(neg_c_7 ~ quol_5, data=efc)
# plot regression line
sjp.lm(fit)
# plot regression line with label strings
sjp.lm(fit,
axisLabels.x = "Quality of life",
axisLabels.y = "Burden of care",
showLoess = TRUE)
# --------------------------------------------------
# plotting regression lines of each single predictor
# of a fitted model
# --------------------------------------------------
# fit model
fit <- lm(tot_sc_e ~ c12hour + e17age + e42dep, data=efc)
# reression line and scatter plot
sjp.lm(fit, type = "pred")
# reression line w/o scatter plot
sjp.lm(fit,
type = "pred",
showScatterPlot = FALSE)
# --------------------------
# plotting model assumptions
# --------------------------
sjp.lm(fit, type = "ma")
Run the code above in your browser using DataLab