-
Notifications
You must be signed in to change notification settings - Fork 17
/
README.Rmd
86 lines (61 loc) · 3.26 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
---
output: github_document
---
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
out.width = "100%"
)
options(tibble.print_min = 5, tibble.print_max = 5)
```
# flexplot <img src='flexplot.svg' align="right" height="139" /></a>
<!-- badges: start -->
<!-- [![CRAN status](https://www.r-pkg.org/badges/version/dplyr)](https://cran.r-project.org/package=dplyr) -->
[![Travis build status](https://travis-ci.org/dustinfife/flexplot.svg?branch=master)](https://travis-ci.org/dustinfife/flexplot)
[![codecov](https://codecov.io/gh/dustinfife/flexplot/branch/master/graph/badge.svg)](https://codecov.io/gh/dustinfife/flexplot)
<!-- badges: end -->
## Overview
flexplot is a set of tools designed to pair with statistical modeling and simplify the process of visualizing data analysis. Some of the primary functions include:
* `flexplot()` flexible and intelligent multivariate graphics
* `added.plot()` added variable plots
* `visualize()` shows a visual representation of a fitted object
* `compare.fits()` visually compares the fit of two different models
* `estimates()` reports of effect sizes for statistical models
* `model.comparison()` statistically compares the fits of two different models
A more complete manual for flexplot can be found at the [Psych Arxiv](https://psyarxiv.com/kh9c3)
## Installation of flexplot
```{r, eval = FALSE}
# install.packages("devtools")
# install the stable version
devtools::install_github("dustinfife/flexplot")
# install the development version
devtools::install_github("dustinfife/flexplot", ref="development")
```
## Usage
```{r, message = FALSE, warning=FALSE, message=FALSE}
library(flexplot)
data(relationship_satisfaction)
### multivariate relationship
flexplot(satisfaction~communication + separated | gender + interests, data=relationship_satisfaction)
### show a straight line, remove standard errors, and specify 3 bins
flexplot(satisfaction~communication + separated | gender + interests, data=relationship_satisfaction, method="lm", se=F, bins=3)
### show a ghost line to simplify comparisons
flexplot(satisfaction~communication + separated | gender + interests, data=relationship_satisfaction, method="lm", se=F, bins=3, ghost.line="black")
### categorical variable
flexplot(satisfaction~gender, data=relationship_satisfaction, spread="quartiles", jitter=c(.1, 0))
### histogram/barchart
flexplot(satisfaction~1, data=relationship_satisfaction)
flexplot(gender~1, data=relationship_satisfaction)
### added variable plot
added.plot(satisfaction~communication + separated | gender + interests, data=relationship_satisfaction, method="quadratic", se=F)
### modeling + graphics
full.mod = lm(satisfaction~communication * separated , data=relationship_satisfaction)
reduced.mod = lm(satisfaction~communication + separated , data=relationship_satisfaction)
visualize(full.mod)
estimates(full.mod)
compare.fits(satisfaction~communication|separated, data=relationship_satisfaction, full.mod, reduced.mod)
model.comparison(full.mod, reduced.mod)
```
## Getting help
If something breaks, please post a minimal reproducible example on [github](https://github.com/dustinfife/flexplot/issues). For questions and other discussion, contact me on [twitter](http://www.twitter.com/dustinfife) or by [email]([email protected]).