Description Usage Arguments Value Examples

View source: R/plot_functions.R

Plot simulated data from a GLM model

1 2 3 4 5 6 7 8 9 10 |

`model` |
a model object, from (eg) lm glm (Poisson, Negative binomial) |

`xpred` |
the predictor to be plotted on the x axis |

`seed` |
random seed so that simulation results are replicable |

`fit.line` |
if TRUE (default) adds fit line with SE |

`ci` |
passes confidence interval width for fit curve (defaults to 0.95) |

`npoints` |
number of data points to for fit line. Either specify a number, or "same" will return a simulation of the same size as the original dataset. |

`orig_jitter` |
amount of jitter to apply to original dataset (default 0.10) |

`sim_jitter` |
amount of jitter to apply to simulated data (default 0.10) |

ggplot object with simulated data plotted with original

1 2 3 4 5 6 7 8 | ```
## 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
data(symptom)
glm.symptom <- glm(actual_help_days ~ symp_days_reported,
family = "poisson", data = symptom)
sim.plot(glm.symptom)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.