# Powell Miscellaneous Functions for Teaching and Learning Statistics

Miscellaneous functions useful for teaching statistics as well as actually practicing the art. They typically are not new methods but rather wrappers around either base R or other packages.

A package that includes functions that I find useful for teaching statistics as well as actually practicing the art. They typically are not “new” methods but rather wrappers around either base R or other packages and concepts I’m trying to master. Currently contains:

• `Plot2WayANOVA` which as the name implies conducts a 2 way ANOVA and plots the results using `ggplot2`
• `PlotXTabs` which as the name implies plots cross tabulated variables using `ggplot2`
• `neweta` which is a helper function that appends the results of a Type II eta squared calculation onto a classic ANOVA table
• `Mode` which finds the modal value in a vector of data
• `SeeDist` which wraps around ggplot2 to provide visualizations of univariate data.
• `OurConf` is a simulation function that helps you learn about confidence intervals

## Usage

`library(CGPfunctions)` will load the package which contains 4 functions:

`SeeDist` will give you some plots of the distribution of a variable using `ggplot2`

`Mode` is a helper function that simply returns one or more modal values

`neweta` is a helper function which returns a tibble containing AOV output similar to summary(aov(MyAOV)) but with eta squared computed and appended as an additional column

The `Plot2WayANOVA` function conducts a classic analysis using existing R functions and packages in a sane and defensible manner not necessarily in the one and only manner.

`OurConf` is a simulation function that helps you learn about confidence intervals

## Credits

Many thanks to Dani Navarro and the book > (Learning Statistics with R) whose etaSquared function was the genesis of `neweta`.

“He who gives up safety for speed deserves neither.” (via)

#### A shoutout to some other packages I find essential.

• stringr, for strings.
• lubridate, for date/times.
• forcats, for factors.
• haven, for SPSS, SAS and Stata files.
• readxl, for `.xls` and `.xlsx` files.
• modelr, for modelling within a pipeline
• broom, for turning models into tidy data
• ggplot2, for data visualisation.
• dplyr, for data manipulation.
• tidyr, for data tidying.
• readr, for data import.
• purrr, for functional programming.
• tibble, for tibbles, a modern re-imagining of data frames.

## Leaving Feedback

If you like CGPfunctions, please consider leaving feedback here.

## Contributing

Contributions in the form of feedback, comments, code, and bug reports are most welcome. How to contribute:

• Issues, bug reports, and wish lists: File a GitHub issue.
• Contact the maintainer ibecav at gmail.com by email.

# CGPfunctions 0.4

• Release 0.4 published on Github 11 June 2018

• Changed version # to .4
• Added new function newggslopegraph
• Release 0.3.1 (hotfix) published on Github 25 April 2018

• Changed version # to 3.1
• Added percent scales to percent plot using the scales package which necessitated changes in DESCRIPTION and NAMESPACE
• Added some code to keep track of missing values that are omitted in calculations and plotting
• Creating the ggtitle with a bquote seemed to be creating issues with both performance and also creating intermittent errors if the title was long. Replaced bquote with sprintf and while I was at it changed how it presents
• Rebuilt vignettes and doco as needed to show the changes
• Release 0.3 published on CRAN

• Release 0.1

# Reference manual

install.packages("CGPfunctions")

0.6.3 by Chuck Powell, 5 months ago

https://github.com/ibecav/CGPfunctions

Report a bug at https://github.com/ibecav/CGPfunctions/issues

Browse source code at https://github.com/cran/CGPfunctions

Authors: Chuck Powell [aut, cre]

Documentation:   PDF Manual