Learn R Programming

simfit (version 0.1.0)

pred.plot: Add model fit line (with SE) to GLM models (Poisson, negative binomial etc)

Description

Add model fit line (with SE) to GLM models (Poisson, negative binomial etc)

Usage

pred.plot(model, xpred = NULL, ci = 0.95)

Arguments

model

a model object, from (eg) lm glm

xpred

the predictor to be plotted on the x axis

ci

value for confidence interval (defaults to 0.95)

Value

ggplot object with fit line

Examples

Run this code
# NOT RUN {
#' ## Anwar M, Green JA, Norris P, et al 
## Prospective daily diary study reporting of any and all symptoms in healthy 
## adults in Pakistan: prevalence and #' response
## BMJ Open 2017;7:e014998
# }
# NOT RUN {
data(symptom)
glm.symptom <- glm(actual_help_days ~ symp_days_reported, 
     family = "poisson", data = symptom)
pred.plot(glm.symptom)
# }

Run the code above in your browser using DataLab