qq: QQ plot

Description Usage Arguments Details Author(s) References Examples

Description

A QQ plot designed with statistics students in mind

Usage

1
qq(x,ax=NA,leg=NA,cex.leg=0.8)

Arguments

x

A vector of data

ax

The name you want to call x for the x-axis (if omitted, defaults to what was passed as the first argument). Useful if the variable is a column in a dataframe.

leg

Optional argument that places a legend in the top left of the plot with the text given by leg

cex.leg

Optional argument that gives the magnification of the text in the legend

Details

This function gives QQ plots that are better-suited for students. Instead of plotting quantiles, it plots the observed values of x versus the values expected had x come from a Normal distribution. The distribution can be considered approximately Normal if the points stay within the upper/lower dashed red lines (with the possible exception at the far left/right) and if there is no overall global curvature.

Author(s)

Adam Petrie

References

Introduction to Regression and Modeling

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
   #Not Normal
   data(TIPS)
   qq(TIPS$Bill,ax="Bill")
   
   #Pretty Normal
   data(ATTRACTF)
   qq(ATTRACTF$Score,ax="Attractiveness Score")
   
   
	 

profpetrie/regclass documentation built on May 26, 2019, 8:33 a.m.