didacticPlot
didacticPlot
didacticPlot is useful for making ggplot2 plots of distributions of t, F, Chi^2, and Pearson r, showing a given value, and shading the arie covering the more extreme values. didacticPlotTheme is the basic theme.
 Keywords
 utilities
Usage
didacticPlot(foundValue, statistic, df1, df2 = NULL, granularity = 1000, xLim = NULL, yLab = NULL, lineCol = "red", lineSize=1, surfaceCol = "red", textMarginFactor = 20, sided="two")
didacticPlotTheme(base_size = 14, base_family = "")
Arguments
 foundValue
 The value to indicate (the 'found' value).
 statistic
 One of "r", "t", "f" or "chisq".
 df1, df2
 The degrees of freedom; only use df1 for the r, t and chi^2 test; for the Ftest, use df1 for the degrees of freedom of the denominator and df2 for the degrees of freedom of the numerator.
 granularity
 Steps to use for xaxis.
 xLim
 Vector; minimum and maximum values on x axis.
 yLab
 Label on y axis.
 lineCol
 Colour of density line.
 lineSize
 Size of density line.
 surfaceCol
 Colour of coloured surface area.
 textMarginFactor
 Used to calculate how close to the vertical line text labels should appear.
 sided
 Whether to make a plot for a 2sided or 1sided test.
 base_size, base_family
 Passed on to the grey ggplot theme.
Value

didacticPlot returns an object that contains the plot in the $plot element.
Examples
didacticPlot(1, statistic='chisq', df1=2);
didacticPlot(1, statistic='t', df1=40);
didacticPlot(2.02, statistic='t', df1=40, textMarginFactor=25);
### Two sample ttest for n1 = n2 = 250, showing
### pvalue of 5%
# a<didacticPlot(1.96, statistic='t', df1=498);
Community examples
Looks like there are no examples yet.